Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Register kubeconfig flag variable via RegisterFlags func #1999

Merged

Conversation

johannesfrey
Copy link
Contributor

@johannesfrey johannesfrey commented Sep 13, 2022

There have been reported issues (flag redefined) because CR registers the kubeconfig flag to the default command line FlagSet via init function. See:

This PR provides an exported func to register flags that defensively tries to register the kubeconfig flag if not already defined. It does only change the current behaviour by previously checking if has already been defined.

As a follow up the registration via init should probably removed in conjunction with a ⚠️ release note, as it would be a breaking change for the user.

NOTE: I am not entirely sure if this really is the desired way to go and to start a discussion regarding the topic.

Johannes Frey <johannes.frey@mercedes-benz.com>, Mercedes-Benz Tech Innovation GmbH (Provider Information)

@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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 13, 2022
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 13, 2022
Signed-off-by: Johannes Frey <johannes.frey@mercedes-benz.com>
@johannesfrey
Copy link
Contributor Author

/test pull-controller-runtime-test-master

@johannesfrey
Copy link
Contributor Author

/retest

@johannesfrey johannesfrey changed the title [WIP] 🌱 Register kubeconfig flag variable via RegisterFlags func 🌱 [WIP] Register kubeconfig flag variable via RegisterFlags func Sep 20, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 20, 2022
@johannesfrey
Copy link
Contributor Author

/label do-not-merge/work-in-progress

@k8s-ci-robot
Copy link
Contributor

@johannesfrey: The label(s) /label do-not-merge/work-in-progress cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor

In response to this:

/label do-not-merge/work-in-progress

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sbueringer
Copy link
Member

/label do-not-merge/work-in-progress

I think if you move [WIP] to be a prefix it should work automatically

@sbueringer
Copy link
Member

/retitle [WIP] 🌱 Register kubeconfig flag variable via RegisterFlags func

@k8s-ci-robot k8s-ci-robot changed the title 🌱 [WIP] Register kubeconfig flag variable via RegisterFlags func [WIP] 🌱 Register kubeconfig flag variable via RegisterFlags func Sep 20, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 20, 2022
@johannesfrey
Copy link
Contributor Author

/label do-not-merge/work-in-progress

I think if you move [WIP] to be a prefix it should work automatically

Yeah, I had it like that but then workflow complains 😅

@sbueringer
Copy link
Member

/label do-not-merge/work-in-progress

I think if you move [WIP] to be a prefix it should work automatically

Yeah, I had it like that but then workflow complains sweat_smile

This can be fixed/changed by bumping kubebuilder-release-tools to v0.2.0: https://github.com/kubernetes-sigs/controller-runtime/blob/master/.github/workflows/verify.yml#L12

@johannesfrey johannesfrey changed the title [WIP] 🌱 Register kubeconfig flag variable via RegisterFlags func 🌱 Register kubeconfig flag variable via RegisterFlags func Oct 6, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 6, 2022
@johannesfrey
Copy link
Contributor Author

/retest

1 similar comment
@johannesfrey
Copy link
Contributor Author

/retest

Signed-off-by: Johannes Frey <johannes.frey@mercedes-benz.com>
@alvaroaleman alvaroaleman added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Oct 26, 2022
Copy link
Member

@alvaroaleman alvaroaleman left a comment

Choose a reason for hiding this comment

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

thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 26, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, johannesfrey

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

The pull request process is described 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants