Skip to content

Commit

Permalink
issue 8433: add ask label to data mover pods
Browse files Browse the repository at this point in the history
Signed-off-by: Lyndon-Li <[email protected]>
  • Loading branch information
Lyndon-Li committed Dec 5, 2024
1 parent 04d6c79 commit 9af57ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/8487-Lyndon-Li
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix issue #8433, add ask label to data mover pods
4 changes: 4 additions & 0 deletions pkg/exposer/csi_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ func (e *csiSnapshotExposer) createBackupPod(
}
label[podGroupLabel] = podGroupSnapshot

for k, v := range thirdPartyLabels {
label[k] = v
}

volumeMode := corev1.PersistentVolumeFilesystem
if backupPVC.Spec.VolumeMode != nil {
volumeMode = *backupPVC.Spec.VolumeMode
Expand Down
8 changes: 8 additions & 0 deletions pkg/exposer/generic_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ func (e *genericRestoreExposer) createRestorePod(ctx context.Context, ownerObjec
}}
volumes = append(volumes, podInfo.volumes...)

if label == nil {
label = make(map[string]string)
}

Check warning on line 328 in pkg/exposer/generic_restore.go

View check run for this annotation

Codecov / codecov/patch

pkg/exposer/generic_restore.go#L327-L328

Added lines #L327 - L328 were not covered by tests

for k, v := range thirdPartyLabels {
label[k] = v
}

volumeMode := corev1.PersistentVolumeFilesystem
if targetPVC.Spec.VolumeMode != nil {
volumeMode = *targetPVC.Spec.VolumeMode
Expand Down
4 changes: 4 additions & 0 deletions pkg/exposer/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ type ExposeByPod struct {
HostingContainer string
VolumeName string
}

var thirdPartyLabels map[string]string = map[string]string{
"azure.workload.identity/use": "true",
}

0 comments on commit 9af57ab

Please sign in to comment.