Skip to content

Commit 5b663ea

Browse files
RealAnnaarttor
authored andcommitted
fix: reduced code complexity
1 parent 467bab4 commit 5b663ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/processor/deployment/deployment.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func processPodContainer(name string, appMeta helmify.AppMetadata, c corev1.Cont
248248
return c, errors.Wrap(err, "unable to set deployment value field")
249249
}
250250

251-
c, err = processEnv(name, appMeta, c, values, containerName)
251+
c, err = processEnv(name, appMeta, c, values)
252252
if err != nil {
253253
return c, err
254254
}
@@ -280,7 +280,8 @@ func processPodContainer(name string, appMeta helmify.AppMetadata, c corev1.Cont
280280
return c, nil
281281
}
282282

283-
func processEnv(name string, appMeta helmify.AppMetadata, c corev1.Container, values *helmify.Values, containerName string) (corev1.Container, error) {
283+
func processEnv(name string, appMeta helmify.AppMetadata, c corev1.Container, values *helmify.Values) (corev1.Container, error) {
284+
containerName := strcase.ToLowerCamel(c.Name)
284285
for i := 0; i < len(c.Env); i++ {
285286
if c.Env[i].ValueFrom != nil && c.Env[i].ValueFrom.SecretKeyRef != nil {
286287
c.Env[i].ValueFrom.SecretKeyRef.Name = appMeta.TemplatedName(c.Env[i].ValueFrom.SecretKeyRef.Name)

0 commit comments

Comments
 (0)