-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Issue #696 - Support apps with static namespaces in resources #842
Conversation
45c05a8
to
8d204d6
Compare
I haven't yet looked at the code, but before I forget, do we prevent the following attack: In git, I have a ClusterRole with a The expected behavior is that the create ClusterRole should be rejected. |
8d204d6
to
fb9602f
Compare
@jessesuen thanks for reminding about project permissions check. The attack which you described is prevented ( we are explicetly if resource is namespaced or not using discovery api ). I forgot to add destination namespace check. This is fixed now. Please review PR |
Codecov Report
@@ Coverage Diff @@
## master #842 +/- ##
=========================================
Coverage ? 30.75%
=========================================
Files ? 47
Lines ? 6893
Branches ? 0
=========================================
Hits ? 2120
Misses ? 4451
Partials ? 322
Continue to review full report at Codecov.
|
if api, ok := c.apis[gvk]; ok && !api.Namespaced { | ||
return false | ||
} | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any problem here that if we don't see the GVK in the cluster, that we unconditionally consider it as a namespaced? e.g. will deploying an app for the first time that contains a cluster-scoped CRD + cluster-scoped CRD object work okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. working improving it in next PR
Should this be working on role and rolebindings? I have set a namespace hardcoded into the resource and still it pickes up the application namespace... |
I have added the following pod, it should be running in namespace demo1 but it runs in demo (the application destination namespace).
|
My source pod.yaml was:
|
Is this the same issue as described in my previous posts? 483872a |
Yes possibly. Are you using kustomize? |
After PR is merged application might have resources with 'hardcoded' namespaces. This partially solved issue #696