Enhance Unit Tests for Annotations

Adds unit tests for a variety of different annotations.
This commit is contained in:
Fernando Diaz 2019-02-03 19:53:01 -06:00
parent 5c4854b537
commit 1da2900b9b
11 changed files with 544 additions and 45 deletions

View file

@ -76,6 +76,22 @@ func (cfg mockCfg) GetAuthCertificate(secret string) (*resolver.AuthSSLCert, err
return nil, fmt.Errorf("secret not found: %v", secret)
}
func TestNoCA(t *testing.T) {
ing := buildIngress()
data := map[string]string{}
data[parser.GetAnnotationWithPrefix("backend-protocol")] = "HTTPS"
ing.SetAnnotations(data)
_, err := NewParser(mockCfg{
certs: map[string]resolver.AuthSSLCert{
"default/secure-verify-ca": {},
},
}).Parse(ing)
if err != nil {
t.Errorf("Unexpected error on ingress: %v", err)
}
}
func TestAnnotations(t *testing.T) {
ing := buildIngress()
data := map[string]string{}