Solves the problem with certificate syncronization
This commit is contained in:
parent
e1a52d1ec1
commit
0518f47fb4
1 changed files with 9 additions and 0 deletions
|
@ -676,6 +676,15 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress
|
||||||
|
|
||||||
// GetAuthCertificate ...
|
// GetAuthCertificate ...
|
||||||
func (ic GenericController) GetAuthCertificate(secretName string) (*resolver.AuthSSLCert, error) {
|
func (ic GenericController) GetAuthCertificate(secretName string) (*resolver.AuthSSLCert, error) {
|
||||||
|
key, err := ic.GetSecret(secretName)
|
||||||
|
if err != nil {
|
||||||
|
return &resolver.AuthSSLCert{}, fmt.Errorf("unexpected error: %v", err)
|
||||||
|
}
|
||||||
|
if key != nil {
|
||||||
|
ic.secretQueue.Enqueue(key)
|
||||||
|
}
|
||||||
|
// Enough time to enqueue the new certificate
|
||||||
|
time.Sleep(5 * time.Second)
|
||||||
bc, exists := ic.sslCertTracker.Get(secretName)
|
bc, exists := ic.sslCertTracker.Get(secretName)
|
||||||
if !exists {
|
if !exists {
|
||||||
return &resolver.AuthSSLCert{}, fmt.Errorf("secret %v does not exists", secretName)
|
return &resolver.AuthSSLCert{}, fmt.Errorf("secret %v does not exists", secretName)
|
||||||
|
|
Loading…
Reference in a new issue