-
Notifications
You must be signed in to change notification settings - Fork 5
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
Validate namespaces, so non admin can not create backups outside of ns #56
Conversation
@mateusoliveira43 @shubham-pampattiwar @weshayutin This PR is really all about that commit only, because other commits are covered in #54: |
Fixes #49 |
Validation ensures the namespace in the VeleroBackup object are the same as the namespace for which NAB resides. Signed-off-by: Michal Pryc <[email protected]>
Rebased validation of namespaces. @mateusoliveira43 @shubham-pampattiwar please review as it's on top of previous work with merged reconcile functions. |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mpryc, shubham-pampattiwar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Validate namespaces, so non admin can not create backups outside of ns
Validation ensures the namespace in the VeleroBackup object are the same as the namespace for which NAB resides.
Note this PR is on top of #54 which should be merged first.
How to test
All of the below are in the non-admin namespace
nacproject
:a) Case where there is backupSpec, but empty, should create Velero Backup with nacproject namespace in the includedNamespaces (below is not full spec, removed
managedFields
from it):Result should be created Velero Backup with
includedNamespaces
same as the origin NAB namespace and updated NonAdminBackup (below is not full spec, removedmanagedFields
from it):b) Create NonAdminBackup with
includedNamespaces
that does not match the namespace from the NonAdminBackup. It may include namespace of the NAB object, but on top of that it should have also other namespaces.Result should be NAB in backingOff phase with
spec.backupSpec.IncludedNamespaces can not contain namespaces other then: nacproject
condition message: