Skip to content

bug: honor BackendTrafficPolicy targetRefs.sectionName when attaching to Service backends #421

@kayx23

Description

@kayx23

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions