Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 1a8a733

Browse files
committed
operator: generate deepcopy, rbac and crds
This commit adds the controller-gen tool as a Bazel dep and adds the equivalent of `make manifests` to //:generate. Rename CRDs in the operator Helm chart to match kubebuilder v4 generated names and add a generation directive to output CRD resources directly into the Helm chart. CRDs are not templated, so we don't need to helmify them. Split the manager-rbac.yaml into a role.yaml and a rolebinding.yaml, and add a directive to generate role.yaml from operator sources. We're losing the labels on the role, but that is only a cosmetic defect.
1 parent 0030a26 commit 1a8a733

17 files changed

Lines changed: 1015 additions & 108 deletions

File tree

bazel/ci/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,12 @@ sh_template(
337337
"//internal/attestation/measurements/measurement-generator",
338338
"//internal/versions/hash-generator",
339339
"@go_sdk//:bin/go",
340+
"@io_k8s_sigs_controller_tools//cmd/controller-gen",
340341
"@org_golang_x_tools//cmd/stringer",
341342
"@yq_toolchains//:resolved_toolchain",
342343
],
343344
substitutions = {
345+
"@@CONTROLLER_GEN@@": "$(rootpath @io_k8s_sigs_controller_tools//cmd/controller-gen)",
344346
"@@DOCGEN@@": "$(rootpath :com_github_siderolabs_talos_hack_docgen)",
345347
"@@GO@@": "$(rootpath @go_sdk//:bin/go)",
346348
"@@HASH_GENERATOR@@": "$(rootpath //internal/versions/hash-generator:hash-generator)",

bazel/ci/go_generate.sh.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ measurement_generator=$(realpath @@MEASUREMENT_GENERATOR@@)
2525
stat "${measurement_generator}" >> /dev/null
2626
yq=$(realpath @@YQ@@)
2727
stat "${yq}" >> /dev/null
28+
controller_gen=$(realpath @@CONTROLLER_GEN@@)
29+
stat "${controller_gen}" >> /dev/null
2830

2931
cd "${BUILD_WORKSPACE_DIRECTORY}"
3032

@@ -37,6 +39,7 @@ PATH=$(dirname "${helm}"):${PATH}
3739
PATH=$(dirname "${hash_generator}"):${PATH}
3840
PATH=$(dirname "${measurement_generator}"):${PATH}
3941
PATH=$(dirname "${yq}"):${PATH}
42+
PATH=$(dirname "${controller_gen}"):${PATH}
4043
export PATH
4144

4245
submodules=$(${go} list -f '{{.Dir}}' -m)

0 commit comments

Comments
 (0)