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:
codegold79
2021-02-10 17:42:04 -08:00
committed by GitHub
parent 502fb8d7be
commit 6455350940
6 changed files with 57 additions and 7 deletions

View File

@@ -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{

View File

@@ -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)
}