Improve resource usage in nginx controller
This commit is contained in:
parent
1a68536e29
commit
cd288b9993
17 changed files with 388 additions and 794 deletions
|
|
@ -67,15 +67,11 @@ func (ic *GenericController) syncSecret(key string) {
|
|||
// getPemCertificate receives a secret, and creates a ingress.SSLCert as return.
|
||||
// It parses the secret and verifies if it's a keypair, or a 'ca.crt' secret only.
|
||||
func (ic *GenericController) getPemCertificate(secretName string) (*ingress.SSLCert, error) {
|
||||
secretInterface, exists, err := ic.secrLister.Store.GetByKey(secretName)
|
||||
secret, err := ic.listers.Secret.GetByName(secretName)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error retrieving secret %v: %v", secretName, err)
|
||||
}
|
||||
if !exists {
|
||||
return nil, fmt.Errorf("secret named %v does not exist", secretName)
|
||||
}
|
||||
|
||||
secret := secretInterface.(*apiv1.Secret)
|
||||
cert, okcert := secret.Data[apiv1.TLSCertKey]
|
||||
key, okkey := secret.Data[apiv1.TLSPrivateKeyKey]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue