Skip to content

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Aug 4, 2023

When you try to install a Core Provider with a name different from "cluster-api", clusterctl validation fails.
After that CAPI operator puts a vague error description in the logs and doesn't add anything meaningful to the provider status.

This PR adds a pre-flight check to compare the Core Provider name with the expected name, allowing for earlier failure and an informative update to the provider status.

What this PR does / why we need it:

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 #

When you try to install a Core Provider with name different from
"cluster-api", clusterctl validation fails:
https://github.com/kubernetes-sigs/cluster-api/blob/main/cmd/clusterctl/client/config/providers_client.go#L414-L416
After that CAPI operator puts a vague error description in the logs
and doesn't add anything meaningful to the provider status.

To improve it, we add a new pre-flight check to compare Core Provider
name with the desired one, and fail earlier, updating the status with
correct information.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 4, 2023
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 Aug 4, 2023
Copy link
Member

@damdo damdo 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 Aug 4, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 69d9085a9d6e819654bc5f7693f523e1e9a4ca33

@k8s-ci-robot k8s-ci-robot merged commit 46be1c4 into kubernetes-sigs:main Aug 4, 2023
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.

4 participants