Skip to content

Commit

Permalink
removed kubebuilder validation
Browse files Browse the repository at this point in the history
Signed-off-by: Neeraj Nagure <nagureneeraj@gmail.com>
  • Loading branch information
NeerajNagure committed May 23, 2024
1 parent edb536d commit 3e97742
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 36 deletions.
4 changes: 0 additions & 4 deletions apis/apiextensions/v1/composition_revision_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ const (
type CompositionRevisionSpec struct {
// CompositeTypeRef specifies the type of composite resource that this
// composition is compatible with.
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
CompositeTypeRef TypeReference `json:"compositeTypeRef"`

Expand Down Expand Up @@ -120,8 +118,6 @@ type CompositionRevisionSpec struct {
PublishConnectionDetailsWithStoreConfigRef *StoreConfigReference `json:"publishConnectionDetailsWithStoreConfigRef,omitempty"`

// Revision number. Newer revisions have larger numbers.
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Revision int64 `json:"revision"`
}
Expand Down
2 changes: 0 additions & 2 deletions apis/apiextensions/v1/composition_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
type CompositionSpec struct {
// CompositeTypeRef specifies the type of composite resource that this
// composition is compatible with.
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
CompositeTypeRef TypeReference `json:"compositeTypeRef"`

Expand Down
8 changes: 0 additions & 8 deletions apis/apiextensions/v1/xrd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ type CompositeResourceDefinitionSpec struct {
// Group specifies the API group of the defined composite resource.
// Composite resources are served under `/apis/<group>/...`. Must match the
// name of the XRD (in the form `<names.plural>.<group>`).
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Group string `json:"group"`

// Names specifies the resource and kind names of the defined composite
// resource.
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Names extv1.CustomResourceDefinitionNames `json:"names"`

Expand All @@ -51,8 +47,6 @@ type CompositeResourceDefinitionSpec struct {
// claim names to an existing CompositeResourceDefinition, but they cannot
// be changed or removed once they have been set.
// +optional
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
ClaimNames *extv1.CustomResourceDefinitionNames `json:"claimNames,omitempty"`

Expand All @@ -76,8 +70,6 @@ type CompositeResourceDefinitionSpec struct {
// EnforcedCompositionRef refers to the Composition resource that will be used
// by all composite instances whose schema is defined by this definition.
// +optional
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
EnforcedCompositionRef *CompositionReference `json:"enforcedCompositionRef,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const (
type CompositionRevisionSpec struct {
// CompositeTypeRef specifies the type of composite resource that this
// composition is compatible with.
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
CompositeTypeRef TypeReference `json:"compositeTypeRef"`

Expand Down Expand Up @@ -122,8 +120,6 @@ type CompositionRevisionSpec struct {
PublishConnectionDetailsWithStoreConfigRef *StoreConfigReference `json:"publishConnectionDetailsWithStoreConfigRef,omitempty"`

// Revision number. Newer revisions have larger numbers.
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.value) || has(self.value)", message="Value is required once set"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Revision int64 `json:"revision"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ spec:
- plural
type: object
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
connectionSecretKeys:
Expand Down Expand Up @@ -277,8 +275,6 @@ spec:
- name
type: object
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
group:
Expand All @@ -288,8 +284,6 @@ spec:
name of the XRD (in the form `<names.plural>.<group>`).
type: string
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
metadata:
Expand Down Expand Up @@ -365,8 +359,6 @@ spec:
- plural
type: object
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
versions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ spec:
- kind
type: object
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
environment:
Expand Down Expand Up @@ -1584,8 +1582,6 @@ spec:
format: int64
type: integer
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
writeConnectionSecretsToNamespace:
Expand Down Expand Up @@ -1722,8 +1718,6 @@ spec:
- kind
type: object
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
environment:
Expand Down Expand Up @@ -3227,8 +3221,6 @@ spec:
format: int64
type: integer
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
writeConnectionSecretsToNamespace:
Expand Down
2 changes: 0 additions & 2 deletions cluster/crds/apiextensions.crossplane.io_compositions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ spec:
- kind
type: object
x-kubernetes-validations:
- message: Value is required once set
rule: '!has(oldSelf.value) || has(self.value)'
- message: Value is immutable
rule: self == oldSelf
environment:
Expand Down

0 comments on commit 3e97742

Please sign in to comment.