Skip to content

Conversation

@rikatz
Copy link
Member

@rikatz rikatz commented Sep 1, 2025

What type of PR is this?
/kind feature

What this PR does / why we need it:
This change adds a feature to support adding parentRefs on Route resources. It is a new slice flag that can be used to establish parentRefs that should be added to converted resources.

This is still a WIP

Which issue(s) this PR fixes:
Part of #243

Does this PR introduce a user-facing change?:

Add support for parentRefs on route conversion

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Sep 1, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rikatz
Once this PR has been reviewed and has the lgtm label, please assign mlavacca for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 1, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 1, 2025
@rikatz
Copy link
Member Author

rikatz commented Sep 2, 2025

For now this is a WIP, I have added the flags only.

If we agree with the syntax, I will apply the parentRefs on the *Route generation.

Later we need to discuss about "not creating a Gateway" if a parentRef is specified (we can add a flag to disable it, so it wont be a breaking change)

providerSpecificFlags map[string]*string

// parentRefs indicates that the created *Route should contain a specific set
// of parentRefs. Its format should be as: --parentRefs=ns/name:sectionname:port=group/kind
Copy link
Member

Choose a reason for hiding this comment

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

not sure I understand the format.what is the double "=" for?

Copy link
Member

Choose a reason for hiding this comment

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

like why we use both ":" and "=" as dividers? I understand the code and what it does but probably missing something on why we choose it.

also this would highly benefit from being a type by itself, I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

It would, do we support types on flags?

So, from the structure of the flag itself, I wanted to follow something that was "as easy as set just the name of the ref" (--parentRef=xpto) but as complex as "I need all of the other fields".

To be really honest, I don't like flags that start to have its own complexity to cover all of the edge cases (eg.: do we really want to add port? sectionName? etc) but also, how can we make it easier once we support ListenerSet to provide the proper conversion? I am open to ideas here

One last comment: this format of the flag was highly inspired on "kubectl create ingress" command, I just did inverted some parameters to make it easier to have something like --parentRefs=Ricardo=XListenerSet

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants