Commit eaf2129
committed
feat(go/v4): add namespace-scoped manager support
Add --namespaced flag to scaffold managers that watch only specific namespace(s),
enabling least-privilege deployments and multi-tenant architectures.
Changes:
- Add --namespaced flag to init and edit commands
- Scaffold Role/RoleBinding instead of ClusterRole/ClusterRoleBinding
- Add WATCH_NAMESPACE environment variable to manager deployment
- Add helper functions in cmd/main.go (getWatchNamespace, setupCacheNamespaces)
- Controllers automatically get namespace parameter in RBAC markers
- Support converting existing projects with 'kubebuilder edit --namespaced=true'
- Add comprehensive migration guide and reference documentation
- Add e2e test validating namespace isolation behavior
- Add integration test validating scaffolding correctness
- Update testdata project to demonstrate namespace-scoped configuration
Assisted-by: Cursor/Claude1 parent 899cfec commit eaf2129
File tree
66 files changed
+1970
-265
lines changed- docs/book/src
- migration
- reference
- pkg
- cli/alpha/internal
- config
- v3
- machinery
- plugins
- common/kustomize/v2/scaffolds
- internal/templates/config
- kdefault
- manager
- rbac
- golang
- deploy-image/v1alpha1/scaffolds/internal/templates/controllers
- v4
- scaffolds
- internal/templates
- cmd
- controllers
- optional/helm/v2alpha/scaffolds/internal/kustomize
- testdata/project-v4-with-plugins
- cmd
- config
- manager
- rbac
- dist
- chart
- templates/rbac
- internal/controller
- test
- e2e
- helm
- v4
- testdata
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
66 files changed
+1970
-265
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
0 commit comments