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 DefinitionFrom field to ClusterVariable #8031

Merged
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
12 changes: 9 additions & 3 deletions api/v1beta1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,19 @@ type MachineHealthCheckTopology struct {
MachineHealthCheckClass `json:",inline"`
}

// ClusterVariable can be used to customize the Cluster through
// patches. It must comply to the corresponding
// ClusterClassVariable defined in the ClusterClass.
// ClusterVariable can be used to customize the Cluster through patches. Each ClusterVariable is associated with a
// Variable definition in the ClusterClass `status` variables.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how much documentation is useful here in terms of the usage of this field. I think it's complex enough that the godoc isn't the right place to describe e.g. that variables can't be used across patches.

type ClusterVariable struct {
// Name of the variable.
Name string `json:"name"`

// DefinitionFrom specifies where the definition of this Variable is from. DefinitionFrom is `inline` when the
// definition is from the ClusterClass `.spec.variables` or the name of a patch defined in the ClusterClass
// `.spec.patches` where the patch is external and provides external variables.
// This field is mandatory if the variable has `DefinitionsConflict: true` in ClusterClass `status.variables[]`
// +optional
DefinitionFrom string `json:"definitionFrom,omitempty"`

// Value of the variable.
// Note: the value will be validated against the schema of the corresponding ClusterClassVariable
// from the ClusterClass.
Expand Down
9 changes: 8 additions & 1 deletion api/v1beta1/zz_generated.openapi.go

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

30 changes: 25 additions & 5 deletions config/crd/bases/cluster.x-k8s.io_clusters.yaml

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