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

keyvault: update keyvault to use release/v1 secret protocol #41

Merged
merged 6 commits into from
May 23, 2022

Conversation

VinozzZ
Copy link
Contributor

@VinozzZ VinozzZ commented May 3, 2022

This PR does three things:

  • updates keyvault plugin to use the latest secret plugin protocol from porter.
  • updates magefile to reference the new getporter.sh/magefile repo
  • removes storage plugins, blob and table stores, from this repo

This PR closes #40

@VinozzZ VinozzZ force-pushed the secret-protocol-update branch 2 times, most recently from 3ee2101 to b9bfd63 Compare May 4, 2022 21:27
Signed-off-by: Yingrong Zhao <[email protected]>
@VinozzZ VinozzZ force-pushed the secret-protocol-update branch from b9bfd63 to d51705a Compare May 4, 2022 21:29
@VinozzZ VinozzZ marked this pull request as ready for review May 4, 2022 21:58
@VinozzZ VinozzZ force-pushed the secret-protocol-update branch 7 times, most recently from 8443f34 to 4e59112 Compare May 6, 2022 17:50
@carolynvs
Copy link
Member

@VinozzZ Would you please fill out the PR with a description of the change and link to the relevant issue?

Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

One way to get some tests, even if they aren't part of CI would be to have a bash script that you could execute before checking in that would validate a few scenarios, and use the az cli to check that the values were persisted properly.

go.mod Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
magefile.go Show resolved Hide resolved
magefile.go Show resolved Hide resolved
pkg/azure/keyvault/store.go Outdated Show resolved Hide resolved
pkg/azure/keyvault/store.go Outdated Show resolved Hide resolved
pkg/azure/keyvault/store.go Outdated Show resolved Hide resolved
pkg/azure/keyvault/store.go Outdated Show resolved Hide resolved
pkg/azure/keyvault/store.go Outdated Show resolved Hide resolved
Signed-off-by: Yingrong Zhao <[email protected]>
@VinozzZ VinozzZ force-pushed the secret-protocol-update branch from 4e59112 to 581d1f1 Compare May 9, 2022 19:58
Signed-off-by: Yingrong Zhao <[email protected]>
Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

Can you update the readme to make it clear that the vault in the secrets config is also written to by porter?

pkg/azure/keyvault/store.go Outdated Show resolved Hide resolved
pkg/azure/keyvault/store.go Outdated Show resolved Hide resolved
tests/integration/script.sh Show resolved Hide resolved

PORTER_HOME=${TMP}/bin/
git fetch --no-tags --progress -- https://github.com/getporter/porter.git +refs/heads/release/v1:refs/remotes/origin/release/v1
git worktree add -f "$PORTER_HOME" "release/v1"
Copy link
Member

Choose a reason for hiding this comment

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

I received the following error when I ran the script:

$ ./tests/integration/script.sh carolynvs
remote: Enumerating objects: 28196, done.
remote: Counting objects: 100% (833/833), done.
remote: Compressing objects: 100% (612/612), done.
remote: Total 28196 (delta 375), reused 476 (delta 209), pack-reused 27363
Receiving objects: 100% (28196/28196), 34.61 MiB | 60.68 MiB/s, done.
Resolving deltas: 100% (16262/16262), done.
From https://github.com/getporter/porter
 * [new branch]        release/v1 -> origin/release/v1
fatal: invalid reference: release/v1
EXIT STATUS: 128
cleaned up test successfully

Instead of implementing here in a script installing porter, you can use the https://github.com/getporter/magefiles target porter.EnsurePorter. How about you add a target called TestIntegration and have it depend on EnsurePorter. Then it can call the bash script here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my understanding, the EnsurePorter only works for published release versions? In this case, the test would fail since the new secret protocol is not in a release yet.
What's your git version?

Copy link
Member

Choose a reason for hiding this comment

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

I'm on 2.32

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the reference to use the remote branch. Let me know if it still causes trouble for u

Copy link
Member

Choose a reason for hiding this comment

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

The script is expecting me to set PORTER_HOME and when I set that to $PWD/bin it complains that it's not a working tree. Is this supposed to be the path to the porter repository or something that is set internally in the script and not by me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's odd. What error do you get that prompt you to set PORTER_HOME manually? It should do that automatically by the script

Copy link
Member

@carolynvs carolynvs May 23, 2022

Choose a reason for hiding this comment

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

I finally got it to work by setting export PORTER_HOME='. Maybe just remove the set -u flag, or move up the declaration of PORTER_HOME above cleanup?

tests/integration/testdata/config-test.yaml Outdated Show resolved Hide resolved
Signed-off-by: Yingrong Zhao <[email protected]>
@VinozzZ VinozzZ force-pushed the secret-protocol-update branch from fb2ffad to 6690f31 Compare May 19, 2022 23:00
Signed-off-by: Yingrong Zhao <[email protected]>
Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

Thanks for updating the plugin to work with the new changes!

@carolynvs carolynvs merged commit de75132 into getporter:main May 23, 2022
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.

Update azure plugin with latest plugin changes
2 participants