[FIX] fix bug: invalid ingress name

This commit is contained in:
GLYASAI 2018-12-03 18:07:00 +08:00
parent 6b53a4496c
commit 5641c809b1

View File

@ -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(),
},