mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 05:46:37 +00:00
Merge branch 'main' into cache-volume-for-dd
This commit is contained in:
1
changelogs/unreleased/9389-sseago
Normal file
1
changelogs/unreleased/9389-sseago
Normal file
@@ -0,0 +1 @@
|
||||
don't copy securitycontext from first container if configmap found
|
||||
@@ -185,8 +185,8 @@ func (a *PodVolumeRestoreAction) Execute(input *velero.RestoreItemActionExecuteI
|
||||
securityContextSet = true
|
||||
}
|
||||
}
|
||||
// if first container in pod has a SecurityContext set, then copy this security context
|
||||
if len(pod.Spec.Containers) != 0 && pod.Spec.Containers[0].SecurityContext != nil {
|
||||
// if securityContext configmap is unavailable but first container in pod has a SecurityContext set, then copy this security context
|
||||
if !securityContextSet && len(pod.Spec.Containers) != 0 && pod.Spec.Containers[0].SecurityContext != nil {
|
||||
securityContext = *pod.Spec.Containers[0].SecurityContext.DeepCopy()
|
||||
securityContextSet = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user