1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00

Add ability to use RetrySettings in the VaultDynamicSecret generator (#4076)

Signed-off-by: Oleksij Samorukov <samm@net-art.cz>
This commit is contained in:
Alex Samorukov 2024-11-07 07:58:23 +01:00 committed by GitHub
parent b3c3e1924d
commit ebbc3a0e27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 30 additions and 3 deletions

View file

@ -41,6 +41,10 @@ type VaultDynamicSecretSpec struct {
// +kubebuilder:default=Data
ResultType VaultDynamicSecretResultType `json:"resultType,omitempty"`
// Used to configure http retries if failed
// +optional
RetrySettings *esv1beta1.SecretStoreRetrySettings `json:"retrySettings,omitempty"`
// Vault provider common spec
Provider *esv1beta1.VaultProvider `json:"provider"`

View file

@ -1035,6 +1035,11 @@ func (in *VaultDynamicSecretSpec) DeepCopyInto(out *VaultDynamicSecretSpec) {
*out = new(apiextensionsv1.JSON)
(*in).DeepCopyInto(*out)
}
if in.RetrySettings != nil {
in, out := &in.RetrySettings, &out.RetrySettings
*out = new(v1beta1.SecretStoreRetrySettings)
(*in).DeepCopyInto(*out)
}
if in.Provider != nil {
in, out := &in.Provider, &out.Provider
*out = new(v1beta1.VaultProvider)

View file

@ -710,6 +710,15 @@ spec:
- Data
- Auth
type: string
retrySettings:
description: Used to configure http retries if failed
properties:
maxRetries:
format: int32
type: integer
retryInterval:
type: string
type: object
required:
- path
- provider

View file

@ -12848,6 +12848,15 @@ spec:
- Data
- Auth
type: string
retrySettings:
description: Used to configure http retries if failed
properties:
maxRetries:
format: int32
type: integer
retryInterval:
type: string
type: object
required:
- path
- provider

View file

@ -71,7 +71,7 @@ func (g *Generator) generate(ctx context.Context, c *provider.Provider, jsonSpec
if res == nil || res.Spec.Provider == nil {
return nil, errors.New("no Vault provider config in spec")
}
cl, err := c.NewGeneratorClient(ctx, kube, corev1, res.Spec.Provider, namespace)
cl, err := c.NewGeneratorClient(ctx, kube, corev1, res.Spec.Provider, namespace, res.Spec.RetrySettings)
if err != nil {
return nil, fmt.Errorf(errVaultClient, err)
}

View file

@ -96,8 +96,8 @@ func (p *Provider) NewClient(ctx context.Context, store esv1beta1.GenericStore,
return p.newClient(ctx, store, kube, clientset.CoreV1(), namespace)
}
func (p *Provider) NewGeneratorClient(ctx context.Context, kube kclient.Client, corev1 typedcorev1.CoreV1Interface, vaultSpec *esv1beta1.VaultProvider, namespace string) (util.Client, error) {
vStore, cfg, err := p.prepareConfig(ctx, kube, corev1, vaultSpec, nil, namespace, resolvers.EmptyStoreKind)
func (p *Provider) NewGeneratorClient(ctx context.Context, kube kclient.Client, corev1 typedcorev1.CoreV1Interface, vaultSpec *esv1beta1.VaultProvider, namespace string, retrySettings *esv1beta1.SecretStoreRetrySettings) (util.Client, error) {
vStore, cfg, err := p.prepareConfig(ctx, kube, corev1, vaultSpec, retrySettings, namespace, resolvers.EmptyStoreKind)
if err != nil {
return nil, err
}