-
Notifications
You must be signed in to change notification settings - Fork 176
# Add E2E tests for FUNC_USERNAME/FUNC_PASSWORD credentials #3394
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
base: main
Are you sure you want to change the base?
Conversation
- Add TestCredentials_DockerPusher_EnvUsed test validating credentials for all 3 builders (host, pack, s2i) in local build+push scenarios - Enhance pkg/oci/pusher.go with credential logging for consistency with docker pusher and better debugging - Test validates env vars -> viper -> pushers flow end-to-end Fixes knative#3314
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Kunal1522 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Kunal1522. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3394 +/- ##
==========================================
- Coverage 55.73% 54.54% -1.20%
==========================================
Files 170 173 +3
Lines 19963 19701 -262
==========================================
- Hits 11127 10746 -381
- Misses 7727 7834 +107
- Partials 1109 1121 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| os.Setenv("FUNC_USERNAME", user) | ||
| os.Setenv("FUNC_PASSWORD", pass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use t.Setenv().
Summary
Add integration tests verifying
FUNC_USERNAME/FUNC_PASSWORDenvironment variables are correctly read, propagated, and logged across all builders (host, pack, s2i).Note: This test validates the credential flow (env vars → viper → pushers → logging) rather than actual registry authentication, since the test registry (localhost:50000) does not require authentication. The test ensures credentials are properly handled by the system and would be available for authenticated registries.
Changes
1. New E2E Test (
e2e/e2e_credentials_test.go)TestCredentials_DockerPusher_EnvUsed- Validates credential flow for all 3 builders (host/pack/s2i)2. OCI Pusher Enhancement (
pkg/oci/pusher.go)Added credential logging for consistency with docker pusher:
This provides:
How to Test Locally
Prerequisites
Run Tests
Verify Results
curl http://localhost:50000/v2/_catalog # Should show: {"repositories":["func/func-e2e-creds-docker-host","func/func-e2e-creds-docker-pack","func/func-e2e-creds-docker-s2i"]}What This Validates
FUNC_USERNAME/FUNC_PASSWORDenvironment variables are correctly read by viperFixes #3314