Browse Source

fix: panic on parameterstore.go (#4471)

* fix: panic on parameterstore.go

Signed-off-by: Gustavo Fernandes de Carvalho <17139678+gusfcarvalho@users.noreply.github.com>

* fixed lint error

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

---------

Signed-off-by: Gustavo Fernandes de Carvalho <17139678+gusfcarvalho@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Gustavo Fernandes de Carvalho 1 year ago
parent
commit
630b56d655
1 changed files with 3 additions and 1 deletions
  1. 3 1
      pkg/provider/aws/parameterstore/parameterstore.go

+ 3 - 1
pkg/provider/aws/parameterstore/parameterstore.go

@@ -213,7 +213,9 @@ func (pm *ParameterStore) PushSecret(ctx context.Context, secret *corev1.Secret,
 
 	if meta.Spec.Tier.Type == "Advanced" {
 		secretRequest.Tier = ptr.To(meta.Spec.Tier.Type)
-		secretRequest.Policies = ptr.To(string(meta.Spec.Tier.Policies.Raw))
+		if meta.Spec.Tier.Policies != nil {
+			secretRequest.Policies = ptr.To(string(meta.Spec.Tier.Policies.Raw))
+		}
 	}
 
 	secretValue := ssm.GetParameterInput{