Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add push secret to e2e tests #3017

Merged
merged 3 commits into from Feb 12, 2024

Conversation

Skarlso
Copy link
Contributor

@Skarlso Skarlso commented Jan 11, 2024

Problem Statement

What is the problem you're trying to solve?

Related Issue

Details about the edit. The refactor now includes a different setup for tests using PushSecret. The reason why it's separate from the ExternalSecret things is because it requires different things as a source. For example, it requires a source secret to exist in Kubernetes.

The proof, however, is a bit difficult. I included a sample test case under e2e/suites/provider/cases/template/template.go. The only way to prove that PushSecret succeeded in what it wanted to push is by either checking if the Status of the push secret is a success, as in condition Ready is true, or by using ANOTHER ExternalSecret to fetch the value that the push secret created.

I'm debating baking that into the default test case, but you might not want to do that based on your scenario.

That said, if the need arises, we can always refactor it and include the ExternalSecret part into the default test case setup to make the actual test case leaner.

Proposed Changes

How do you like to solve the issue and why?

Checklist

  • I have read the contribution guidelines
  • All commits are signed with git commit --signoff
  • My changes have reasonable test coverage
  • All tests pass with make test
  • I ensured my PR is ready for review with make reviewable

@Skarlso Skarlso force-pushed the add-pushsecret-to-e2e-tests branch 3 times, most recently from 3d02034 to 0f9bfab Compare January 16, 2024 11:02
@Skarlso Skarlso force-pushed the add-pushsecret-to-e2e-tests branch 3 times, most recently from 76dbf6a to f032c5b Compare January 20, 2024 07:11
@Skarlso Skarlso force-pushed the add-pushsecret-to-e2e-tests branch 4 times, most recently from ecc561f to 7aa2f03 Compare January 30, 2024 13:08
@Skarlso Skarlso marked this pull request as ready for review January 30, 2024 13:13
@Skarlso Skarlso requested a review from a team as a code owner January 30, 2024 13:13
@Skarlso
Copy link
Contributor Author

Skarlso commented Jan 30, 2024

Go home Sonar, you're drunk.

10
New Issues
New issues introduced by your PR

@Skarlso
Copy link
Contributor Author

Skarlso commented Jan 30, 2024

Hm, I don't have a nice way of verifying the outcome 🤔

@Skarlso
Copy link
Contributor Author

Skarlso commented Jan 30, 2024

I could create the whole flow. Create an external secret that pulls the secret the push secret just created. And check the value is the templates value. Since in the e2e test I don't have direct access to the fake provider. But that's at least a nice e2e flow I guess.

@Skarlso
Copy link
Contributor Author

Skarlso commented Jan 31, 2024

It's wooorrrkiiingg!! 🎉 🎉

@Skarlso
Copy link
Contributor Author

Skarlso commented Jan 31, 2024

Ran 3 of 278 Specs in 35.139 seconds
SUCCESS! -- 3 Passed 

Copy link
Contributor

@shuheiktgw shuheiktgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one minor comment, but overall I think this looks like a good place to start with 👍

pkg/provider/testing/fake/fake.go Outdated Show resolved Hide resolved
@Skarlso Skarlso force-pushed the add-pushsecret-to-e2e-tests branch 2 times, most recently from 9683171 to b062162 Compare February 8, 2024 06:47
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Copy link

sonarcloud bot commented Feb 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.2% Duplication on New Code

See analysis details on SonarCloud

@knelasevero
Copy link
Member

awesome!

