Remove secrets from ingress after a Delete event

This commit is contained in:
Manuel de Brito Fontes 2017-05-11 21:50:43 -03:00
parent 4bd4bf3be6
commit a537d2d0fa
6 changed files with 24 additions and 26 deletions

View file

@ -34,7 +34,7 @@ import (
// syncSecret keeps in sync Secrets used by Ingress rules with the files on
// disk to allow copy of the content of the secret to disk to be used
// by external processes.
func (ic *GenericController) syncSecret(key string) {
func (ic *GenericController) syncSecret() {
glog.V(3).Infof("starting syncing of secrets")
if !ic.controllersInSync() {
@ -46,14 +46,7 @@ func (ic *GenericController) syncSecret(key string) {
var cert *ingress.SSLCert
var err error
// by default we sync just one secret
keys := []interface{}{key}
// if the key is empty we check all the secrets
if key == "" {
keys = ic.secretTracker.List()
}
for _, k := range keys {
for _, k := range ic.secretTracker.List() {
key := k.(string)
cert, err = ic.getPemCertificate(key)
if err != nil {