forked from LaconicNetwork/kompose
Add kompose.service.expose.ingress-class-name (#1486)
Signed-off-by: Sergey Shevchenko <shevchenko@simple.life>
This commit is contained in:
@@ -40,6 +40,8 @@ const (
|
||||
LabelServiceExpose = "kompose.service.expose"
|
||||
// LabelServiceExposeTLSSecret provides the name of the TLS secret to use with the Kubernetes ingress controller
|
||||
LabelServiceExposeTLSSecret = "kompose.service.expose.tls-secret"
|
||||
// LabelServiceExposeIngressClassName provides the name of ingress class to use with the Kubernetes ingress controller
|
||||
LabelServiceExposeIngressClassName = "kompose.service.expose.ingress-class-name"
|
||||
// LabelServiceAccountName defines the service account name to provide the credential info of the pod.
|
||||
LabelServiceAccountName = "kompose.serviceaccount-name"
|
||||
// LabelControllerType defines the type of controller to be created
|
||||
|
||||
@@ -658,6 +658,8 @@ func parseKomposeLabels(labels map[string]string, serviceConfig *kobject.Service
|
||||
serviceConfig.NodePortPort = cast.ToInt32(value)
|
||||
case LabelServiceExposeTLSSecret:
|
||||
serviceConfig.ExposeServiceTLS = value
|
||||
case LabelServiceExposeIngressClassName:
|
||||
serviceConfig.ExposeServiceIngressClassName = &value
|
||||
case LabelImagePullSecret:
|
||||
serviceConfig.ImagePullSecret = value
|
||||
case LabelImagePullPolicy:
|
||||
@@ -671,6 +673,10 @@ func parseKomposeLabels(labels map[string]string, serviceConfig *kobject.Service
|
||||
return errors.New("kompose.service.expose.tls-secret was specified without kompose.service.expose")
|
||||
}
|
||||
|
||||
if serviceConfig.ExposeService == "" && serviceConfig.ExposeServiceIngressClassName != nil {
|
||||
return errors.New("kompose.service.expose.ingress-class-name was specified without kompose.service.expose")
|
||||
}
|
||||
|
||||
if serviceConfig.ServiceType != string(api.ServiceTypeNodePort) && serviceConfig.NodePortPort != 0 {
|
||||
return errors.New("kompose.service.type must be nodeport when assign node port value")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user