diff --git a/Makefile b/Makefile index 186a3bd..c5e0d68 100644 --- a/Makefile +++ b/Makefile @@ -40,34 +40,31 @@ install-tools: ## Install lint/test tools install-code-generators: ## Install latest code-generator tools go install k8s.io/code-generator/cmd/deepcopy-gen@latest - go install k8s.io/code-generator/cmd/openapi-gen@latest + go install k8s.io/kube-openapi/cmd/openapi-gen@latest go install k8s.io/code-generator/cmd/client-gen@latest go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest run-deepcopy-gen: ## Run deepcopy-gen - GOMOD111=on \ deepcopy-gen \ --go-header-file hack/boilerplate.go.txt \ - --input-dirs github.com/srl-labs/clabernetes/apis/... \ - --output-file-base zz_generated.deepcopy \ - --trim-path-prefix ${GOPATH}/src/github.com/srl-labs/clabernetes + --output-file zz_generated.deepcopy.go \ + github.com/srl-labs/clabernetes/apis/... run-openapi-gen: ## Run openapi-gen - GOMOD111=on \ openapi-gen \ --go-header-file hack/boilerplate.go.txt \ - --input-dirs github.com/srl-labs/clabernetes/apis/... \ - --trim-path-prefix ${GOPATH}/src/github.com/srl-labs/clabernetes \ - --output-package github.com/srl-labs/clabernetes/generated/openapi + --output-dir generated/openapi \ + --output-file openapi_generated.go \ + --output-pkg github.com/srl-labs/clabernetes/generated/openapi \ + github.com/srl-labs/clabernetes/apis/... run-client-gen: ## Run client-gen - GOMOD111=on \ client-gen \ --go-header-file hack/boilerplate.go.txt \ --input-base github.com/srl-labs/clabernetes \ --input apis/v1alpha1 \ - --trim-path-prefix ${GOPATH}/src/github.com/srl-labs/clabernetes \ - --output-package github.com/srl-labs/clabernetes/generated \ + --output-dir generated \ + --output-pkg github.com/srl-labs/clabernetes/generated \ --clientset-name clientset run-generate-crds: ## Run controller-gen for crds diff --git a/apis/v1alpha1/topologyspec.go b/apis/v1alpha1/topologyspec.go index 332b008..77bd072 100644 --- a/apis/v1alpha1/topologyspec.go +++ b/apis/v1alpha1/topologyspec.go @@ -189,6 +189,7 @@ type Scheduling struct { // +optional NodeSelector map[string]string `json:"nodeSelector,omitempty"` // Tolerations is a list of Tolerations that will be set on the launcher pod spec. + // +listType=atomic // +optional Tolerations []k8scorev1.Toleration `json:"tolerations"` } diff --git a/assets/crd/clabernetes.containerlab.dev_configs.yaml b/assets/crd/clabernetes.containerlab.dev_configs.yaml index d36fbf5..46a7470 100644 --- a/assets/crd/clabernetes.containerlab.dev_configs.yaml +++ b/assets/crd/clabernetes.containerlab.dev_configs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: configs.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev @@ -53,8 +53,9 @@ spec: This is disabled by default. type: boolean containerlabTimeout: - description: ContainerlabTimeout sets the `--timeout` flag when - invoking containerlab in the launcher pods. + description: |- + ContainerlabTimeout sets the `--timeout` flag when invoking containerlab in the launcher + pods. type: string containerlabVersion: description: |- diff --git a/assets/crd/clabernetes.containerlab.dev_connectivities.yaml b/assets/crd/clabernetes.containerlab.dev_connectivities.yaml index 0975422..752984f 100644 --- a/assets/crd/clabernetes.containerlab.dev_connectivities.yaml +++ b/assets/crd/clabernetes.containerlab.dev_connectivities.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: connectivities.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev diff --git a/assets/crd/clabernetes.containerlab.dev_imagerequests.yaml b/assets/crd/clabernetes.containerlab.dev_imagerequests.yaml index 1d39930..ea3602f 100644 --- a/assets/crd/clabernetes.containerlab.dev_imagerequests.yaml +++ b/assets/crd/clabernetes.containerlab.dev_imagerequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: imagerequests.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev diff --git a/assets/crd/clabernetes.containerlab.dev_topologies.yaml b/assets/crd/clabernetes.containerlab.dev_topologies.yaml index 0b55208..37f191e 100644 --- a/assets/crd/clabernetes.containerlab.dev_topologies.yaml +++ b/assets/crd/clabernetes.containerlab.dev_topologies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: topologies.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev @@ -353,6 +353,7 @@ spec: type: string type: object type: array + x-kubernetes-list-type: atomic type: object type: object expose: diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_configs.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_configs.yaml index d36fbf5..46a7470 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_configs.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_configs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: configs.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev @@ -53,8 +53,9 @@ spec: This is disabled by default. type: boolean containerlabTimeout: - description: ContainerlabTimeout sets the `--timeout` flag when - invoking containerlab in the launcher pods. + description: |- + ContainerlabTimeout sets the `--timeout` flag when invoking containerlab in the launcher + pods. type: string containerlabVersion: description: |- diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_connectivities.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_connectivities.yaml index 0975422..752984f 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_connectivities.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_connectivities.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: connectivities.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_imagerequests.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_imagerequests.yaml index 1d39930..ea3602f 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_imagerequests.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_imagerequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: imagerequests.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml index 0b55208..37f191e 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.14.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: topologies.clabernetes.containerlab.dev spec: group: clabernetes.containerlab.dev @@ -353,6 +353,7 @@ spec: type: string type: object type: array + x-kubernetes-list-type: atomic type: object type: object expose: diff --git a/generated/openapi/openapi_generated.go b/generated/openapi/openapi_generated.go index 1347276..b8a0dff 100644 --- a/generated/openapi/openapi_generated.go +++ b/generated/openapi/openapi_generated.go @@ -19,8 +19,6 @@ // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package openapi import ( @@ -1506,6 +1504,11 @@ func schema_srl_labs_clabernetes_apis_v1alpha1_Scheduling( }, }, "tolerations": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Tolerations is a list of Tolerations that will be set on the launcher pod spec.", Type: []string{"array"},