mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
feat(kubernetes): remove path and service from mandatory fields EE-5406 (#9054)
This commit is contained in:
parent
3721c1478e
commit
57fa044f2e
2 changed files with 48 additions and 21 deletions
|
@ -207,6 +207,14 @@ func (kcl *KubeClient) CreateIngress(namespace string, info models.K8sIngressInf
|
|||
})
|
||||
}
|
||||
|
||||
if len(rules) == 0 {
|
||||
for _, host := range info.Hosts {
|
||||
ingress.Spec.Rules = []netv1.IngressRule{{
|
||||
Host: host,
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
_, err := ingressClient.Create(context.Background(), &ingress, metav1.CreateOptions{})
|
||||
return err
|
||||
}
|
||||
|
@ -279,6 +287,14 @@ func (kcl *KubeClient) UpdateIngress(namespace string, info models.K8sIngressInf
|
|||
})
|
||||
}
|
||||
|
||||
if len(rules) == 0 {
|
||||
for _, host := range info.Hosts {
|
||||
ingress.Spec.Rules = []netv1.IngressRule{{
|
||||
Host: host,
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
_, err := ingressClient.Update(context.Background(), &ingress, metav1.UpdateOptions{})
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue