Skip to content

Commit

Permalink
tool: mark resourceID field as immutable in template
Browse files Browse the repository at this point in the history
  • Loading branch information
jingyih committed Aug 30, 2024
1 parent 870e1f2 commit 1586dcd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev/tools/controllerbuilder/template/apis/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ var {{ .Kind }}GVK = GroupVersion.WithKind("{{ .Kind }}")
// +kcc:proto={{ .KindProtoTag }}
{{- end }}
type {{ .Kind }}Spec struct {
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID is immutable"
// Immutable.
// The {{ .Kind }} name. If not given, the metadata.name will be used.
// + optional
ResourceID *string ` + "`" + `json:"resourceID,omitempty"` + "`" + `
Expand Down

0 comments on commit 1586dcd

Please sign in to comment.