mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 13:55:20 +00:00
Use label to select Velero deployment in plugin cmd (#3447)
* Use label to select Velero deployment in plugin cmd Signed-off-by: F. Gold <fgold@vmware.com> * Move veleroLabel constant closer to usage Signed-off-by: F. Gold <fgold@vmware.com> * Add changelog Signed-off-by: F. Gold <fgold@vmware.com> * Remove year from copyright in new file Signed-off-by: F. Gold <fgold@vmware.com> * Export and use install.Labels() function Signed-off-by: F. Gold <fgold@vmware.com>
This commit is contained in:
@@ -140,7 +140,7 @@ func Deployment(namespace string, opts ...podTemplateOption) *appsv1.Deployment
|
||||
args = append(args, "--default-volumes-to-restic=true")
|
||||
}
|
||||
|
||||
containerLabels := labels()
|
||||
containerLabels := Labels()
|
||||
containerLabels["deploy"] = "velero"
|
||||
|
||||
deployment := &appsv1.Deployment{
|
||||
|
||||
@@ -54,7 +54,7 @@ var (
|
||||
DefaultVeleroNamespace = "velero"
|
||||
)
|
||||
|
||||
func labels() map[string]string {
|
||||
func Labels() map[string]string {
|
||||
return map[string]string{
|
||||
"component": "velero",
|
||||
}
|
||||
@@ -89,7 +89,7 @@ func objectMeta(namespace, name string) metav1.ObjectMeta {
|
||||
return metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: namespace,
|
||||
Labels: labels(),
|
||||
Labels: Labels(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ func AllCRDs() *unstructured.UnstructuredList {
|
||||
resources.SetGroupVersionKind(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "List"})
|
||||
|
||||
for _, crd := range crds.CRDs {
|
||||
crd.SetLabels(labels())
|
||||
crd.SetLabels(Labels())
|
||||
appendUnstructured(resources, crd)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user