@Skarlso Skarlso merged commit e726087 into external-secrets:main Feb 12, 2024
16 checks passed
lumiere-bot bot added a commit to coolguy1771/home-ops that referenced this pull request Feb 20, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[external-secrets](https://togithub.com/external-secrets/external-secrets)
| patch | `0.9.12` -> `0.9.13` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>external-secrets/external-secrets (external-secrets)</summary>

###
[`v0.9.13`](https://togithub.com/external-secrets/external-secrets/releases/tag/v0.9.13)

[Compare
Source](https://togithub.com/external-secrets/external-secrets/compare/v0.9.12...v0.9.13)

Image: `ghcr.io/external-secrets/external-secrets:v0.9.13`
Image: `ghcr.io/external-secrets/external-secrets:v0.9.13-ubi`
Image: `ghcr.io/external-secrets/external-secrets:v0.9.13-ubi-boringssl`

#### What's Changed

- bump 0.9.12 by [@&#8203;rogertuma](https://togithub.com/rogertuma) in
[external-secrets/external-secrets#3125
- temporarily removing ossf checks for helm release by
[@&#8203;gusfcarvalho](https://togithub.com/gusfcarvalho) in
[external-secrets/external-secrets#3128
- chore(deps): bump aquasecurity/trivy-action from
[`f3d9851`](https://togithub.com/external-secrets/external-secrets/commit/f3d98514b056d8c71a3552e8328c225bc7f6f353)
to
[`84384bd`](https://togithub.com/external-secrets/external-secrets/commit/84384bd6e777ef152729993b8145ea352e9dd3ef)
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3142
- chore(deps): bump ubi8/ubi-minimal from `c9c8f91` to `6825946` by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3137
- feat: add push secret to e2e tests by
[@&#8203;Skarlso](https://togithub.com/Skarlso) in
[external-secrets/external-secrets#3017
- Implementation of Chef External Secrets Provider by
[@&#8203;sourav977](https://togithub.com/sourav977) in
[external-secrets/external-secrets#3127
- feat: add support for Pulumi ESC by
[@&#8203;dirien](https://togithub.com/dirien) in
[external-secrets/external-secrets#2997
- chore(deps): bump watchdog from 3.0.0 to 4.0.0 in /hack/api-docs by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3134
- chore(deps): bump certifi from 2023.11.17 to 2024.2.2 in
/hack/api-docs by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[external-secrets/external-secrets#3135
- chore(deps): bump mkdocs-material from 9.5.7 to 9.5.9 in
/hack/api-docs by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[external-secrets/external-secrets#3136
- chore(deps): bump golang from 1.21.6 to 1.22.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3138
- chore(deps): bump golangci/golangci-lint-action from 3.7.0 to 4.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3140
- chore(deps): bump golang from 1.21.6-bookworm to 1.22.0-bookworm in
/e2e by [@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3139
- chore(deps): bump helm/kind-action from 1.8.0 to 1.9.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3141
- chore: update dependencies by
[@&#8203;eso-service-account-app](https://togithub.com/eso-service-account-app)
in
[external-secrets/external-secrets#3143
- Start the helm workflow when files in deploy/crds change by
[@&#8203;shuheiktgw](https://togithub.com/shuheiktgw) in
[external-secrets/external-secrets#3098
- Implements Webhook Generator by
[@&#8203;gusfcarvalho](https://togithub.com/gusfcarvalho) in
[external-secrets/external-secrets#3121
- Run unit tests on the main branch by
[@&#8203;shuheiktgw](https://togithub.com/shuheiktgw) in
[external-secrets/external-secrets#3126
- fix(docs): Fix indentation in `vault-pushsecret.yaml` by
[@&#8203;mboutet](https://togithub.com/mboutet) in
[external-secrets/external-secrets#3156
- issue/3153 - added missing snapshots for Pulumi and Chef crd tests by
[@&#8203;fdberlking](https://togithub.com/fdberlking) in
[external-secrets/external-secrets#3154

#### New Contributors

- [@&#8203;sourav977](https://togithub.com/sourav977) made their first
contribution in
[external-secrets/external-secrets#3127
- [@&#8203;dirien](https://togithub.com/dirien) made their first
contribution in
[external-secrets/external-secrets#2997
- [@&#8203;mboutet](https://togithub.com/mboutet) made their first
contribution in
[external-secrets/external-secrets#3156

**Full Changelog**:
external-secrets/external-secrets@v0.9.12...v0.9.13

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOTQuMSIsInVwZGF0ZWRJblZlciI6IjM3LjE5NC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
lumiere-bot bot added a commit to coolguy1771/home-ops that referenced this pull request Feb 20, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[external-secrets](https://togithub.com/external-secrets/external-secrets)
| patch | `0.9.12` -> `0.9.13` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>external-secrets/external-secrets (external-secrets)</summary>

###
[`v0.9.13`](https://togithub.com/external-secrets/external-secrets/releases/tag/v0.9.13)

[Compare
Source](https://togithub.com/external-secrets/external-secrets/compare/v0.9.12...v0.9.13)

Image: `ghcr.io/external-secrets/external-secrets:v0.9.13`
Image: `ghcr.io/external-secrets/external-secrets:v0.9.13-ubi`
Image: `ghcr.io/external-secrets/external-secrets:v0.9.13-ubi-boringssl`

#### What's Changed

- bump 0.9.12 by [@&#8203;rogertuma](https://togithub.com/rogertuma) in
[external-secrets/external-secrets#3125
- temporarily removing ossf checks for helm release by
[@&#8203;gusfcarvalho](https://togithub.com/gusfcarvalho) in
[external-secrets/external-secrets#3128
- chore(deps): bump aquasecurity/trivy-action from
[`f3d9851`](https://togithub.com/external-secrets/external-secrets/commit/f3d98514b056d8c71a3552e8328c225bc7f6f353)
to
[`84384bd`](https://togithub.com/external-secrets/external-secrets/commit/84384bd6e777ef152729993b8145ea352e9dd3ef)
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3142
- chore(deps): bump ubi8/ubi-minimal from `c9c8f91` to `6825946` by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3137
- feat: add push secret to e2e tests by
[@&#8203;Skarlso](https://togithub.com/Skarlso) in
[external-secrets/external-secrets#3017
- Implementation of Chef External Secrets Provider by
[@&#8203;sourav977](https://togithub.com/sourav977) in
[external-secrets/external-secrets#3127
- feat: add support for Pulumi ESC by
[@&#8203;dirien](https://togithub.com/dirien) in
[external-secrets/external-secrets#2997
- chore(deps): bump watchdog from 3.0.0 to 4.0.0 in /hack/api-docs by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3134
- chore(deps): bump certifi from 2023.11.17 to 2024.2.2 in
/hack/api-docs by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[external-secrets/external-secrets#3135
- chore(deps): bump mkdocs-material from 9.5.7 to 9.5.9 in
/hack/api-docs by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[external-secrets/external-secrets#3136
- chore(deps): bump golang from 1.21.6 to 1.22.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3138
- chore(deps): bump golangci/golangci-lint-action from 3.7.0 to 4.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3140
- chore(deps): bump golang from 1.21.6-bookworm to 1.22.0-bookworm in
/e2e by [@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3139
- chore(deps): bump helm/kind-action from 1.8.0 to 1.9.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3141
- chore: update dependencies by
[@&#8203;eso-service-account-app](https://togithub.com/eso-service-account-app)
in
[external-secrets/external-secrets#3143
- Start the helm workflow when files in deploy/crds change by
[@&#8203;shuheiktgw](https://togithub.com/shuheiktgw) in
[external-secrets/external-secrets#3098
- Implements Webhook Generator by
[@&#8203;gusfcarvalho](https://togithub.com/gusfcarvalho) in
[external-secrets/external-secrets#3121
- Run unit tests on the main branch by
[@&#8203;shuheiktgw](https://togithub.com/shuheiktgw) in
[external-secrets/external-secrets#3126
- fix(docs): Fix indentation in `vault-pushsecret.yaml` by
[@&#8203;mboutet](https://togithub.com/mboutet) in
[external-secrets/external-secrets#3156
- issue/3153 - added missing snapshots for Pulumi and Chef crd tests by
[@&#8203;fdberlking](https://togithub.com/fdberlking) in
[external-secrets/external-secrets#3154

#### New Contributors

- [@&#8203;sourav977](https://togithub.com/sourav977) made their first
contribution in
[external-secrets/external-secrets#3127
- [@&#8203;dirien](https://togithub.com/dirien) made their first
contribution in
[external-secrets/external-secrets#2997
- [@&#8203;mboutet](https://togithub.com/mboutet) made their first
contribution in
[external-secrets/external-secrets#3156

**Full Changelog**:
external-secrets/external-secrets@v0.9.12...v0.9.13

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOTQuMSIsInVwZGF0ZWRJblZlciI6IjM3LjE5NC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
kireque pushed a commit to kireque/home-ops that referenced this pull request Feb 22, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[external-secrets](https://togithub.com/external-secrets/external-secrets)
| patch | `0.9.12` -> `0.9.13` |

---

### Release Notes

<details>
<summary>external-secrets/external-secrets (external-secrets)</summary>

###
[`v0.9.13`](https://togithub.com/external-secrets/external-secrets/releases/tag/v0.9.13)

[Compare
Source](https://togithub.com/external-secrets/external-secrets/compare/v0.9.12...v0.9.13)

Image: `ghcr.io/external-secrets/external-secrets:v0.9.13`
Image: `ghcr.io/external-secrets/external-secrets:v0.9.13-ubi`
Image: `ghcr.io/external-secrets/external-secrets:v0.9.13-ubi-boringssl`

#### What's Changed

- bump 0.9.12 by [@&#8203;rogertuma](https://togithub.com/rogertuma) in
[external-secrets/external-secrets#3125
- temporarily removing ossf checks for helm release by
[@&#8203;gusfcarvalho](https://togithub.com/gusfcarvalho) in
[external-secrets/external-secrets#3128
- chore(deps): bump aquasecurity/trivy-action from
[`f3d9851`](https://togithub.com/external-secrets/external-secrets/commit/f3d98514b056d8c71a3552e8328c225bc7f6f353)
to
[`84384bd`](https://togithub.com/external-secrets/external-secrets/commit/84384bd6e777ef152729993b8145ea352e9dd3ef)
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3142
- chore(deps): bump ubi8/ubi-minimal from `c9c8f91` to `6825946` by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3137
- feat: add push secret to e2e tests by
[@&#8203;Skarlso](https://togithub.com/Skarlso) in
[external-secrets/external-secrets#3017
- Implementation of Chef External Secrets Provider by
[@&#8203;sourav977](https://togithub.com/sourav977) in
[external-secrets/external-secrets#3127
- feat: add support for Pulumi ESC by
[@&#8203;dirien](https://togithub.com/dirien) in
[external-secrets/external-secrets#2997
- chore(deps): bump watchdog from 3.0.0 to 4.0.0 in /hack/api-docs by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3134
- chore(deps): bump certifi from 2023.11.17 to 2024.2.2 in
/hack/api-docs by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[external-secrets/external-secrets#3135
- chore(deps): bump mkdocs-material from 9.5.7 to 9.5.9 in
/hack/api-docs by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[external-secrets/external-secrets#3136
- chore(deps): bump golang from 1.21.6 to 1.22.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3138
- chore(deps): bump golangci/golangci-lint-action from 3.7.0 to 4.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3140
- chore(deps): bump golang from 1.21.6-bookworm to 1.22.0-bookworm in
/e2e by [@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3139
- chore(deps): bump helm/kind-action from 1.8.0 to 1.9.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[external-secrets/external-secrets#3141
- chore: update dependencies by
[@&#8203;eso-service-account-app](https://togithub.com/eso-service-account-app)
in
[external-secrets/external-secrets#3143
- Start the helm workflow when files in deploy/crds change by
[@&#8203;shuheiktgw](https://togithub.com/shuheiktgw) in
[external-secrets/external-secrets#3098
- Implements Webhook Generator by
[@&#8203;gusfcarvalho](https://togithub.com/gusfcarvalho) in
[external-secrets/external-secrets#3121
- Run unit tests on the main branch by
[@&#8203;shuheiktgw](https://togithub.com/shuheiktgw) in
[external-secrets/external-secrets#3126
- fix(docs): Fix indentation in `vault-pushsecret.yaml` by
[@&#8203;mboutet](https://togithub.com/mboutet) in
[external-secrets/external-secrets#3156
- issue/3153 - added missing snapshots for Pulumi and Chef crd tests by
[@&#8203;fdberlking](https://togithub.com/fdberlking) in
[external-secrets/external-secrets#3154

#### New Contributors

- [@&#8203;sourav977](https://togithub.com/sourav977) made their first
contribution in
[external-secrets/external-secrets#3127
- [@&#8203;dirien](https://togithub.com/dirien) made their first
contribution in
[external-secrets/external-secrets#2997
- [@&#8203;mboutet](https://togithub.com/mboutet) made their first
contribution in
[external-secrets/external-secrets#3156

**Full Changelog**:
external-secrets/external-secrets@v0.9.12...v0.9.13

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOTQuMSIsInVwZGF0ZWRJblZlciI6IjM3LjE5NC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: kireque-bot[bot] <143391978+kireque-bot[bot]@users.noreply.github.com>
v-starodubov pushed a commit to v-starodubov/external-secrets that referenced this pull request Mar 6, 2024
* feat: add push secret to e2e tests

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

* finally, a fully working example for an e2e flow with push secret

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

* fix value field duplication issue

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

---------

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants