Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mgandharva committed Jan 10, 2025
1 parent 7f28ce9 commit 3804553
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/drivers/commonconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,15 @@ func GetController(ctx context.Context, cr csmv1.ContainerStorageModule, operato
c.Image = &image
}
}
if cr.Spec.Driver.Controller != nil {
containers[i].Env = utils.ReplaceAllApplyCustomEnvs(c.Env, cr.Spec.Driver.Common.Envs, cr.Spec.Driver.Controller.Envs)
if cr.Spec.Driver.Common != nil || cr.Spec.Driver.Controller != nil {
var commonEnvs, controllerEnvs []corev1.EnvVar
if cr.Spec.Driver.Common != nil {
commonEnvs = cr.Spec.Driver.Common.Envs
}
if cr.Spec.Driver.Controller != nil {
controllerEnvs = cr.Spec.Driver.Controller.Envs
}
containers[i].Env = utils.ReplaceAllApplyCustomEnvs(c.Env, commonEnvs, controllerEnvs)
c.Env = containers[i].Env
}
}
Expand Down

0 comments on commit 3804553

Please sign in to comment.