mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 13:55:20 +00:00
Add RBAC support for 1.7 clusters
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
This commit is contained in:
@@ -45,6 +45,10 @@ type Helper interface {
|
||||
// Refresh pulls an updated set of Ark-backuppable resources from the
|
||||
// discovery API.
|
||||
Refresh() error
|
||||
|
||||
// APIGroups gets the current set of supported APIGroups
|
||||
// in the cluster.
|
||||
APIGroups() []metav1.APIGroup
|
||||
}
|
||||
|
||||
type helper struct {
|
||||
@@ -56,6 +60,7 @@ type helper struct {
|
||||
mapper meta.RESTMapper
|
||||
resources []*metav1.APIResourceList
|
||||
resourcesMap map[schema.GroupVersionResource]metav1.APIResource
|
||||
apiGroups []metav1.APIGroup
|
||||
}
|
||||
|
||||
var _ Helper = &helper{}
|
||||
@@ -127,6 +132,12 @@ func (h *helper) Refresh() error {
|
||||
}
|
||||
}
|
||||
|
||||
apiGroupList, err := h.discoveryClient.ServerGroups()
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
h.apiGroups = apiGroupList.Groups
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -165,3 +176,9 @@ func (h *helper) Resources() []*metav1.APIResourceList {
|
||||
defer h.lock.RUnlock()
|
||||
return h.resources
|
||||
}
|
||||
|
||||
func (h *helper) APIGroups() []metav1.APIGroup {
|
||||
h.lock.RLock()
|
||||
defer h.lock.RUnlock()
|
||||
return h.apiGroups
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user