:seedling: Register kubeconfig flag variable via RegisterFlags func
There have been reported issues (flag redefined) because CR registers the kubeconfig flag to the default command line FlagSet via init function. See:
- https://github.com/kubernetes-sigs/controller-runtime/issues/1396
- https://github.com/kubernetes-sigs/controller-runtime/issues/878
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 :warning: 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 <[email protected]>, Mercedes-Benz Tech Innovation GmbH (Provider Information)
/test pull-controller-runtime-test-master
/retest
/label do-not-merge/work-in-progress
@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.
/label do-not-merge/work-in-progress
I think if you move [WIP] to be a prefix it should work automatically
/retitle [WIP] :seedling: Register kubeconfig flag variable via RegisterFlags func
/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:
/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
/retest
/retest
[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
- ~~OWNERS~~ [alvaroaleman]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment