WIP: Avoid reloads implementing Equals in structs

This commit is contained in:
Manuel de Brito Fontes 2017-06-14 17:33:12 -04:00
parent e9871ffaad
commit 75a4a61254
12 changed files with 701 additions and 11 deletions

View file

@ -40,6 +40,23 @@ type AuthSSLConfig struct {
ValidationDepth int `json:"validationDepth"`
}
func (assl1 *AuthSSLConfig) Equal(assl2 *AuthSSLConfig) bool {
if assl1 == assl2 {
return true
}
if assl1 == nil || assl2 == nil {
return false
}
if (&assl1.AuthSSLCert).Equal(&assl2.AuthSSLCert) {
return false
}
if assl1.ValidationDepth != assl2.ValidationDepth {
return false
}
return true
}
// NewParser creates a new TLS authentication annotation parser
func NewParser(resolver resolver.AuthCertificate) parser.IngressAnnotation {
return authTLS{resolver}