From 49c1fa5fb0134c7fbb36aaaed3bb2c6cef2358f7 Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Tue, 23 Apr 2024 10:10:58 +0200 Subject: [PATCH] Explain what happens --- generator/deployment.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generator/deployment.go b/generator/deployment.go index 2ee7f37..8129e41 100644 --- a/generator/deployment.go +++ b/generator/deployment.go @@ -282,6 +282,9 @@ func (d *Deployment) AddVolumes(service types.ServiceConfig, appName string) { }), } } else { + // In case of a file, add it to the configmap and use "subPath" to mount it + // Note that the volumes and volume mounts are not added to the deployment yet, they will be added later + // in generate.go dirname := filepath.Dir(volume.Source) pathname := utils.PathToName(dirname) var cm *ConfigMap @@ -290,7 +293,6 @@ func (d *Deployment) AddVolumes(service types.ServiceConfig, appName string) { cm.usage = FileMapUsageFiles cm.path = dirname cm.Name = utils.TplName(service.Name, appName) + "-" + pathname - // assign a new mountPathConfig to the configMap d.configMaps[pathname] = &ConfigMapMount{ configMap: cm, mountPath: []mountPathConfig{{