Skip to content

Commit

Permalink
fix value field duplication issue
Browse files Browse the repository at this point in the history
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
  • Loading branch information
Skarlso committed Feb 8, 2024
1 parent c68d798 commit b062162
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions e2e/suites/provider/cases/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func genericPushSecretTemplate(f *framework.Framework) (string, func(*framework.

// create an external secret that fetches the created remote secret
// and check the value
exampleOutput := "example-output"
es := &esv1beta1.ExternalSecret{
ObjectMeta: metav1.ObjectMeta{
Name: "e2e-es",
Expand All @@ -176,11 +177,11 @@ func genericPushSecretTemplate(f *framework.Framework) (string, func(*framework.
Name: f.Namespace.Name,
},
Target: esv1beta1.ExternalSecretTarget{
Name: "example-output",
Name: exampleOutput,
},
Data: []esv1beta1.ExternalSecretData{
{
SecretKey: "example-output",
SecretKey: exampleOutput,
RemoteRef: esv1beta1.ExternalSecretDataRemoteRef{
Key: "key",
},
Expand All @@ -196,7 +197,7 @@ func genericPushSecretTemplate(f *framework.Framework) (string, func(*framework.
err = wait.PollImmediate(time.Second*5, time.Second*15, func() (bool, error) {
err := f.CRClient.Get(context.Background(), types.NamespacedName{
Namespace: f.Namespace.Name,
Name: "example-output",
Name: exampleOutput,
}, outputSecret)
if apierrors.IsNotFound(err) {
return false, nil
Expand All @@ -205,7 +206,7 @@ func genericPushSecretTemplate(f *framework.Framework) (string, func(*framework.
})
gomega.Expect(err).ToNot(gomega.HaveOccurred())

v, ok := outputSecret.Data["example-output"]
v, ok := outputSecret.Data[exampleOutput]
gomega.Expect(ok).To(gomega.BeTrue())
gomega.Expect(string(v)).To(gomega.Equal("executed: BAR"))
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/provider/testing/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package fake

import (
"context"
"fmt"

corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -82,7 +81,6 @@ func (v *Client) GetAllSecrets(ctx context.Context, ref esv1beta1.ExternalSecret
}

func (v *Client) PushSecret(_ context.Context, secret *corev1.Secret, data esv1beta1.PushSecretData) error {
fmt.Println("CALLING PUSH SECRET: ", secret.Data, data)
v.SetSecretArgs[data.GetRemoteKey()] = SetSecretCallArgs{
Value: secret.Data[data.GetSecretKey()],
RemoteRef: data,
Expand Down

0 comments on commit b062162

Please sign in to comment.