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

✨ Add annotations to ClusterClass variables #10074

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/v1beta1/clusterclass_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ type ClusterClassVariable struct {
// Name of the variable.
Name string `json:"name"`

// Arbitrary annotations related to the variable. May be used
// to store and retrieve arbitrary metadata related to variable.
Annotations map[string]string `json:"annotations,omitempty"`

// Required specifies if the variable is required.
// Note: this applies to the variable as a whole and thus the
// top-level object defined in the schema. If nested fields are
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions api/v1beta1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ func TestClusterClassReconciler_reconcile(t *testing.T) {
WithWorkerMachineDeploymentClasses(*machineDeploymentClass1, *machineDeploymentClass2).
WithVariables(
clusterv1.ClusterClassVariable{
Name: "hdd",
Name: "hdd",
Annotations: map[string]string{
"type": "disk-size",
},
Required: true,
Schema: clusterv1.VariableSchema{
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
Expand All @@ -100,6 +103,9 @@ func TestClusterClassReconciler_reconcile(t *testing.T) {
},
clusterv1.ClusterClassVariable{
Name: "cpu",
Annotations: map[string]string{
"type": "cpu-size",
},
Schema: clusterv1.VariableSchema{
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
Type: "integer",
Expand Down
Loading