Skip to content

Conversation

@zoroglucihat
Copy link
Contributor

The metadata.yaml file was missing the required 'kind: Metadata' field, which caused clusterctl init --infrastructure azure to fail with: 'unexpected kind "" for provider infrastructure-azure (expected "Metadata")'

This fix adds the missing kind field to resolve the clusterctl initialization error.

Fixes: clusterctl init --infrastructure azure validation error

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR fixes a critical issue where clusterctl init --infrastructure azure fails due to a missing kind: Metadata field in the metadata.yaml file. The clusterctl tool expects this field for proper provider metadata validation, and without it, users cannot initialize the Azure infrastructure provider.

The fix adds the missing kind: Metadata field to line 7 of metadata.yaml, following the same format used in test metadata files throughout the repository.

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

Special notes for your reviewer:

  • This is a minimal fix that only adds the missing required field
  • The change follows the exact format used in test metadata files (e.g., test/e2e/data/shared/v1beta1/metadata.yaml)
  • All existing tests pass with this change
  • No functional changes to the provider logic

TODOs:

  • squashed commits
  • includes documentation (not needed - metadata format fix)
  • adds unit tests (existing tests cover this)
  • cherry-pick candidate

Release note:

Fix clusterctl init --infrastructure azure failure by adding missing kind field to metadata.yaml

The metadata.yaml file was missing the required 'kind: Metadata' field,
which caused clusterctl init --infrastructure azure to fail with:
'unexpected kind "" for provider infrastructure-azure (expected "Metadata")'

This fix adds the missing kind field to resolve the clusterctl initialization error.

Fixes: clusterctl init --infrastructure azure validation error
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Aug 22, 2025
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 22, 2025

CLA Signed

  • ✅login: zoroglucihat / name: zoroglucihat / (1f2f48a)

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @zoroglucihat!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-azure 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-azure has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 22, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @zoroglucihat. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 22, 2025
@nojnhuh
Copy link
Contributor

nojnhuh commented Aug 24, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 24, 2025
@codecov
Copy link

codecov bot commented Aug 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.94%. Comparing base (4ad8f96) to head (1f2f48a).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5835   +/-   ##
=======================================
  Coverage   46.94%   46.94%           
=======================================
  Files         279      279           
  Lines       29687    29687           
=======================================
  Hits        13936    13936           
  Misses      14938    14938           
  Partials      813      813           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nojnhuh
Copy link
Contributor

nojnhuh commented Aug 24, 2025

These tests should cover all the ways we install CAPI:

/test pull-cluster-api-provider-azure-ci-entrypoint
/test pull-cluster-api-provider-azure-conformance-ipv6-with-ci-artifacts
/test pull-cluster-api-provider-azure-e2e

Copy link
Contributor

@nojnhuh nojnhuh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks!

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

LGTM label has been added.

Git tree hash: 8c3ce72834aa686bda0319ff1336c3b0d9bcdda8

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nojnhuh

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 25, 2025
@k8s-ci-robot k8s-ci-robot merged commit 51340ad into kubernetes-sigs:main Aug 25, 2025
21 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Aug 25, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in CAPZ Planning Aug 25, 2025
@nojnhuh
Copy link
Contributor

nojnhuh commented Aug 28, 2025

/milestone v1.22

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.21, v1.22 Aug 28, 2025
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

clusterctl init fails

3 participants