Restore action for cluster/namespace role bindings (#1974)

Signed-off-by: Alexander Demichev <ademicev@redhat.com>
This commit is contained in:
Alexander Demichev
2019-10-21 15:11:26 -06:00
committed by Steve Kriss
parent f2eb072694
commit 1564317cef
6 changed files with 381 additions and 0 deletions
+10
View File
@@ -55,6 +55,8 @@ func NewCommand(f client.Factory) *cobra.Command {
RegisterRestoreItemAction("velero.io/add-pvc-from-pod", newAddPVCFromPodRestoreItemAction).
RegisterRestoreItemAction("velero.io/add-pv-from-pvc", newAddPVFromPVCRestoreItemAction).
RegisterRestoreItemAction("velero.io/change-storage-class", newChangeStorageClassRestoreItemAction(f)).
RegisterRestoreItemAction("velero.io/role-bindings", newRoleBindingItemAction).
RegisterRestoreItemAction("velero.io/cluster-role-bindings", newClusterRoleBindingItemAction).
Serve()
},
}
@@ -175,3 +177,11 @@ func newChangeStorageClassRestoreItemAction(f client.Factory) veleroplugin.Handl
), nil
}
}
func newRoleBindingItemAction(logger logrus.FieldLogger) (interface{}, error) {
return restore.NewRoleBindingAction(logger), nil
}
func newClusterRoleBindingItemAction(logger logrus.FieldLogger) (interface{}, error) {
return restore.NewClusterRoleBindingAction(logger), nil
}