Skip to content

Commit

Permalink
Add repo label to maintenance pod
Browse files Browse the repository at this point in the history
  • Loading branch information
msfrucht committed Sep 19, 2024
1 parent 0b74a73 commit 3a6686f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/repository/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
3 changes: 3 additions & 0 deletions pkg/repository/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ func TestBuildMaintenanceJob(t *testing.T) {
assert.Equal(t, param.BackupRepo.Namespace, job.Namespace)
assert.Equal(t, param.BackupRepo.Name, job.Labels[repository.RepositoryNameLabel])

// check pod template spec
assert.Equal(t, param.BackupRepo.Name, job.Spec.Template.Labels[repository.RepositoryNameLabel])

// Check container
assert.Len(t, job.Spec.Template.Spec.Containers, 1)
container := job.Spec.Template.Spec.Containers[0]
Expand Down

0 comments on commit 3a6686f

Please sign in to comment.