Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClusterRoleBindingListerMap ¶
func NewClusterRoleBindingListerMap(clientset kubernetes.Interface) map[string]ClusterRoleBindingLister
NewClusterRoleBindingListerMap creates a map of RBAC version strings to their associated ClusterRoleBindingLister structs. Necessary so that callers to the ClusterRoleBindingLister interfaces don't need the kubernetes.Interface.
Types ¶
type ClusterRoleBinding ¶
type ClusterRoleBinding interface { // Name returns the name of a ClusterRoleBinding. Name() string // ServiceAccountSubjects returns the names of subjects that are service accounts in the given namespace. ServiceAccountSubjects(namespace string) []string // RoleRefName returns the name of a ClusterRoleBinding's RoleRef. RoleRefName() string }
ClusterRoleBinding abstracts access to ClusterRoleBindings whether they're v1 or v1beta1.
type ClusterRoleBindingLister ¶
type ClusterRoleBindingLister interface { // List returns a slice of ClusterRoleBindings which can represent either v1 or v1beta1 ClusterRoleBindings. List() ([]ClusterRoleBinding, error) }
ClusterRoleBindingLister allows for listing ClusterRoleBindings in a version-independent way.
type PVCAction ¶
type PVCAction struct {
// contains filtered or unexported fields
}
PVCAction inspects a PersistentVolumeClaim for the PersistentVolume that it references and backs it up
func NewPVCAction ¶
func NewPVCAction(logger logrus.FieldLogger) *PVCAction
func (*PVCAction) Execute ¶
func (a *PVCAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
Execute finds the PersistentVolume bound by the provided PersistentVolumeClaim, if any, and backs it up
type PodAction ¶
type PodAction struct {
// contains filtered or unexported fields
}
PodAction implements ItemAction.
func NewPodAction ¶
func NewPodAction(logger logrus.FieldLogger) *PodAction
NewPodAction creates a new ItemAction for pods.
func (*PodAction) AppliesTo ¶
func (a *PodAction) AppliesTo() (velero.ResourceSelector, error)
AppliesTo returns a ResourceSelector that applies only to pods.
func (*PodAction) Execute ¶
func (a *PodAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
Execute scans the pod's spec.volumes for persistentVolumeClaim volumes and returns a ResourceIdentifier list containing references to all of the persistentVolumeClaim volumes used by the pod. This ensures that when a pod is backed up, all referenced PVCs are backed up too.
type RemapCRDVersionAction ¶
type RemapCRDVersionAction struct {
// contains filtered or unexported fields
}
RemapCRDVersionAction inspects CustomResourceDefinition and decides if it is a v1 CRD that needs to be backed up as v1beta1.
func NewRemapCRDVersionAction ¶
func NewRemapCRDVersionAction(logger logrus.FieldLogger, betaCRDClient apiextv1beta1client.CustomResourceDefinitionInterface, discoveryHelper velerodiscovery.Helper) *RemapCRDVersionAction
NewRemapCRDVersionAction instantiates a new RemapCRDVersionAction plugin.
func (*RemapCRDVersionAction) AppliesTo ¶
func (a *RemapCRDVersionAction) AppliesTo() (velero.ResourceSelector, error)
AppliesTo selects the resources the plugin should run against. In this case, CustomResourceDefinitions.
func (*RemapCRDVersionAction) Execute ¶
func (a *RemapCRDVersionAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
Execute executes logic necessary to check a CustomResourceDefinition and inspect it for characteristics that necessitate saving it as v1beta1 instead of v1.
type ServiceAccountAction ¶
type ServiceAccountAction struct {
// contains filtered or unexported fields
}
ServiceAccountAction implements ItemAction.
func NewServiceAccountAction ¶
func NewServiceAccountAction(logger logrus.FieldLogger, clusterRoleBindingListers map[string]ClusterRoleBindingLister, discoveryHelper velerodiscovery.Helper) (*ServiceAccountAction, error)
NewServiceAccountAction creates a new ItemAction for service accounts.
func (*ServiceAccountAction) AppliesTo ¶
func (a *ServiceAccountAction) AppliesTo() (velero.ResourceSelector, error)
AppliesTo returns a ResourceSelector that applies only to service accounts.
func (*ServiceAccountAction) Execute ¶
func (a *ServiceAccountAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
Execute checks for any ClusterRoleBindings that have this service account as a subject, and adds the ClusterRoleBinding and associated ClusterRole to the list of additional items to be backed up.