Skip to content

🐛 avoid empty manager field in ControlPlaneProvider when no controlPlane and no features gates provided #735

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

Merged
merged 3 commits into from
Mar 17, 2025

Conversation

afarbos
Copy link
Contributor

@afarbos afarbos commented Feb 27, 2025

Following #681

What this PR does / why we need it:

Handle cases where manager values is present for default controlPlane provider.
This will make sure the manager field for the default control plane provider is added only if featureGates for this one are present when no controlPlane is provided (despite calling it out in the previous example).
The default controlPlane provider being kubeadm

The last part was the miss of #681

Example with current/v0.17.0 chart:

# Source: cluster-api-operator/charts/cluster-api-operator/templates/infra-conditions.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: ControlPlaneProvider
metadata:
  name: kubeadm
  namespace: capi-kubeadm-control-plane-system
  annotations:
    "helm.sh/hook": "post-install,post-upgrade"
    "helm.sh/hook-weight": "2"
    "argocd.argoproj.io/sync-wave": "2"
spec:
  manager:

Similar error for InfrastructureProvider and there is no workaround for metal3. I tried to set a featuregates foo true to have a valid infrastructure provider but I get this error:

unknown flag: --feature-gates
Usage of /manager:
unknown flag: --feature-gates

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 Feb 27, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 27, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @afarbos. 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 the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 27, 2025
Copy link

netlify bot commented Feb 27, 2025

Deploy Preview for kubernetes-sigs-cluster-api-operator ready!

Name Link
🔨 Latest commit b344000
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-operator/deploys/67d32561367b4d0008765e30
😎 Deploy Preview https://deploy-preview-735--kubernetes-sigs-cluster-api-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@afarbos afarbos changed the title fix: avoid empty manager field in ControlPlaneProvider when no controlPlane and no features gates provided 🐛 avoid empty manager field in ControlPlaneProvider when no controlPlane and no features gates provided Feb 27, 2025
@furkatgofurov7
Copy link
Member

/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 Mar 3, 2025
@furkatgofurov7
Copy link
Member

/test pull-cluster-api-operator-e2e-main

@afarbos
Copy link
Contributor Author

afarbos commented Mar 13, 2025

I am not sure to follow the failure but I did found more issues like this.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 13, 2025
@afarbos
Copy link
Contributor Author

afarbos commented Mar 13, 2025

/retest

@afarbos afarbos force-pushed the af/NoFeatureGateCPDefault branch 2 times, most recently from 85d448c to 3b8db64 Compare March 13, 2025 17:47
@afarbos afarbos force-pushed the af/NoFeatureGateCPDefault branch from 3b8db64 to 0a8974f Compare March 13, 2025 18:14
@afarbos afarbos force-pushed the af/NoFeatureGateCPDefault branch from 0a8974f to b344000 Compare March 13, 2025 18:35
@afarbos
Copy link
Contributor Author

afarbos commented Mar 13, 2025

🎉 all green!

Copy link
Contributor

@alexander-demicev alexander-demicev 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: alexander-demicev

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 Mar 14, 2025
@Danil-Grigorev
Copy link
Member

/lgtm

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

LGTM label has been added.

Git tree hash: b7fe03211d6d32005142eeb0c77ec5ea76bcc59c

@k8s-ci-robot k8s-ci-robot merged commit 07d1080 into kubernetes-sigs:main Mar 17, 2025
14 checks passed
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants