Explorar el Código

Closing client at SecretStore reconcilers

Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Gustavo Carvalho hace 4 años
padre
commit
933aef67b6
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      pkg/controllers/secretstore/common.go

+ 3 - 1
pkg/controllers/secretstore/common.go

@@ -91,7 +91,9 @@ func validateStore(ctx context.Context, namespace string, store esapi.GenericSto
 		recorder.Event(store, v1.EventTypeWarning, esapi.ReasonInvalidProviderConfig, err.Error())
 		return fmt.Errorf(errStoreClient, err)
 	}
-
+	defer func() {
+		cl.Close(ctx)
+	}()
 	err = cl.Validate()
 	if err != nil {
 		cond := NewSecretStoreCondition(esapi.SecretStoreReady, v1.ConditionFalse, esapi.ReasonValidationFailed, errUnableValidateStore)