Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to patch the namespace not managed by Capsule #733

Closed
sagar-jadhav opened this issue Mar 22, 2023 · 2 comments · Fixed by #734
Closed

Unable to patch the namespace not managed by Capsule #733

sagar-jadhav opened this issue Mar 22, 2023 · 2 comments · Fixed by #734
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sagar-jadhav
Copy link
Contributor

sagar-jadhav commented Mar 22, 2023

Bug description

As a capsule user, I am unable to patch the namespace not managed by capsule, even though I have explicit access to patch that namespace.

How to reproduce

Steps to reproduce the behavior:

  1. Create a namespace called oil-sj as a cluster admin
  2. Follow the https://capsule.clastix.io/docs/general/getting-started/ tutorial
  3. As an cluster admin create the following ClusterRole and ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: alice-ns-provisioner
rules:
- apiGroups:
  - ""
  resources:
  - namespaces
  resourceNames:
  - oil-sj
  verbs:
  - create
  - patch
  - get
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: alice-ns-provisioner
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: alice-ns-provisioner
subjects:
- apiGroup: rbac.authorization.k8s.io
  kind: User
  name: alice
  1. Login to cluster using alice kubeconfig and run the kubectl annotate ns oil-sj env=stg command. Command fails with below error
Error from server: admission webhook "owner.namespace.capsule.clastix.io" denied the request: the OwnerReference cannot be removed

Expected behavior

As a capsule user I should be able to patch the namespace not managed by capsule, If I have explicit access to patch that namespace.

Logs

N/A

Additional context

  • Helm Chart version: capsule-0.3.1
@sagar-jadhav sagar-jadhav added blocked-needs-validation Issue need triage and validation bug Something isn't working labels Mar 22, 2023
@prometherion prometherion added this to the v0.3.1 milestone Mar 23, 2023
@prometherion prometherion removed the blocked-needs-validation Issue need triage and validation label Mar 23, 2023
@prometherion
Copy link
Member

Planning to release this for v0.3.1, let's wait some days so I can work also on #732.

@sagar-jadhav
Copy link
Contributor Author

Planning to release this for v0.3.1, let's wait some days so I can work also on #732.

Sure. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants