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

🐛 clusterctl: fix target namespace in v1beta1 CRDs and WebhookConfigurations #5096

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Aug 16, 2021

Signed-off-by: Stefan Büringer [email protected]

What this PR does / why we need it:
Currently, clusterctl only overwrites the target namespace of v1 CRDs and WebhookConfigurations. This PR adjusts clusterctl to also handle the v1beta1 versions.

Note: this has to be supported because v1alpha4 providers are not required to use the v1 versions of those resources.

After this fix clusterctl also returns better errors when used together with v1alpha3 provider versions, i.e.

Error: current version of clusterctl is only compatible with v1alpha4 providers, detected v1alpha3 for provider infrastructure-aws

instead of:

Fetching providers
Error: failed to get provider components for the "aws" provider: failed to set the TargetNamespace on the components: converting (v1beta1.MutatingWebhookConfiguration) to (v1.MutatingWebhookConfiguration): unknown conversion

xref: https://kubernetes.slack.com/archives/C8TSNPY4T/p1629101098162100

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 16, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 16, 2021
@sbueringer sbueringer changed the title clusterctl: fix target namespace in v1beta CRDs and WebhookConfigurations 🐛 clusterctl: fix target namespace in v1beta CRDs and WebhookConfigurations Aug 16, 2021
@sbueringer
Copy link
Member Author

/cc @fabriziopandini @asalkeld

@k8s-ci-robot
Copy link
Contributor

@sbueringer: GitHub didn't allow me to request PR reviews from the following users: asalkeld.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @fabriziopandini @asalkeld

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 sbueringer force-pushed the pr-handle-v1beta1-crd-whc branch from 622d017 to 68ef481 Compare August 16, 2021 16:29
@sbueringer sbueringer changed the title 🐛 clusterctl: fix target namespace in v1beta CRDs and WebhookConfigurations 🐛 clusterctl: fix target namespace in v1beta1 CRDs and WebhookConfigurations Aug 16, 2021
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm
/assign @fabriziopandini

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2021
@sbueringer
Copy link
Member Author

flakes
/retest

@asalkeld
Copy link
Contributor

lgtm
@sbueringer I don't see any code related to After his fix clusterctl also returns better errors when used together with v1alpha3 provider versions, i.e. (or am I missing something?)

@sbueringer
Copy link
Member Author

lgtm
@sbueringer I don't see any code related to After his fix clusterctl also returns better errors when used together with v1alpha3 provider versions, i.e. (or am I missing something?)

Kind of :). If fix target namespace doesn't fail anymore, the code execution continues and in case of usage with a v1alpha3 provider eventually returns e.g. the Error: current version of clusterctl is only compatible with v1alpha4 providers, detected v1alpha3 for provider infrastructure-aws error.

I mostly added this comment in the description because there was a lot of confusion in Slack because a few folks tried to use clusterctl v0.4.x with v1alpha3 providers and got the fix target namespace error instead of the compatibility error.

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@sbueringer thanks for picking up this work!
/lgtm

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 17, 2021
@k8s-ci-robot k8s-ci-robot merged commit fae587a into kubernetes-sigs:master Aug 17, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Aug 17, 2021
@sbueringer sbueringer deleted the pr-handle-v1beta1-crd-whc branch August 17, 2021 15:10
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/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.

5 participants