Add test for store helper ListIngresses

This commit is contained in:
Manuel de Brito Fontes 2018-04-21 18:40:02 -03:00
parent 8179dfec0e
commit c5932366db
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
2 changed files with 106 additions and 0 deletions

View file

@ -617,16 +617,19 @@ func (s k8sStore) ListIngresses() []*extensions.Ingress {
if !class.IsValid(ing) {
continue
}
for ri, rule := range ing.Spec.Rules {
if rule.HTTP == nil {
continue
}
for pi, path := range rule.HTTP.Paths {
if path.Path == "" {
ing.Spec.Rules[ri].HTTP.Paths[pi].Path = "/"
}
}
}
ingresses = append(ingresses, ing)
}