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

Update and fix e2e-vault #234

Merged
merged 1 commit into from
Jun 25, 2020

Conversation

mitsutaka
Copy link
Contributor

What this PR does / why we need it:

  • Update latest tools for e2e. Install commands if it does not exist. It makes it more convenient for running locally.
  • Fix wrong usage of arithmetic binary operators usage in bats it made wrong assets.
$ result=$(kubectl exec -it nginx-secrets-store-inline cat /mnt/secrets-store/foo1)
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl kubectl exec [POD] -- [COMMAND] instead.

$ [[ "$result" -eq "hello1" ]]; echo $?
0

$ [[ "$result" -eq "hello" ]]; echo $?
0 # wrong
  • Update latest usage of kubectl exec to dismiss the deprecated warning.

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

As a long-term improvement, I'm thinking to replace bats based e2e with onsi/ginkgo to avoid using bash that is hard to notice.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 19, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @mitsutaka!

It looks like this is your first PR to kubernetes-sigs/secrets-store-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/secrets-store-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @mitsutaka. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 19, 2020
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 19, 2020
Makefile Outdated
.PHONY: e2e-bootstrap
e2e-bootstrap: install-helm
apt-get update && apt-get install bats && apt-get install gettext-base -y
# Download and install Vault
curl -LO https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip && unzip vault_${VAULT_VERSION}_linux_amd64.zip && chmod +x vault && mv vault /usr/local/bin/
command -v vault || (curl -LO https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip && unzip vault_${VAULT_VERSION}_linux_amd64.zip && chmod +x vault && mv vault /usr/local/bin/)
Copy link
Member

Choose a reason for hiding this comment

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

We should check the version here as well.

Makefile Outdated
@@ -91,8 +91,9 @@ endif
.PHONY: setup-kind
setup-kind:
# Download and install kind
curl -L https://github.com/kubernetes-sigs/kind/releases/download/v${KIND_VERSION}/kind-linux-amd64 --output kind && chmod +x kind && mv kind /usr/local/bin/
command -v kind || (curl -L https://github.com/kubernetes-sigs/kind/releases/download/v${KIND_VERSION}/kind-linux-amd64 --output kind && chmod +x kind && mv kind /usr/local/bin/)
Copy link
Member

Choose a reason for hiding this comment

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

Check the version

@ritazh
Copy link
Member

ritazh commented Jun 19, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 19, 2020
@ritazh
Copy link
Member

ritazh commented Jun 19, 2020

@mitsutaka Thank you for the PR! 🎉 Looks great!
Just left few comments. Please take a look.

mitsutaka added a commit to mitsutaka/test-infra that referenced this pull request Jun 21, 2020
In PR kubernetes-sigs/secrets-store-csi-driver#234, we are going to update kind.
Since kind is no longer supported `kind get kubeconfig-path`, kubectl
context is automatically loaded and kubeconfig will be saved at
`$HOME/.kube/config`.
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2020
* Update latest tools for e2e. Install commands if it does not exist.
* Fix wrong usage of arithmetic binary operators usage in bats it made wrong assets.
* Update latest usage of `kubectl exec`.
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2020
@aramase
Copy link
Member

aramase commented Jun 24, 2020

/retest

@aramase
Copy link
Member

aramase commented Jun 24, 2020

Going to run windows tests too for my sanity as there are changes in Makefile

/test pull-secrets-store-csi-driver-e2e-windows

@aramase
Copy link
Member

aramase commented Jun 24, 2020

Thank you for the PR, @mitsutaka!

As a long-term improvement, I'm thinking to replace bats based e2e with onsi/ginkgo to avoid using bash that is hard to notice.

This will be a great improvement. I think it'll also make it easier for contributors to add new test cases and ensure complete coverage for all features added. Would you be interested in starting a proposal on a new test framework that doesn't depend on bats? We are in the process of setting up community call for the project - https://kubernetes.slack.com/archives/C013PUP2WRK/p1592844755016800 and this will be a great topic for discussion. We can get input for all other contributors on the proposal before implementing it. Let us know how we can help.

@aramase
Copy link
Member

aramase commented Jun 24, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 24, 2020
@mitsutaka
Copy link
Contributor Author

Thanks @aramase and @ritazh for reviewing!

I’m interested in building a new test framework because I am going to use secret-store-csi in production cluster. I would like to improve reliability and stability with contributors. Candidate time is midnight in my time. I might be hard to join but I would follow your discussions if summary is posted in somewhere.

@ritazh
Copy link
Member

ritazh commented Jun 25, 2020

@mitsutaka Feel free to start a discussion either in a new GH issue or on slack or we can also review and collaborate in google docs.

@ritazh
Copy link
Member

ritazh commented Jun 25, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mitsutaka, ritazh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 25, 2020
@k8s-ci-robot k8s-ci-robot merged commit b614a71 into kubernetes-sigs:master Jun 25, 2020
@mitsutaka mitsutaka deleted the refactor-vault-e2e branch June 25, 2020 04:21
anthonyrtong pushed a commit to anthonyrtong/test-infra that referenced this pull request Jun 30, 2020
In PR kubernetes-sigs/secrets-store-csi-driver#234, we are going to update kind.
Since kind is no longer supported `kind get kubeconfig-path`, kubectl
context is automatically loaded and kubeconfig will be saved at
`$HOME/.kube/config`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants