Summary
Please triage whether BackendTrafficPolicy.targetRefs.sectionName should be honored when attaching backend traffic policy settings to Service backends.
Current behavior
The current controller surface accepts targetRefs[].sectionName, and the generated API reference describes sectionName for Service targets as the port name.
However, the current attachment path appears to match only the backend Service name when applying BackendTrafficPolicy to an upstream.
In 2.1.0, internal/adc/translator/policies.go iterates over po.Spec.TargetRefs and matches ref.Name == targetRef.Name, but does not appear to use sectionName when selecting the policy for a specific backend port.
As a result, a BackendTrafficPolicy that is intended to apply to one named Service port may be treated as if it applies to the whole Service.
Use cases affected
- using one Service with multiple named ports and different backend traffic settings per port
- relying on
sectionName to scope BackendTrafficPolicy attachment to a specific backend port instead of the entire Service
Code context
api/v1alpha1/backendtrafficpolicy_types.go
internal/adc/translator/policies.go
Summary
Please triage whether
BackendTrafficPolicy.targetRefs.sectionNameshould be honored when attaching backend traffic policy settings to Service backends.Current behavior
The current controller surface accepts
targetRefs[].sectionName, and the generated API reference describessectionNameforServicetargets as the port name.However, the current attachment path appears to match only the backend Service name when applying
BackendTrafficPolicyto an upstream.In
2.1.0,internal/adc/translator/policies.goiterates overpo.Spec.TargetRefsand matchesref.Name == targetRef.Name, but does not appear to usesectionNamewhen selecting the policy for a specific backend port.As a result, a
BackendTrafficPolicythat is intended to apply to one named Service port may be treated as if it applies to the whole Service.Use cases affected
sectionNameto scopeBackendTrafficPolicyattachment to a specific backend port instead of the entire ServiceCode context
api/v1alpha1/backendtrafficpolicy_types.gointernal/adc/translator/policies.go