Standardization

- changed variables that was uppercased, that's not OK for linters
- cleanup some documentation
- remove the "/" in label prefix, a function is now used to get the
  complete label (`labelName()`)
- some cleanup in tpl files, and so on...
This commit is contained in:
2024-04-24 13:59:21 +02:00
parent 98c7c6ddc1
commit f73d598bb4
22 changed files with 181 additions and 220 deletions

View File

@@ -76,7 +76,7 @@ func NewConfigMap(service types.ServiceConfig, appName string) *ConfigMap {
}
// get the secrets from the labels
if v, ok := service.Labels[LABEL_SECRETS]; ok {
if v, ok := service.Labels[LabelSecrets]; ok {
err := yaml.Unmarshal([]byte(v), &secrets)
if err != nil {
log.Fatal(err)
@@ -87,7 +87,7 @@ func NewConfigMap(service types.ServiceConfig, appName string) *ConfigMap {
}
}
// get the label values from the labels
varDescriptons := utils.GetValuesFromLabel(service, LABEL_VALUES)
varDescriptons := utils.GetValuesFromLabel(service, LabelValues)
for value := range varDescriptons {
labelValues = append(labelValues, value)
}
@@ -104,7 +104,7 @@ func NewConfigMap(service types.ServiceConfig, appName string) *ConfigMap {
}
// remove the variables that are already defined in the environment
if l, ok := service.Labels[LABEL_MAP_ENV]; ok {
if l, ok := service.Labels[LabelMapEnv]; ok {
envmap := make(map[string]string)
if err := goyaml.Unmarshal([]byte(l), &envmap); err != nil {
log.Fatal("Error parsing map-env", err)