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

Add auth support for cgr.dev (Chainguard Images) #246

Merged
merged 1 commit into from
May 18, 2023

Conversation

tstromberg
Copy link
Contributor

Obsoletes #238

The Chainguard Images registry (cgr.dev) require a temporary token to be acquired for authentication. Without adding cgr.dev to _WWW_AUTH, the test fails with:

WARNING: Download from https://cgr.dev/v2/chainguard/static/manifests/latest failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 401 Unauthorized
ERROR: An error occurred during the fetch of repository 'chainguard_static':
   Traceback (most recent call last):
	File "/home/t/src/rules_oci/oci/private/pull.bzl", line 477, column 51, in _oci_alias_impl
		manifest, _ = downloader.download_manifest(rctx.attr.identifier, "mf.json")
	File "/home/t/src/rules_oci/oci/private/pull.bzl", line 280, column 74, in lambda
		download_manifest = lambda identifier, output: _download_manifest(rctx, state, identifier, output),
	File "/home/t/src/rules_oci/oci/private/pull.bzl", line 255, column 18, in _download_manifest
		_download(
	File "/home/t/src/rules_oci/oci/private/pull.bzl", line 223, column 23, in _download
		return download_fn(
	File "/home/t/src/rules_oci/oci/private/download.bzl", line 83, column 35, in _download
		command.extend(_auth_to_header(url, auth))
	File "/home/t/src/rules_oci/oci/private/download.bzl", line 9, column 24, in _auth_to_header
		if auth_val["type"] == "pattern":
Error: key "type" not found in dictionary

@thesayyn thesayyn merged commit 0218e55 into bazel-contrib:main May 18, 2023
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.

2 participants