Skip to content

Commit

Permalink
Revert "fix(vi): update CEL (#549)"
Browse files Browse the repository at this point in the history
This reverts commit 98da864.
  • Loading branch information
universal-itengineer authored Dec 3, 2024
1 parent 98da864 commit 29dc4b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
5 changes: 1 addition & 4 deletions api/core/v1alpha2/virtual_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ type VirtualImageList struct {
Items []VirtualImage `json:"items"`
}

// +kubebuilder:validation:XValidation:rule="self.storage == 'ContainerRegistry' ? !has(self.persistentVolumeClaim) && has(self.dataSource): true",message="The storage type ContainerRegistry should contain only the dataSource."
// +kubebuilder:validation:XValidation:rule="self.storage == 'PersistentVolumeClaim' ? !has(self.dataSource) && has(self.persistentVolumeClaim): true",message="The storage type PersistentVolumeClaim should contain only the persistentVolumeClaim."
// +kubebuilder:validation:XValidation:rule="self.storage == 'Kubernetes' ? !has(self.dataSource) && has(self.persistentVolumeClaim): true",message="The storage type Kubernetes should contain only the persistentVolumeClaim."
type VirtualImageSpec struct {
// +kubebuilder:default:=ContainerRegistry
Storage StorageType `json:"storage"`
PersistentVolumeClaim VirtualImagePersistentVolumeClaim `json:"persistentVolumeClaim,omitempty"`
DataSource VirtualImageDataSource `json:"dataSource,omitempty"`
DataSource VirtualImageDataSource `json:"dataSource"`
}

type VirtualImageStatus struct {
Expand Down

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

18 changes: 1 addition & 17 deletions crds/virtualimages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,25 +240,9 @@ spec:
- PersistentVolumeClaim
type: string
required:
- dataSource
- storage
type: object
x-kubernetes-validations:
- message:
The storage type ContainerRegistry should contain only the
dataSource.
rule:
"self.storage == 'ContainerRegistry' ? !has(self.persistentVolumeClaim)
&& has(self.dataSource): true"
- message:
The storage type PersistentVolumeClaim should contain only
the persistentVolumeClaim.
rule:
"self.storage == 'PersistentVolumeClaim' ? !has(self.dataSource)
&& has(self.persistentVolumeClaim): true"
- message: The storage type Kubernetes should contain only the persistentVolumeClaim.
rule:
"self.storage == 'Kubernetes' ? !has(self.dataSource) && has(self.persistentVolumeClaim):
true"
status:
properties:
cdrom:
Expand Down

0 comments on commit 29dc4b6

Please sign in to comment.