diff --git a/Makefile b/Makefile index 23fde79a..79e5cb46 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ $(GENERATED): go.mod $(CRD_TYPE_SOURCE) ./hack/update-codegen.sh $(GENERATED_CRDS): $(GENERATED) $(CRD_SOURCES) - go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:crdVersions=v1,allowDangerousTypes=true paths=./pkg/apis/... output:crd:dir=docs + go tool controller-gen crd:crdVersions=v1,allowDangerousTypes=true paths=./pkg/apis/... output:crd:dir=docs go run hack/crd/trim.go < docs/zalando.org_stacksets.yaml > docs/stackset_crd.yaml go run hack/crd/trim.go < docs/zalando.org_stacks.yaml > docs/stack_crd.yaml rm docs/zalando.org_stacksets.yaml docs/zalando.org_stacks.yaml diff --git a/docs/stack_crd.yaml b/docs/stack_crd.yaml index 04beeb34..deece1e6 100644 --- a/docs/stack_crd.yaml +++ b/docs/stack_crd.yaml @@ -1096,11 +1096,6 @@ spec: type: object x-kubernetes-map-type: atomic namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". items: type: string type: array @@ -6156,12 +6151,6 @@ spec: properties: name: default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object x-kubernetes-map-type: atomic @@ -6293,6 +6282,12 @@ spec: properties: name: default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object x-kubernetes-map-type: atomic @@ -6625,12 +6620,6 @@ spec: properties: name: default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object x-kubernetes-map-type: atomic @@ -7243,6 +7232,12 @@ spec: properties: name: default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object x-kubernetes-map-type: atomic @@ -7290,6 +7285,12 @@ spec: properties: name: default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object x-kubernetes-map-type: atomic diff --git a/docs/stackset_crd.yaml b/docs/stackset_crd.yaml index 864814b9..3213f79d 100644 --- a/docs/stackset_crd.yaml +++ b/docs/stackset_crd.yaml @@ -2331,6 +2331,13 @@ spec: localhostProfile: type: string type: + description: |- + type indicates which kind of seccomp profile will be applied. + Valid options are: + + Localhost - a profile defined in a file on the node should be used. + RuntimeDefault - the container runtime default profile should be used. + Unconfined - no profile should be applied. type: string required: - type @@ -3694,13 +3701,6 @@ spec: localhostProfile: type: string type: - description: |- - type indicates which kind of seccomp profile will be applied. - Valid options are: - - Localhost - a profile defined in a file on the node should be used. - RuntimeDefault - the container runtime default profile should be used. - Unconfined - no profile should be applied. type: string required: - type diff --git a/go.mod b/go.mod index fea5d229..a2f1b48e 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,6 @@ require ( k8s.io/api v0.34.1 k8s.io/apimachinery v0.34.1 k8s.io/client-go v0.34.1 - k8s.io/code-generator v0.34.1 - sigs.k8s.io/controller-tools v0.19.0 sigs.k8s.io/yaml v1.6.0 ) @@ -74,11 +72,22 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.34.0 // indirect + k8s.io/code-generator v0.34.1 // indirect k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect + sigs.k8s.io/controller-tools v0.19.0 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect ) + +tool ( + k8s.io/code-generator + k8s.io/code-generator/cmd/client-gen + k8s.io/code-generator/cmd/deepcopy-gen + k8s.io/code-generator/cmd/informer-gen + k8s.io/code-generator/cmd/lister-gen + sigs.k8s.io/controller-tools/cmd/controller-gen +) diff --git a/hack/tools.go b/hack/tools.go deleted file mode 100644 index bc1da38d..00000000 --- a/hack/tools.go +++ /dev/null @@ -1,23 +0,0 @@ -//go:build tools -// +build tools - -/* -Copyright 2019 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package imports things required by build scripts, to force `go mod` to see them as dependencies -package tools - -import ( - _ "k8s.io/code-generator" - _ "sigs.k8s.io/controller-tools/cmd/controller-gen" -) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 3e64cf76..f534c28e 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -31,14 +31,14 @@ APIS_PKG="${GOPKG}/pkg/apis" GROUPS_WITH_VERSIONS="${CUSTOM_RESOURCE_NAME}:${CUSTOM_RESOURCE_VERSION}" echo "Generating deepcopy funcs" -go run k8s.io/code-generator/cmd/deepcopy-gen \ +go tool deepcopy-gen \ --output-file zz_generated.deepcopy.go \ --bounding-dirs "${APIS_PKG}" \ --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \ "${APIS_PKG}/${CUSTOM_RESOURCE_NAME}/${CUSTOM_RESOURCE_VERSION}" echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" -go run k8s.io/code-generator/cmd/client-gen \ +go tool client-gen \ --clientset-name versioned \ --input-base "" \ --input "${APIS_PKG}/${CUSTOM_RESOURCE_NAME}/${CUSTOM_RESOURCE_VERSION}" \ @@ -47,14 +47,14 @@ go run k8s.io/code-generator/cmd/client-gen \ --output-dir "${OUTPUT_DIR}/clientset" echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" -go run k8s.io/code-generator/cmd/lister-gen \ +go tool lister-gen \ --output-pkg "${OUTPUT_PKG}/listers" \ --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \ --output-dir "${OUTPUT_DIR}/listers" \ "${APIS_PKG}/${CUSTOM_RESOURCE_NAME}/${CUSTOM_RESOURCE_VERSION}" echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" -go run k8s.io/code-generator/cmd/informer-gen \ +go tool informer-gen \ --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ --listers-package "${OUTPUT_PKG}/listers" \ --output-pkg "${OUTPUT_PKG}/informers" \