Fix: require cluster name can not be repeated (#5795)

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>
Co-authored-by: Wenhao Zhou <34303854+zhou1203@users.noreply.github.com>
This commit is contained in:
hongming
2023-06-28 18:03:28 +08:00
committed by GitHub
parent d85ebcef1f
commit d976069c5b
2 changed files with 5 additions and 0 deletions

View File

@@ -118,6 +118,9 @@ spec:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
type: object
template:
properties:

View File

@@ -29,6 +29,8 @@ type GenericClusterReference struct {
}
type GenericPlacementFields struct {
// +listType=map
// +listMapKey=name
Clusters []GenericClusterReference `json:"clusters,omitempty"`
ClusterSelector *metav1.LabelSelector `json:"clusterSelector,omitempty"`
}