fix(rbac): Replace hardcoded namespace: default with namespace: system#2898
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Spark application RBAC manifest to follow kubebuilder/kustomize conventions by using namespace: system instead of hardcoding namespace: default.
Changes:
- Replace
namespace: defaultwithnamespace: systemin the ServiceAccount metadata. - Replace
namespace: defaultwithnamespace: systemin the Role metadata. - Replace
namespace: defaultwithnamespace: systemin the RoleBinding metadata and its ServiceAccount subject.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nabuskey
left a comment
There was a problem hiding this comment.
Actually we should just remove explicit namespace references. Namespaces are typically specified in kustomization files, correct?
237bb6a to
0fb30e1
Compare
Remove all hardcoded namespace fields from ServiceAccount, Role, RoleBinding metadata, and RoleBinding subjects. This lets deployers control the target namespace via Kustomize, Helm, or kubectl -n instead of being locked to a specific namespace. Signed-off-by: roburishabh <roburishabh@outlook.com>
0fb30e1 to
faefbe7
Compare
@nabuskey Thanks for the review, I've updated the PR to remove the explicit |
fd097dd to
faefbe7
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vara-bonthu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Purpose of this PR
The
config/rbac/spark-application-rbac.yamlfile hardcodesnamespace: defaultin its ServiceAccount, Role, RoleBinding, and RoleBinding subjects. This locks deployments to thedefaultnamespace and prevents deployers from controlling the target namespace via Kustomize, Helm, orkubectl apply -n.Proposed changes:
namespace: defaultfrom ServiceAccount metadatanamespace: defaultfrom Role metadatanamespace: defaultfrom RoleBinding metadatanamespace: defaultfrom RoleBinding subjectsChange Category
Rationale
Hardcoding
namespace: defaultbreaks multi-tenant and custom-namespace installations. Base manifests should omit explicit namespace fields and let the deployer decide, which is the standard Kubernetes/kubebuilder convention.Checklist