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 subnet options to SubnetSpec #1856

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

dulek
Copy link
Contributor

@dulek dulek commented Feb 2, 2024

What this PR does / why we need it:
This commit introduces SubnetSpec field onto the OpenStackClusterSpec that is supposed to hold all options related to subnets created by CAPO. This means nodeCidr and DNSNameservers are moved into that struct.

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 #

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

/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. labels Feb 2, 2024
Copy link

netlify bot commented Feb 2, 2024

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

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

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 2, 2024
@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 2, 2024
@dulek
Copy link
Contributor Author

dulek commented Feb 5, 2024

I made a small update of unnecessary restore and added CRD changes docs.

@EmilienM
Copy link
Contributor

EmilienM commented Feb 5, 2024

/test pull-cluster-api-provider-openstack-e2e-full-test

@EmilienM
Copy link
Contributor

EmilienM commented Feb 5, 2024

/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 5, 2024
// If you leave this empty, no network will be created.
NodeCIDR string `json:"nodeCidr,omitempty"`
// +kubebuilder:validation:MaxItems=1
NodeSubnets []SubnetSpec `json:"nodeSubnets,omitempty"`

// If NodeCIDR is set this option can be used to detect an existing router.
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to update these comments where NodeCIDR is mentioned.

Also re-reviewing this, I realized that we also have Network, Subnets, Router.
Maybe to avoid confusion we could rename NodeSubnets to ManagedSubnets in the same vain as ManagedSecurityGroups (see PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's not a bad idea. I've applied it, let's see if correctly.

@EmilienM
Copy link
Contributor

EmilienM commented Feb 7, 2024

/retitle ✨ Move subnet options to SubnetSpec

@k8s-ci-robot k8s-ci-robot changed the title Move subnet options to SubnetSpec ✨ Move subnet options to SubnetSpec Feb 7, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 7, 2024
@dulek
Copy link
Contributor Author

dulek commented Feb 8, 2024

Looks like it works!

@EmilienM
Copy link
Contributor

EmilienM commented Feb 8, 2024

/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 8, 2024
@huxcrux
Copy link
Contributor

huxcrux commented Feb 13, 2024

/lgtm

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

@mdbooth mdbooth left a comment

Choose a reason for hiding this comment

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

Doc nit if you care to update.

// network, a subnet with NodeCIDR, and a router connected to this subnet.
// If you leave this empty, no network will be created.
NodeCIDR string `json:"nodeCidr,omitempty"`
// ManagedSubnets are describing OpenStack Subnets to be created. Cluster actuator
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
// ManagedSubnets are describing OpenStack Subnets to be created. Cluster actuator
// ManagedSubnets describe OpenStack Subnets to be created. The cluster controller

@@ -539,6 +539,8 @@ func reconcileNetworkComponents(scope scope.Scope, cluster *clusterv1.Cluster, o
handleUpdateOSCError(openStackCluster, fmt.Errorf("failed to reconcile router: %w", err))
return fmt.Errorf("failed to reconcile router: %w", err)
}
} else {
return fmt.Errorf("failed to reconcile network: ManagedSubnets only supports one element, %d provided", len(openStackCluster.Spec.ManagedSubnets))
Copy link
Contributor

Choose a reason for hiding this comment

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

Reviewer note: confirmed this is also checked at admission as maxitems is specified in the CRD.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dulek, 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 14, 2024
@dulek
Copy link
Contributor Author

dulek commented Feb 14, 2024

/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 14, 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 14, 2024
This commit introduces SubnetSpec field onto the OpenStackClusterSpec
that is supposed to hold all options related to subnets created by CAPO.
This means nodeCidr and DNSNameservers are moved into that struct.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 14, 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 14, 2024
@k8s-ci-robot k8s-ci-robot merged commit 3c07a7b into kubernetes-sigs:main Feb 14, 2024
9 checks passed
@stephenfin stephenfin deleted the subnet-spec branch February 14, 2024 16:06
@dulek dulek mentioned this pull request Feb 15, 2024
3 tasks
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants