Do not update a secret not referenced by ingress rules

This commit is contained in:
Manuel de Brito Fontes 2017-11-14 17:50:08 -03:00
parent 90eff7d34c
commit a36cd10041
5 changed files with 303 additions and 4 deletions

View file

@ -172,6 +172,26 @@ func (f *Framework) WaitForNginxServer(name string, matcher func(cfg string) boo
return wait.PollImmediate(Poll, time.Minute*2, f.matchNginxConditions(name, matcher))
}
// NginxLogs returns the logs of the nginx ingress controller pod running
func (f *Framework) NginxLogs() (string, error) {
l, err := f.KubeClientSet.CoreV1().Pods("ingress-nginx").List(metav1.ListOptions{
LabelSelector: "app=ingress-nginx",
})
if err != nil {
return "", err
}
if len(l.Items) == 0 {
return "", fmt.Errorf("no nginx ingress controller pod is running")
}
if len(l.Items) != 1 {
return "", fmt.Errorf("unexpected number of nginx ingress controller pod is running (%v)", len(l.Items))
}
return f.Logs(&l.Items[0])
}
func (f *Framework) matchNginxConditions(name string, matcher func(cfg string) bool) wait.ConditionFunc {
return func() (bool, error) {
l, err := f.KubeClientSet.CoreV1().Pods("ingress-nginx").List(metav1.ListOptions{