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

Only apply rewrites to mirror endpoints #29

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

brandond
Copy link
Member

@brandond brandond commented Oct 1, 2024

Test confirms that the rewrites are applied when pulling from a mirror endpoint, but not when pulling from the default endpoint:

=== RUN   TestImage/Pull_busybox_without_rewrite_on_default_endpoint
time="2024-10-01T21:40:50Z" level=info msg="generated self-signed CA certificate CN=dynamiclistener-ca@1727818850,O=dynamiclistener-org: notBefore=2024-10-01 21:40:50.005892519 +0000 UTC notAfter=2034-09-29 21:40:50.005892519 +0000 UTC"
time="2024-10-01T21:40:50Z" level=info msg="certificate CN=127-0-0-1.sslip.io,O=TestImage/Pull_busybox_without_rewrite_on_default_endpoint signed by CN=dynamiclistener-ca@1727818850,O=dynamiclistener-org: notBefore=2024-10-01 21:40:50 +0000 UTC notAfter=2025-10-01 21:40:50 +0000 UTC"
    endpoint_test.go:50: INFO: TestImage/Pull_busybox_without_rewrite_on_default_endpoint registry 127-0-0-1.sslip.io at https://127-0-0-1.sslip.io, auth 127-0-0-1.sslip.io at https://127-0-0-1.sslip.io, scheme "Basic"
=== RUN   TestImage/Pull_busybox_without_rewrite_on_default_endpoint/library/busybox:latest
time="2024-10-01T21:40:50Z" level=debug msg="Trying endpoint https://127-0-0-1.sslip.io:443/v2"
time="2024-10-01T21:40:50Z" level=debug msg="Registry endpoint URL modified: https://127-0-0-1.sslip.io/v2/ => https://127-0-0-1.sslip.io:443/v2/?ns=127-0-0-1.sslip.io"
time="2024-10-01T21:40:50Z" level=debug msg="Registry endpoint URL modified: https://127-0-0-1.sslip.io/v2/bogus-image-prefix/busybox/manifests/latest => https://127-0-0-1.sslip.io:443/v2/bogus-image-prefix/busybox/manifests/latest?ns=127-0-0-1.sslip.io"
time="2024-10-01T21:40:50Z" level=warning msg="Failed to get image from endpoint: GET https://127-0-0-1.sslip.io:443/v2/bogus-image-prefix/busybox/manifests/latest?ns=REDACTED: unexpected status code 404 Not Found"
time="2024-10-01T21:40:50Z" level=debug msg="Trying endpoint https://127-0-0-1.sslip.io/v2"
    endpoint_test.go:103: OK: 127-0-0-1.sslip.io/library/busybox:latest

@brandond brandond merged commit f0590c6 into rancher:main Oct 1, 2024
1 check passed
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.

Rewrite configuration is applied to the registry fallback
2 participants