From 96f843630aa6a6c463ef066709bd45dcc6061b4f Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Thu, 21 Nov 2024 11:04:19 +0100 Subject: [PATCH] chore(misc): make the code more readable here --- generator/deployment.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generator/deployment.go b/generator/deployment.go index a4dc0bd..5100481 100644 --- a/generator/deployment.go +++ b/generator/deployment.go @@ -585,10 +585,12 @@ func (d *Deployment) appendFileToConfigMap(service types.ServiceConfig, appName func (d *Deployment) bindVolumes(volume types.ServiceVolumeConfig, isSamePod bool, tobind map[string]bool, service types.ServiceConfig, appName string) { container, index := utils.GetContainerByName(service.Name, d.Spec.Template.Spec.Containers) + defer func(d *Deployment, container *corev1.Container, index int) { d.Spec.Template.Spec.Containers[index] = *container }(d, container, index) - if _, ok := tobind[volume.Source]; !isSamePod && volume.Type == "bind" && !ok { + + if _, found := tobind[volume.Source]; !isSamePod && volume.Type == "bind" && !found { utils.Warn( "Bind volumes are not supported yet, " + "excepting for those declared as " +