Add mapenv label that is more agnostic

- that means that katenary.io/env-to-service is now DEPRECATED
- the yaml style in label is OK, that allows more possibilities and
  adaptation for users
This commit is contained in:
2022-05-05 13:55:33 +02:00
parent fe45157439
commit dbe9fc25ea
3 changed files with 49 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package helm
import (
"katenary/logger"
"strings"
"github.com/compose-spec/compose-go/types"
@@ -44,6 +45,17 @@ func NewContainer(name, image string, environment types.MappingWithEquals, label
if bound, ok := labels[LABEL_ENV_SERVICE]; ok {
toServices = strings.Split(bound, ",")
}
if len(toServices) > 0 {
// warn, it's deprecated now
logger.ActivateColors = true
logger.Yellowf(
"[deprecated] in \"%s\" service: label %s is deprecated, please use %s instead\n",
name,
LABEL_ENV_SERVICE,
LABEL_MAP_ENV,
)
logger.ActivateColors = false
}
idx := 0
for n, v := range environment {