Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/gatewayapi/clienttrafficpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ func deprecatedFieldsUsedInClientTrafficPolicy(policy *egv1a1.ClientTrafficPolic
if policy.Spec.TargetRef != nil {
deprecatedFields["spec.targetRef"] = "spec.targetRefs"
}
// Optional is a non-pointer bool, so deprecated usage is only observable when it changes behavior.
if policy.Spec.TLS != nil &&
policy.Spec.TLS.ClientValidation != nil &&
policy.Spec.TLS.ClientValidation.Optional {
deprecatedFields["spec.tls.clientValidation.optional"] = "spec.tls.clientValidation.mode"
}
Comment on lines +51 to +56
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the deprecated-field entry for spec.tls.clientValidation.optional will change warning condition messages in other ClientTrafficPolicy golden outputs beyond clienttrafficpolicy-mtls-client-verification.out.yaml. For example, internal/gatewayapi/testdata/clienttrafficpolicy-mtls-client-verification-expired-crl.out.yaml (target-gateway-2) should now include the spec.tls.clientValidation.optional deprecation in the Warning message, and internal/gatewayapi/testdata/clienttrafficpolicy-invalid-settings.out.yaml (target-gateway-5) should now gain a DeprecatedField Warning when optional: true is set. Please update/regenerate those expected outputs so tests don’t fail and coverage remains consistent.

Copilot uses AI. Check for mistakes.
return deprecatedFields
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ clientTrafficPolicies:
reason: Invalid
status: "False"
type: Accepted
- lastTransitionTime: null
message: spec.tls.clientValidation.optional is deprecated, use spec.tls.clientValidation.mode
instead
reason: DeprecatedField
status: "True"
type: Warning
controllerName: gateway.envoyproxy.io/gatewayclass-controller
gateways:
- apiVersion: gateway.networking.k8s.io/v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ clientTrafficPolicies:
status: "True"
type: Accepted
- lastTransitionTime: null
message: spec.targetRef is deprecated, use spec.targetRefs instead
message: spec.targetRef is deprecated, use spec.targetRefs instead; spec.tls.clientValidation.optional
is deprecated, use spec.tls.clientValidation.mode instead
reason: DeprecatedField
status: "True"
type: Warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ clientTrafficPolicies:
status: "True"
type: Accepted
- lastTransitionTime: null
message: spec.targetRef is deprecated, use spec.targetRefs instead
message: spec.targetRef is deprecated, use spec.targetRefs instead; spec.tls.clientValidation.optional
is deprecated, use spec.tls.clientValidation.mode instead
reason: DeprecatedField
status: "True"
type: Warning
Expand Down
Loading