Explain what happens

This commit is contained in:
2024-04-23 10:10:58 +02:00
parent d1186ee1e1
commit 49c1fa5fb0

View File

@@ -282,6 +282,9 @@ func (d *Deployment) AddVolumes(service types.ServiceConfig, appName string) {
}), }),
} }
} else { } 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) dirname := filepath.Dir(volume.Source)
pathname := utils.PathToName(dirname) pathname := utils.PathToName(dirname)
var cm *ConfigMap var cm *ConfigMap
@@ -290,7 +293,6 @@ func (d *Deployment) AddVolumes(service types.ServiceConfig, appName string) {
cm.usage = FileMapUsageFiles cm.usage = FileMapUsageFiles
cm.path = dirname cm.path = dirname
cm.Name = utils.TplName(service.Name, appName) + "-" + pathname cm.Name = utils.TplName(service.Name, appName) + "-" + pathname
// assign a new mountPathConfig to the configMap
d.configMaps[pathname] = &ConfigMapMount{ d.configMaps[pathname] = &ConfigMapMount{
configMap: cm, configMap: cm,
mountPath: []mountPathConfig{{ mountPath: []mountPathConfig{{