fix(configmap): File from the root of project ends by a dash

fixes #150

If we mount a file from the root of project, the names ends by a dash.
That makes helm failing to install the package.
This commit is contained in:
2025-08-03 10:12:24 +02:00
parent f2b5c16e71
commit 136478aff7
2 changed files with 45 additions and 1 deletions

View File

@@ -635,12 +635,16 @@ func (d *Deployment) appendFileToConfigMap(service types.ServiceConfig, appName
// in generate.go
dirname := filepath.Dir(volume.Source)
pathname := utils.PathToName(dirname)
pathname = strings.TrimSpace(pathname)
if len(pathname) != 0 {
pathname += "-" + pathname
}
var cm *ConfigMap
if v, ok := d.configMaps[pathname]; !ok {
cm = NewConfigMap(*d.service, appName, true)
cm.usage = FileMapUsageFiles
cm.path = dirname
cm.Name = utils.TplName(service.Name, appName) + "-" + pathname
cm.Name = utils.TplName(service.Name, appName) + pathname
d.configMaps[pathname] = &ConfigMapMount{
configMap: cm,
mountPath: []mountPathConfig{{