Skip to content

Commit

Permalink
configuration must be unique
Browse files Browse the repository at this point in the history
  • Loading branch information
aojea committed Jun 9, 2024
1 parent dafb2b9 commit dd29686
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion apis/kindnet.io_configurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Configuration describes an Dapr configuration setting.
description: Configuration describes Kindnet Configuration, must be unique
across the cluster.
properties:
apiVersion:
description: |-
Expand Down Expand Up @@ -612,6 +613,10 @@ spec:
type: array
type: object
type: object
x-kubernetes-validations:
- message: Configuration must be unique
rule: self.metadata.namespace == 'kube-system' && self.metadata.name ==
'kindnet'
served: true
storage: true
subresources:
Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/config/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:subresource:status
// +kubebuilder:validation:XValidation:message="Configuration must be unique",rule="self.metadata.namespace == 'kube-system' && self.metadata.name == 'kindnet'"

// Configuration describes an Dapr configuration setting.
// Configuration describes Kindnet Configuration, must be unique across the cluster.
type Configuration struct {
metav1.TypeMeta `json:",inline"`
// +optional
Expand Down

0 comments on commit dd29686

Please sign in to comment.