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

[BUG] 403 when building dependencies in ct lint command #680

Open
fnarvaez-applydigital opened this issue Oct 4, 2024 · 0 comments
Open

Comments

@fnarvaez-applydigital
Copy link

fnarvaez-applydigital commented Oct 4, 2024

Is this a request for help?:

Yes

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT

Version of Helm and Kubernetes:
Helm version

version.BuildInfo{Version:"v3.16.1", GitCommit:"5a5449dc42be07001fd5771d56429132984ab3ab", GitTreeState:"dirty", GoVersion:"go1.23.1"}

kubectl version

Client Version: v1.30.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3

ct version

Version:	 3.11.0
Git commit:	 a2ecd82b650c223a8d264920fd0bab40de16b915
Date:		 2024-04-21
License:	 Apache 2.0

What happened:
ct lint throws a 403 even if login succeeded.

ct.yaml
remote: origin
target-branch: main
chart-dirs:
  - charts
chart-repos:
  - stable=oci://us-docker.pkg.dev
helm-extra-args: --timeout=600s --debug
helm-repo-extra-args:
  - stable=--username=oauth2accesstoken --password-stdin
validate-maintainers: false
ct logs
  gcloud auth application-default print-access-token | ct lint --config ct.yaml --debug
  Linting charts...
  >>> helm version --template {{ .Version }}
  >>> git rev-parse --is-inside-work-tree
  >>> git rev-parse --verify origin/main
  >>> git merge-base origin/main HEAD
  >>> git diff --find-renames --name-only bc9a323e403a39ffee56c660db4339d7a37efdfe -- charts
  
  ------------------------------------------------------------------------------------------------------------------------
Charts to be processed:
  ------------------------------------------------------------------------------------------------------------------------
springboot-app => (version: "0.0.1", path: "charts/springboot-app")
  ------------------------------------------------------------------------------------------------------------------------

  >>> helm registry login us-docker.pkg.dev --username=oauth2accesstoken --password-stdin
  Login Succeeded
  >>> helm dependency build charts/springboot-app
  Hang tight while we grab the latest from your chart repositories...
  ...Successfully got an update from the "mongodb" chart repository
  ...Successfully got an update from the "ingress-nginx" chart repository
  ...Successfully got an update from the "jetstack" chart repository
  Update Complete. ⎈Happy Helming!⎈
  Saving 1 charts
  Downloading ch-base from repo oci://us-docker.pkg.dev/<project-id>/<registry>
Save error occurred:  could not download oci://us-docker.pkg.dev/<project-id>/<registry>/ch-base: ...
Error: could not download oci://us-docker.pkg.dev//<project-id>/<registry>/ch-base: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://us-docker.pkg.dev/v2/./..

Also I executed manually the same command but everything goes just fine.

What you expected to happen:
Download the dependencies

How to reproduce it (as minimally and precisely as possible):

  1. have a private repository
  2. create a 2 charts, supposed you have A and B and B depends on A, and A already exists in the private registry.

to reproduce it, execute the following command gcloud auth application-default print-access-token | ct lint --config ct.yaml

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

No branches or pull requests

1 participant