migrate CRD generation to controller-gen and automate Helm RBAC sync#2269
migrate CRD generation to controller-gen and automate Helm RBAC sync#2269kahirokunn wants to merge 4 commits intoknative:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kahirokunn The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
@kahirokunn: 0 warnings.
Details
In response to this:
Fixes #
Proposed Changes
Release Note
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2269 +/- ##
=======================================
Coverage 63.97% 63.97%
=======================================
Files 51 51
Lines 1960 1960
=======================================
Hits 1254 1254
Misses 605 605
Partials 101 101 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
64fda73 to
51abee7
Compare
51abee7 to
552a8a9
Compare
552a8a9 to
cf94405
Compare
3b7b007 to
baf6c99
Compare
baf6c99 to
4ad2f43
Compare
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
4ad2f43 to
786194b
Compare
Changes
controller-genauto-generation from Go typesconfig/crd/bases/hack/sync-helm-crds.shto auto-sync Helm chart CRDs from controller-gen output(split out from
operator.yaml)hack/sync-helm-rbac.shto auto-sync Helm chart RBAC ClusterRoles fromconfig/rbac/role.yamlinto separate per-operator files(
rbac/serving-operator-role.yaml,rbac/eventing-operator-role.yaml)hack/update-codegen.shandhack/verify-codegen.shWhy
The old hand-maintained CRDs had diverged from Go type definitions:
credentialName) but Go struct JSON tags usesnake_case (
credential_name); values were silently ignored on deserializationworkloads[].version,workloads[].volumeMountsexisted in CRD but had no backing Gostruct fields. Setting them had no effect.
tls.modewasstringin CRD butint32in GoSimilarly, the Helm chart's
operator.yamlcontained hand-maintained ClusterRole definitionsthat could diverge from
config/rbac/role.yaml.Generating from Go types with controller-gen and syncing from a single source of truth
eliminates these inconsistencies and prevents future drift.
Release Note