|
@@ -37,8 +37,7 @@ import (
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// getProviderSecretData returns the provider's secret data with the provided ExternalSecret.
|
|
// getProviderSecretData returns the provider's secret data with the provided ExternalSecret.
|
|
|
-func (r *Reconciler) getProviderSecretData(ctx context.Context, externalSecret *esv1beta1.ExternalSecret) (map[string][]byte, error) {
|
|
|
|
|
- var err error
|
|
|
|
|
|
|
+func (r *Reconciler) getProviderSecretData(ctx context.Context, externalSecret *esv1beta1.ExternalSecret) (providerData map[string][]byte, err error) {
|
|
|
// We MUST NOT create multiple instances of a provider client (mostly due to limitations with GCP)
|
|
// We MUST NOT create multiple instances of a provider client (mostly due to limitations with GCP)
|
|
|
// Clientmanager keeps track of the client instances
|
|
// Clientmanager keeps track of the client instances
|
|
|
// that are created during the fetching process and closes clients
|
|
// that are created during the fetching process and closes clients
|
|
@@ -63,9 +62,12 @@ func (r *Reconciler) getProviderSecretData(ctx context.Context, externalSecret *
|
|
|
}
|
|
}
|
|
|
if commitErr := genState.Commit(); commitErr != nil {
|
|
if commitErr := genState.Commit(); commitErr != nil {
|
|
|
r.Log.Error(commitErr, "error committing generator state")
|
|
r.Log.Error(commitErr, "error committing generator state")
|
|
|
|
|
+ // At this point the original error can only be a NoSecretErr
|
|
|
|
|
+ // but we should return the commit error here as it's more important.
|
|
|
|
|
+ err = commitErr
|
|
|
}
|
|
}
|
|
|
}()
|
|
}()
|
|
|
- providerData := make(map[string][]byte)
|
|
|
|
|
|
|
+ providerData = make(map[string][]byte)
|
|
|
for i, remoteRef := range externalSecret.Spec.DataFrom {
|
|
for i, remoteRef := range externalSecret.Spec.DataFrom {
|
|
|
var secretMap map[string][]byte
|
|
var secretMap map[string][]byte
|
|
|
|
|
|