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

⚠️Move CloudName into IdentityRef and make cluster IdentityRef required #1915

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

mdbooth
Copy link
Contributor

@mdbooth mdbooth commented Feb 29, 2024

This change came from attempting to write validation markers for CloudName and IdentityRef in both the machine and cluster specs.

Firstly I noticed that IdentityRef was marked optional in the cluster spec, but it is certainly required: the cluster cannot be provisioned without cloud credentials. I made IdentityRef required in the cluster spec.

In contrast, IdentityRef is genuinely optional in the machine spec because, if not specified, we will use the credentials defined in the cluster spec.

CloudName on the machine spec is also marked optional. However, it is required if IdentityRef was specified. This is because it refers to the same object as IdentityRef. The most sensible way to to represent this in the API is to put it in the IdentityRef. This means that if IdentityRef is provided, it must be provided completely, including CloudName.

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 29, 2024
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 29, 2024
Copy link

netlify bot commented Feb 29, 2024

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

Name Link
🔨 Latest commit 564b6bd
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/65e0965590da6b0008487f05
😎 Deploy Preview https://deploy-preview-1915--kubernetes-sigs-cluster-api-openstack.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.

@mdbooth mdbooth added this to the v1beta1 milestone Feb 29, 2024
@dulek
Copy link
Contributor

dulek commented Feb 29, 2024

This is so much better design! It looks good to me, but since it already has approved label, I'll leave setting lgtm to the next reviewer.

@EmilienM
Copy link
Contributor

Nicely done, I suspect the API doc wasn't generated for some reason?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 29, 2024
This change came from attempting to write validation markers for
CloudName and IdentityRef in both the machine and cluster specs.

Firstly I noticed that IdentityRef was marked optional in the cluster
spec, but it is certainly required: the cluster cannot be provisioned
without cloud credentials. I made IdentityRef required in the cluster
spec.

In contrast, IdentityRef is genuinely optional in the machine spec
because, if not specified, we will use the credentials defined in the
cluster spec.

CloudName on the machine spec is also marked optional. However, it is
required if IdentityRef was specified. This is because it refers to the
same object as IdentityRef. The most sensible way to to represent this
in the API is to put it in the IdentityRef. This means that if
IdentityRef is provided, it must be provided completely, including
CloudName.
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 29, 2024
@EmilienM
Copy link
Contributor

/lgtm

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

mdbooth commented Feb 29, 2024

/cc @lentzi90 @mkjpryor @mnaser

@k8s-ci-robot
Copy link
Contributor

@mdbooth: GitHub didn't allow me to request PR reviews from the following users: mkjpryor.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @lentzi90 @mkjpryor @mnaser

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.

Copy link
Contributor

@lentzi90 lentzi90 left a comment

Choose a reason for hiding this comment

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

Nice!
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 29, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lentzi90, mdbooth

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 merged commit c4fe920 into kubernetes-sigs:main Feb 29, 2024
9 checks passed
@mdbooth mdbooth deleted the cloudName branch February 29, 2024 18:36
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants