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

✨ add version check to clusterctl generate provider #6958

Conversation

ykakarap
Copy link
Contributor

What this PR does / why we need it:

This PR add version check to clusterctl generate provider to make sure that clusterctl does not process and provider incorrect provider components when run against and incompatible version of the provider.

If the command is run with an incompatible version it will throw and error. Example:

Error: current version of clusterctl is only compatible with v1beta1 providers, detected v1alpha3 for provider "aws"

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 #5864

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 20, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 20, 2022
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

one nit, apidiff should be expected, but because only being an addition it should be okay?!

Except nit: lgtm

cmd/clusterctl/client/generate_provider.go Outdated Show resolved Hide resolved
@ykakarap ykakarap force-pushed the clusterctl-generate-provider_version-check branch from d15a87e to 529e0ad Compare July 20, 2022 16:45
@ykakarap
Copy link
Contributor Author

apidiff should be expected, but because only being an addition it should be okay?!

Yes. The API change is about additions to an interface which is okay.

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

LGTM pending one nit

@ykakarap ykakarap force-pushed the clusterctl-generate-provider_version-check branch from 529e0ad to f6596e9 Compare July 21, 2022 20:09
@k8s-ci-robot
Copy link
Contributor

@ykakarap: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-apidiff-main f6596e9 link false /test pull-cluster-api-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/lgtm

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

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

@ykakarap
Copy link
Contributor Author

ykakarap commented Aug 9, 2022

/assign @vincepri for approval.

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 10, 2022
@k8s-ci-robot k8s-ci-robot merged commit 6f288a6 into kubernetes-sigs:main Aug 10, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.3 milestone Aug 10, 2022
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clusterctl generate provider should return early if working with incompatible provider versions
6 participants