-
Notifications
You must be signed in to change notification settings - Fork 86
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
Support recovering from repository in different namespace #474
Conversation
Codecov Report
@@ Coverage Diff @@
## master #474 +/- ##
=====================================
Coverage 84% 84%
=====================================
Files 2 2
Lines 25 25
=====================================
Hits 21 21
Misses 2 2
Partials 2 2 Continue to review full report at Codecov.
|
cred = f.SecretForLocalBackend() | ||
restic = f.ResticForHostPathLocalBackend() | ||
recovery = f.RecoveryForRestic(restic) | ||
recoveryNamespace = f.NewNamespace(rand.WithUniqSuffix("recovery")) |
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.
Where is this namespace created?
pkg/controller/rbac.go
Outdated
@@ -231,7 +231,7 @@ func (c *StashController) ensureRecoveryRBAC(resource *core.ObjectReference) err | |||
} | |||
|
|||
// ensure role binding | |||
_, _, err = rbac_util.CreateOrPatchRoleBinding(c.kubeClient, meta, func(in *rbac.RoleBinding) *rbac.RoleBinding { | |||
_, _, err = rbac_util.CreateOrPatchClusterRoleBinding(c.kubeClient, meta, func(in *rbac.ClusterRoleBinding) *rbac.ClusterRoleBinding { |
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.
We don't need to use ClusterRoleBinding. This is what we should do, create a ClusterRole that gives read
permission on any Repository
object. Then create a RoleBinding
in the namespace of the Repository
object so that the recovery s/a can read it. This is how the EAS auth configmap is read.
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.
I added appscode:stash:repository-reader 085bd16
…operator mode for test
/lgtm |
cc: @farcaller