mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-15 19:56:06 +00:00
Copy "envFrom" from Velero node-agent when creating data mover pods
Signed-off-by: Evan Hanson <evanhanson@catalyst.net.nz>
This commit is contained in:
@@ -553,6 +553,7 @@ func (e *csiSnapshotExposer) createBackupPod(
|
||||
VolumeMounts: volumeMounts,
|
||||
VolumeDevices: volumeDevices,
|
||||
Env: podInfo.env,
|
||||
EnvFrom: podInfo.envFrom,
|
||||
Resources: resources,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -370,6 +370,7 @@ func (e *genericRestoreExposer) createRestorePod(ctx context.Context, ownerObjec
|
||||
VolumeMounts: volumeMounts,
|
||||
VolumeDevices: volumeDevices,
|
||||
Env: podInfo.env,
|
||||
EnvFrom: podInfo.envFrom,
|
||||
Resources: resources,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -31,6 +31,7 @@ type inheritedPodInfo struct {
|
||||
image string
|
||||
serviceAccount string
|
||||
env []v1.EnvVar
|
||||
envFrom []v1.EnvFromSource
|
||||
volumeMounts []v1.VolumeMount
|
||||
volumes []v1.Volume
|
||||
logLevelArgs []string
|
||||
@@ -53,6 +54,7 @@ func getInheritedPodInfo(ctx context.Context, client kubernetes.Interface, veler
|
||||
podInfo.serviceAccount = podSpec.ServiceAccountName
|
||||
|
||||
podInfo.env = podSpec.Containers[0].Env
|
||||
podInfo.envFrom = podSpec.Containers[0].EnvFrom
|
||||
podInfo.volumeMounts = podSpec.Containers[0].VolumeMounts
|
||||
podInfo.volumes = podSpec.Volumes
|
||||
|
||||
|
||||
@@ -67,6 +67,22 @@ func TestGetInheritedPodInfo(t *testing.T) {
|
||||
Value: "value-2",
|
||||
},
|
||||
},
|
||||
EnvFrom: []v1.EnvFromSource{
|
||||
{
|
||||
ConfigMapRef: &v1.ConfigMapEnvSource{
|
||||
LocalObjectReference: v1.LocalObjectReference{
|
||||
Name: "test-configmap",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
SecretRef: &v1.SecretEnvSource{
|
||||
LocalObjectReference: v1.LocalObjectReference{
|
||||
Name: "test-secret",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
VolumeMounts: []v1.VolumeMount{
|
||||
{
|
||||
Name: "volume-1",
|
||||
@@ -116,6 +132,22 @@ func TestGetInheritedPodInfo(t *testing.T) {
|
||||
Value: "value-2",
|
||||
},
|
||||
},
|
||||
EnvFrom: []v1.EnvFromSource{
|
||||
{
|
||||
ConfigMapRef: &v1.ConfigMapEnvSource{
|
||||
LocalObjectReference: v1.LocalObjectReference{
|
||||
Name: "test-configmap",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
SecretRef: &v1.SecretEnvSource{
|
||||
LocalObjectReference: v1.LocalObjectReference{
|
||||
Name: "test-secret",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
VolumeMounts: []v1.VolumeMount{
|
||||
{
|
||||
Name: "volume-1",
|
||||
@@ -191,6 +223,22 @@ func TestGetInheritedPodInfo(t *testing.T) {
|
||||
Value: "value-2",
|
||||
},
|
||||
},
|
||||
envFrom: []v1.EnvFromSource{
|
||||
{
|
||||
ConfigMapRef: &v1.ConfigMapEnvSource{
|
||||
LocalObjectReference: v1.LocalObjectReference{
|
||||
Name: "test-configmap",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
SecretRef: &v1.SecretEnvSource{
|
||||
LocalObjectReference: v1.LocalObjectReference{
|
||||
Name: "test-secret",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
volumeMounts: []v1.VolumeMount{
|
||||
{
|
||||
Name: "volume-1",
|
||||
@@ -228,6 +276,22 @@ func TestGetInheritedPodInfo(t *testing.T) {
|
||||
Value: "value-2",
|
||||
},
|
||||
},
|
||||
envFrom: []v1.EnvFromSource{
|
||||
{
|
||||
ConfigMapRef: &v1.ConfigMapEnvSource{
|
||||
LocalObjectReference: v1.LocalObjectReference{
|
||||
Name: "test-configmap",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
SecretRef: &v1.SecretEnvSource{
|
||||
LocalObjectReference: v1.LocalObjectReference{
|
||||
Name: "test-secret",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
volumeMounts: []v1.VolumeMount{
|
||||
{
|
||||
Name: "volume-1",
|
||||
|
||||
Reference in New Issue
Block a user