Add labels to maintanance job pods
Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com> add changelog Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>pull/8246/head
parent
11f771fc39
commit
c0d51a5465
|
@ -0,0 +1 @@
|
|||
Add labels to maintenance job pods
|
|
@ -418,6 +418,9 @@ func (m *manager) buildMaintenanceJob(
|
|||
Template: v1.PodTemplateSpec{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "velero-repo-maintenance-pod",
|
||||
Labels: map[string]string{
|
||||
repository.RepositoryNameLabel: param.BackupRepo.Name,
|
||||
},
|
||||
},
|
||||
Spec: v1.PodSpec{
|
||||
Containers: []v1.Container{
|
||||
|
|
|
@ -182,6 +182,8 @@ func TestBuildMaintenanceJob(t *testing.T) {
|
|||
assert.Equal(t, param.BackupRepo.Namespace, job.Namespace)
|
||||
assert.Equal(t, param.BackupRepo.Name, job.Labels[repository.RepositoryNameLabel])
|
||||
|
||||
assert.Equal(t, param.BackupRepo.Name, job.Spec.Template.ObjectMeta.Labels[repository.RepositoryNameLabel])
|
||||
|
||||
// Check container
|
||||
assert.Len(t, job.Spec.Template.Spec.Containers, 1)
|
||||
container := job.Spec.Template.Spec.Containers[0]
|
||||
|
|
Loading…
Reference in New Issue