Fix panic on multiple non-matching canary
This commit is contained in:
parent
79c52cf094
commit
8a40e82ffb
3 changed files with 56 additions and 1 deletions
|
|
@ -367,6 +367,32 @@ func NewSingleIngress(name, path, host, ns, service string, port int, annotation
|
|||
return newSingleIngressWithRules(name, path, host, ns, service, port, annotations, nil)
|
||||
}
|
||||
|
||||
// NewSingleIngressWithMultiplePaths creates a simple ingress rule with multiple paths
|
||||
func NewSingleIngressWithMultiplePaths(name string, paths []string, host, ns, service string, port int, annotations *map[string]string) *extensions.Ingress {
|
||||
spec := extensions.IngressSpec{
|
||||
Rules: []extensions.IngressRule{
|
||||
{
|
||||
Host: host,
|
||||
IngressRuleValue: extensions.IngressRuleValue{
|
||||
HTTP: &extensions.HTTPIngressRuleValue{},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, path := range paths {
|
||||
spec.Rules[0].IngressRuleValue.HTTP.Paths = append(spec.Rules[0].IngressRuleValue.HTTP.Paths, extensions.HTTPIngressPath{
|
||||
Path: path,
|
||||
Backend: extensions.IngressBackend{
|
||||
ServiceName: service,
|
||||
ServicePort: intstr.FromInt(port),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
return newSingleIngress(name, ns, annotations, spec)
|
||||
}
|
||||
|
||||
func newSingleIngressWithRules(name, path, host, ns, service string, port int, annotations *map[string]string, tlsHosts []string) *extensions.Ingress {
|
||||
|
||||
spec := extensions.IngressSpec{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue