Skip to content

Update TargetREf in Policy GEP #2147

@candita

Description

@candita

Discussion generated from GEP-1897 points out that TargetRef could use some updates.

  1. All policy resources must include TargetRef with the fields specified here:
    type PolicyTargetReference struct {
    // Group is the group of the target resource.
    Group Group `json:"group"`
    // Kind is kind of the target resource.
    Kind Kind `json:"kind"`
    // Name is the name of the target resource.
    Name ObjectName `json:"name"`
    // Namespace is the namespace of the referent. When unspecified, the local
    // namespace is inferred. Even when policy targets a resource in a different
    // namespace, it MUST only apply to traffic originating from the same
    // namespace as the policy.
    //
    // +optional
    Namespace *Namespace `json:"namespace,omitempty"`
    }
  2. Policy resources may also choose to include SectionName and/or Port in TargetRef following the same mechanics of ParentRef

Then we can provide additional TargetRef types that extend the base TargetRef with the different possible combinations of these fields. That feels like it could be handled in a separate smaller update to the policy GEP.

Originally posted by @robscott in #2113 (comment)

Metadata

Metadata

Assignees

Labels

blockedpriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions