Skip to content

🌱 feat: add check version against metadata utility #12529

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

richardcase
Copy link
Member

@richardcase richardcase commented Jul 25, 2025

What this PR does / why we need it:

This adds a new command to clusterctl which given a version number will check that there is a release series defined in a metadata file for that version.

The main use case for this is a CI check. When building a release of a provider that is for a new major or minor version, it's required that a new release series is added to the providers' metadata file. This ensures that the correct version of the provider is installed when initializing a management cluster.

A common failure for release pipelines is that the metadata file hasn't been updated and it's only found out when someone tries to deploy the new version.

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 #

/area util

@k8s-ci-robot k8s-ci-robot added area/clusterctl Issues or PRs related to clusterctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 25, 2025
@k8s-ci-robot k8s-ci-robot requested review from Jont828 and sivchari July 25, 2025 14:12
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign enxebre 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 25, 2025
@richardcase richardcase force-pushed the metadata_file_checker branch from 846c0e4 to 12b25d6 Compare July 25, 2025 14:15
@fabriziopandini
Copy link
Member

have you consider to add this to hack tools like we have for other tools we are using in CI or during release?

@richardcase
Copy link
Member Author

have you consider to add this to hack tools like we have for other tools we are using in CI or during release?

I hadn't to be honest. I thought it would be mostly used by providers and may be easier from clusterctl. But thinking about it a single responsibility cli tool in hack/tools may be better and providers can go install in their release pipelines. I will change it, thanks @fabriziopandini .

Moving to WIP whilst i make the change.

@richardcase richardcase changed the title 🌱 feat: add check metadata command to clusterctl WIP: 🌱 feat: add check metadata command to clusterctl Jul 25, 2025
@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 Jul 25, 2025
@fabriziopandini
Copy link
Member

Thanks,
I think we should keep clusterctl scope limited and user focused (dev tools should go in hack tools)

@richardcase richardcase force-pushed the metadata_file_checker branch from 12b25d6 to 54ea9cc Compare July 29, 2025 10:49
@richardcase richardcase changed the title WIP: 🌱 feat: add check metadata command to clusterctl 🌱 feat: add check metadata command to clusterctl Jul 29, 2025
@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 Jul 29, 2025
This adds a CLI utility which given a version number will
check that there is a release series defined in a metadata file for
that version.

The main use case for this is a CI check. When building a release of a
provider that is for a new major or minor version its required that a
new release series is added to the providers metadata file. This ensures
that the correct version of the provider is installed when initializing
a management cluster.

A common failure for release pipelines is that the metadata file hasn't
been updated.

Signed-off-by: Richard Case <[email protected]>
@richardcase richardcase force-pushed the metadata_file_checker branch from 54ea9cc to 3dbd25b Compare July 29, 2025 13:24
@richardcase
Copy link
Member Author

/remove-area clusterctl
/area util

@k8s-ci-robot k8s-ci-robot added area/util Issues or PRs related to utils and removed area/clusterctl Issues or PRs related to clusterctl labels Jul 29, 2025
@richardcase richardcase changed the title 🌱 feat: add check metadata command to clusterctl 🌱 feat: add check version against metadata utility Jul 29, 2025
@richardcase
Copy link
Member Author

Changed so this is now in hack/tools like other CLI helper tools.

Then run the binary to check a version:

```bash
bin/metadata-version-validator --file ../../cluster-api-provider-aws/metadata.yaml --version v2.8.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bin/metadata-version-validator --file ../../cluster-api-provider-aws/metadata.yaml --version v2.8.0
bin/metadata-version-validator --file ../../metadata.yaml --version v1.11.0

Maybe it's better to reference a file in CAPI so the docs example is self-contained? That is, I got an error trying to follow this doc naively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/util Issues or PRs related to utils cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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.

4 participants