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

test: add e2e for conjur csi provider #1498

Merged
merged 1 commit into from
May 24, 2024

Conversation

gl-johnson
Copy link
Contributor

@gl-johnson gl-johnson commented Apr 17, 2024

What type of PR is this?

What this PR does / why we need it:
Adds e2e test retrieving secrets via the Conjur provider

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:

TODOs:

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 17, 2024
Copy link

linux-foundation-easycla bot commented Apr 17, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: gl-johnson / name: Glen Johnson (9eedbee)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 17, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @gl-johnson!

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 @gl-johnson. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 17, 2024
@gl-johnson gl-johnson force-pushed the conjur-e2e branch 2 times, most recently from 135d1d1 to d1d197f Compare April 18, 2024 15:52
@gl-johnson gl-johnson marked this pull request as ready for review April 18, 2024 15:53
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 18, 2024
@bridgetkromhout
Copy link

/assign @aramase @nilekhc

Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

/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 May 9, 2024
@aramase
Copy link
Member

aramase commented May 9, 2024

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

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.78%. Comparing base (bf86dbf) to head (9eedbee).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1498      +/-   ##
==========================================
- Coverage   36.58%   35.78%   -0.81%     
==========================================
  Files          63       63              
  Lines        4532     3759     -773     
==========================================
- Hits         1658     1345     -313     
+ Misses       2730     2270     -460     
  Partials      144      144              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gl-johnson gl-johnson requested a review from aramase May 14, 2024 14:33
@imheresamir imheresamir mentioned this pull request May 16, 2024
3 tasks
@gl-johnson
Copy link
Contributor Author

Hi @aramase @nilekhc - any chance this can be reviewed this week? Let me know if you have any feedback/questions. Thanks!

Comment on lines 17 to 24
@test "allow conjur provider token requests and enable rotation" {
helm upgrade csi-secrets-store manifest_staging/charts/secrets-store-csi-driver --namespace=kube-system \
--set tokenRequests[0].audience="conjur" \
--set enableSecretRotation=true \
--set rotationPollInterval=30s

kubectl wait --for=condition=ready --timeout=${WAIT_TIME}s --namespace=kube-system pod -l "app=secrets-store-csi-driver"
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you add --set tokenRequests[2].audience="conjur" to

--set tokenRequests[0].audience="aud1" \
--set tokenRequests[1].audience="aud2"
instead and remove this step?

Comment on lines 31 to 32
# Create Conjur namespace
kubectl create namespace $CONJUR_NAMESPACE
Copy link
Member

Choose a reason for hiding this comment

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

You can use --create-namespace flag as part of helm install command


# Install Conjur CSI Provider
helm install conjur-csi-provider cyberark/conjur-k8s-csi-provider --wait --timeout ${WAIT_TIME}s --namespace=kube-system \
--set providerServer.image.tag=latest
Copy link
Member

Choose a reason for hiding this comment

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

latest tag in provider could break CI in the driver. Is there a pinned version you can use here?

Comment on lines 53 to 54
docker pull cyberark/conjur-cli:8
kind load docker-image cyberark/conjur-cli:8
Copy link
Member

Choose a reason for hiding this comment

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

The image is public, so I don't think this step is required.

}

@test "CSI inline volume test with pod portability" {
kubectl apply --namespace=kube-system -f $BATS_TESTS_DIR/pod-secrets-store-inline-volume-crd.yaml
Copy link
Member

Choose a reason for hiding this comment

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

Does the workload need to be in kube-system namespace? If someone looks at this file for reference, I don't want them to assume this is a requirement. Could we use any namespace other than kube-system for the workloads being deployed?

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've moved the test workloads to the default namespace

@gl-johnson
Copy link
Contributor Author

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

@gl-johnson
Copy link
Contributor Author

/retest-required

@gl-johnson gl-johnson requested a review from aramase May 23, 2024 20:59
Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

Just one minor comment!

After the update, could you squash to a single commit?

Comment on lines 23 to 24
helm install conjur cyberark/conjur-oss --namespace=$CONJUR_NAMESPACE --wait --timeout ${WAIT_TIME}s \
--create-namespace --namespace=$CONJUR_NAMESPACE \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
helm install conjur cyberark/conjur-oss --namespace=$CONJUR_NAMESPACE --wait --timeout ${WAIT_TIME}s \
--create-namespace --namespace=$CONJUR_NAMESPACE \
helm install conjur cyberark/conjur-oss --namespace=$CONJUR_NAMESPACE --wait --timeout ${WAIT_TIME}s \
--create-namespace \

--namespace flag is already defined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Woops - all should be addressed now!

@gl-johnson
Copy link
Contributor Author

/retest-required

1 similar comment
@gl-johnson
Copy link
Contributor Author

/retest-required

@aramase
Copy link
Member

aramase commented May 24, 2024

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

Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aramase, gl-johnson

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 May 24, 2024
@k8s-ci-robot k8s-ci-robot merged commit f95f32d into kubernetes-sigs:main May 24, 2024
27 checks passed
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants