From 843723898fa80c4e38163b5d92e5d0656807261e Mon Sep 17 00:00:00 2001 From: gnolong <2391353625@qq.com> Date: Fri, 6 Dec 2024 17:51:00 +0800 Subject: [PATCH] fix: DP_DB_HOST env is missing --- pkg/dataprotection/restore/builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dataprotection/restore/builder.go b/pkg/dataprotection/restore/builder.go index d50c17a14e7..e3de0a1374a 100644 --- a/pkg/dataprotection/restore/builder.go +++ b/pkg/dataprotection/restore/builder.go @@ -253,8 +253,8 @@ func (r *restoreJobBuilder) addTargetPodAndCredentialEnv(pod *corev1.Pod, env = pod.Spec.Containers[0].Env r.envFrom = pod.Spec.Containers[0].EnvFrom } + env = append(env, corev1.EnvVar{Name: dptypes.DPDBHost, Value: intctrlutil.BuildPodHostDNS(pod)}) if connectionCredential == nil { - env = append(env, corev1.EnvVar{Name: dptypes.DPDBHost, Value: intctrlutil.BuildPodHostDNS(pod)}) if portEnv, err := utils.GetDPDBPortEnv(pod, target.ContainerPort); err == nil { env = append(env, *portEnv) }