Skip to content

🌱 Add multiple control plane class support to v1.11.0#2

Closed
Dhairya-Arora01 wants to merge 1 commit intosyself-1.11.0from
dhairya/1-11-cp-classes
Closed

🌱 Add multiple control plane class support to v1.11.0#2
Dhairya-Arora01 wants to merge 1 commit intosyself-1.11.0from
dhairya/1-11-cp-classes

Conversation

@Dhairya-Arora01
Copy link
Copy Markdown

What this PR does / why we need it:

This PR involves cherry-picking the merge commit de6901d from the PR #1 to enable multiple control plane classes.

The changes to the API are made to v1beta2 API type as well.

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 #

@Dhairya-Arora01 Dhairya-Arora01 changed the title Add multiple control plane class support to v1.11.0 🌱 Add multiple control plane class support to v1.11.0 Apr 18, 2026
// class denotes a type of control-plane node present in the cluster.
// When used in ControlPlaneTopologyClass.Classes, this name MUST be unique
// within the list and can be referenced from the Cluster topology.
// +optional
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"syself new field" is missing.

Copy link
Copy Markdown

@guettli guettli left a comment

Choose a reason for hiding this comment

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

comments are missing. I just had a first look. The PR is big....


// PatchSelectorMatchControlPlaneClass selects templates referenced
// in specific ControlPlaneClasses in .spec.controlPlane.classes.
type PatchSelectorMatchControlPlaneClass struct {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please add "syself new type"


// class denotes a type of control-plane node present in the cluster.
// When used in ControlPlaneTopologyClass.Classes, this name MUST be unique
// within the list and can be referenced from the Cluster topology.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Syself new field, is mising.

}

// PatchSelectorMatchControlPlaneClass selects templates referenced
// in specific ControlPlaneClasses in .spec.controlPlane.classes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

syself new type, is missing.


// class is the class name of the ControlPlane,
// to which the current template belongs to.
// +optional
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

syself new field, is missing.

_, err = o.fetchRef(ctx, discoveryBackoff, cc.Spec.Infrastructure.TemplateRef.ToObjectReference(cc.Namespace))
errs = append(errs, err)
_, err = o.fetchRef(ctx, discoveryBackoff, cc.Spec.ControlPlane.TemplateRef.ToObjectReference(cc.Namespace))
errs = append(errs, err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is it ok to delete these two lines?

maybe leave the, but as commented-out with a leading syself comment, explaining why this was removed.

}
}

func TestControlPlaneClassesAreUnique(t *testing.T) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

here, too


fldPath := field.NewPath("spec", "topology", "controlPlane", "healthCheck")

// Resolve the control plane class to use for validation.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

syself comment

return nil
}

func controlPlaneClassOfName(clusterClass *clusterv1.ClusterClass, name string) *clusterv1.ControlPlaneClass {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

syself comment

// resolveControlPlaneClassForValidation returns the ControlPlaneClass to use for validation.
// If the Cluster topology specifies a control plane class, it is looked up from ClusterClass.spec.controlPlane.classes.
// Otherwise, the inline ClusterClass.spec.controlPlane definition is used.
func resolveControlPlaneClassForValidation(cluster *clusterv1.Cluster, clusterClass *clusterv1.ClusterClass) (*clusterv1.ControlPlaneClass, error) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

syself comment.

}
}

// Validate selectors for control plane classes
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

syself comment.

* enable multiple control plane classes

- ClusterClass now supports multiple classes for control-plane - similar
to workers.
- Cluster topology now includes a field "class" for control-plane which
references to the control.

Signed-off-by: Dhairya Arora <dhairya.arora@syself.com>
@Dhairya-Arora01 Dhairya-Arora01 force-pushed the dhairya/1-11-cp-classes branch from e2d5f0d to 5811822 Compare April 20, 2026 06:21
@Dhairya-Arora01
Copy link
Copy Markdown
Author

Superseded by #3 - which enables the feature for v1.11.6 i.e. the latest v1.11.x version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants