fix: expose container to host only with labels (#1880)

Signed-off-by: ahmed.g <ahmed.g@adjoe.io>
Signed-off-by: TessaIO <ahmedgrati1999@gmail.com>
This commit is contained in:
TessaIO
2024-05-29 16:05:04 -04:00
committed by GitHub
parent 29f6765fc6
commit 3bf98301f7
52 changed files with 19 additions and 163 deletions
+2
View File
@@ -759,6 +759,8 @@ func parseKomposeLabels(labels map[string]string, serviceConfig *kobject.Service
serviceConfig.ServiceExternalTrafficPolicy = serviceExternalTypeTrafficPolicy
case LabelSecurityContextFsGroup:
serviceConfig.FsGroup = cast.ToInt64(value)
case LabelExposeContainerToHost:
serviceConfig.ExposeContainerToHost = cast.ToBool(value)
case LabelServiceExpose:
serviceConfig.ExposeService = strings.Trim(value, " ,")
case LabelNodePortPort:
+2
View File
@@ -104,6 +104,8 @@ const (
LabelHpaMemory = "kompose.hpa.memory"
// LabelNameOverride defines the override resource name
LabelNameOverride = "kompose.service.name_override"
// LabelExposeContainerToHost defines whether to expose container to host or not using hostPort
LabelExposeContainerToHost = "kompose.controller.port.expose"
)
// load environment variables from compose file