Skip to content

Commit

Permalink
fix: DP_DB_HOST env is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
gnolong committed Dec 6, 2024
1 parent f14ecf2 commit 8437238
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dataprotection/restore/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 8437238

Please sign in to comment.