From 5641c809b142f405f5865cd585398d01bbe9efb3 Mon Sep 17 00:00:00 2001 From: GLYASAI Date: Mon, 3 Dec 2018 18:07:00 +0800 Subject: [PATCH] [FIX] fix bug: invalid ingress name --- worker/appm/conversion/gateway.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/appm/conversion/gateway.go b/worker/appm/conversion/gateway.go index 46da0e143..6570c4646 100644 --- a/worker/appm/conversion/gateway.go +++ b/worker/appm/conversion/gateway.go @@ -262,7 +262,7 @@ func (a *AppServiceBuild) applyHTTPRule(rule *model.HTTPRule, port *model.Tenant // create ingress ing = &extensions.Ingress{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("ing-%s-%s", domain, rule.UUID), + Name: strings.Replace(fmt.Sprintf("ing-%s-%s", domain, rule.UUID[0:8]), "*", "star", -1), Namespace: a.tenant.UUID, Labels: a.appService.GetCommonLabels(), }, @@ -351,7 +351,7 @@ func (a *AppServiceBuild) applyTCPRule(rule *model.TCPRule, service *corev1.Serv // create ingress ing = &extensions.Ingress{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("ing-%s-%s", strings.Replace(rule.IP, ".", "-", -1), rule.UUID), + Name: fmt.Sprintf("ing-%s-%s", strings.Replace(rule.IP, ".", "-", -1), rule.UUID[0:8]), Namespace: namespace, Labels: a.appService.GetCommonLabels(), },