Skip to content

Commit 8cf2420

Browse files
committed
Mark API's 'sans' field as list-type=set
Adds the +listType=set annotation to the SANs field in the API spec, which ensures the field is treated as a set in the generated CRD and prevents duplicate entries in the array. Signed-off-by: kahirokunn <[email protected]>
1 parent 6e7f137 commit 8cf2420

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pkg/apis/k0s/v1beta1/api.go

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ type APISpec struct {
6262
Port int `json:"port,omitempty"`
6363

6464
// List of additional addresses to push to API servers serving the certificate
65+
// +listType=set
6566
SANs []string `json:"sans,omitempty"`
6667
}
6768

static/_crds/k0s/k0s.k0sproject.io_clusterconfigs.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ spec:
7979
items:
8080
type: string
8181
type: array
82+
x-kubernetes-list-type: set
8283
type: object
8384
controllerManager:
8485
description: ControllerManagerSpec defines the fields for the ControllerManager

0 commit comments

Comments
 (0)