Skip to content

api: deprecate targetRefs in favor of parentRefs#580

Closed
mathetake wants to merge 5 commits intomainfrom
parente
Closed

api: deprecate targetRefs in favor of parentRefs#580
mathetake wants to merge 5 commits intomainfrom
parente

Conversation

@mathetake
Copy link
Copy Markdown
Member

Commit Message

This will mark targetRefs field of AIGatewayRoute as deprecated in favor of parentRefs, which is more idiomatic way of "attaching" routes to Gateways.

The field will be removed in the one version after the next release, which is v0.3.0.

Related Issues/PRs (if applicable)

Closes #550

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
@mathetake mathetake marked this pull request as ready for review April 18, 2025 21:58
@mathetake mathetake requested a review from a team as a code owner April 18, 2025 21:58
@mathetake mathetake requested review from arkodg and yuzisun April 18, 2025 21:58
@mathetake
Copy link
Copy Markdown
Member Author

PTAL @arkodg


// AIGatewayRouteSpec details the AIGatewayRoute configuration.
//
// +kubebuilder:validation:XValidation:rule="!has(self.parentRefs) || !has(self.targetRefs) || size(self.targetRefs) == 0", message="targetRefs is deprecated, use parentRefs only"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this will reject previous config, is that the goal ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No this won’t reject existing ones as they don’t have parentRefs set hence this is always true

// Deprecated: use the ParentRefs field instead. This field will be dropped in Envoy AI Gateway v0.3.0.
TargetRefs []gwapiv1a2.LocalPolicyTargetReferenceWithSectionName `json:"targetRefs,omitempty"`
// ParentRefs are the names of the Gateway resources this AIGatewayRoute is being attached to.
// Cross namespace references are not supported. In other words, the Gateway resources must be in the
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can this be relaxed in the future / follow up PR ?
its very common for the Gateway and Route to live in different ns

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah possible

Copy link
Copy Markdown

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@mathetake
Copy link
Copy Markdown
Member Author

ping someone could you approve @envoyproxy/ai-gateway-maintainers

@mathetake
Copy link
Copy Markdown
Member Author

this needs a rebase after v0.2

@mathetake mathetake closed this Jun 6, 2025
@mathetake
Copy link
Copy Markdown
Member Author

will redo later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AIGatewayRoute should use parentRefs, not targetRefs

3 participants