Merge pull request #6796 from aledbf/default

Updates to the custom default SSL certificate must trigger a reload
This commit is contained in:
Kubernetes Prow Robot 2021-01-22 07:41:27 -08:00 committed by GitHub
commit d9f613e52a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 3 deletions

View file

@ -491,6 +491,7 @@ func (n *NGINXController) getConfiguration(ingresses []*ingress.Ingress) (sets.S
UDPEndpoints: n.getStreamServices(n.cfg.UDPConfigMapName, apiv1.ProtocolUDP), UDPEndpoints: n.getStreamServices(n.cfg.UDPConfigMapName, apiv1.ProtocolUDP),
PassthroughBackends: passUpstreams, PassthroughBackends: passUpstreams,
BackendConfigChecksum: n.store.GetBackendConfiguration().Checksum, BackendConfigChecksum: n.store.GetBackendConfiguration().Checksum,
DefaultSSLCertificate: n.getDefaultSSLCertificate(),
} }
} }

View file

@ -71,5 +71,10 @@ func (s SSLCert) GetObjectKind() schema.ObjectKind {
// HashInclude defines if a field should be used or not to calculate the hash // HashInclude defines if a field should be used or not to calculate the hash
func (s SSLCert) HashInclude(field string, v interface{}) (bool, error) { func (s SSLCert) HashInclude(field string, v interface{}) (bool, error) {
return (field != "PemSHA" && field != "CASHA" && field != "ExpireTime"), nil switch field {
case "PemSHA", "CASHA", "ExpireTime":
return true, nil
default:
return false, nil
}
} }

View file

@ -74,6 +74,8 @@ type Configuration struct {
// ConfigurationChecksum contains the particular checksum of a Configuration object // ConfigurationChecksum contains the particular checksum of a Configuration object
ConfigurationChecksum string `json:"configurationChecksum,omitempty"` ConfigurationChecksum string `json:"configurationChecksum,omitempty"`
DefaultSSLCertificate *SSLCert `json:"-"`
} }
// Backend describes one or more remote server/s (endpoints) associated with a service // Backend describes one or more remote server/s (endpoints) associated with a service
@ -125,7 +127,12 @@ type TrafficShapingPolicy struct {
// HashInclude defines if a field should be used or not to calculate the hash // HashInclude defines if a field should be used or not to calculate the hash
func (s Backend) HashInclude(field string, v interface{}) (bool, error) { func (s Backend) HashInclude(field string, v interface{}) (bool, error) {
return (field != "Endpoints"), nil switch field {
case "Endpoints":
return false, nil
default:
return true, nil
}
} }
// SessionAffinityConfig describes different affinity configurations for new sessions. // SessionAffinityConfig describes different affinity configurations for new sessions.

View file

@ -29,6 +29,10 @@ func (c1 *Configuration) Equal(c2 *Configuration) bool {
return false return false
} }
if !c1.DefaultSSLCertificate.Equal(c2.DefaultSSLCertificate) {
return false
}
match := compareBackends(c1.Backends, c2.Backends) match := compareBackends(c1.Backends, c2.Backends)
if !match { if !match {
return false return false
@ -271,7 +275,7 @@ func (s1 *Server) Equal(s2 *Server) bool {
if s1.SSLPassthrough != s2.SSLPassthrough { if s1.SSLPassthrough != s2.SSLPassthrough {
return false return false
} }
if !(s1.SSLCert).Equal(s2.SSLCert) { if !s1.SSLCert.Equal(s2.SSLCert) {
return false return false
} }