Commit 4239d323 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason
Browse files

Merge branch 'bugfix/passCredentials' into 'master'

fix: pass repo credentials when pulling chart

See merge request gitlab-org/cluster-integration/auto-deploy-image!205
parents eb443bbe 08884413
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ workflow:
variables:
  DOCKER_DRIVER: overlay2

  HELM_VERSION: 3.6.1
  HELM_VERSION: 3.6.3
  KUBERNETES_VERSION: 1.17.17
  ALPINE_VERSION: '3.12'
  GLIBC_VERSION: 2.31-r0
+19 −1
Original line number Diff line number Diff line
@@ -89,6 +89,24 @@ test-download-chart-url:
    - auto-deploy download_chart
    - ./test/verify-chart-version 2

test-download-protected-chart-url:
  <<: *test-job
  script:
    # package the chart for the chart server
    - (cd assets && helm package auto-deploy-app)
    # install a helm chart server and serve the local chart
    - curl -LO https://s3.amazonaws.com/chartmuseum/release/latest/bin/linux/amd64/chartmuseum
    - chmod +x ./chartmuseum
    - ./chartmuseum --port=8080 --storage=local --storage-local-rootdir="./assets" --basic-auth-user="user" --basic-auth-pass="pass" &
    # instruct auto-deploy to use the chart server
    - export AUTO_DEVOPS_CHART_REPOSITORY_NAME=chartmuseum
    - export AUTO_DEVOPS_CHART_REPOSITORY=http://localhost:8080
    - export AUTO_DEVOPS_CHART=chartmuseum/auto-deploy-app
    - export AUTO_DEVOPS_CHART_REPOSITORY_USERNAME=user
    - export AUTO_DEVOPS_CHART_REPOSITORY_PASSWORD=pass
    - auto-deploy download_chart
    - ./test/verify-chart-version 2

test-deploy-name:
  <<: *test-job
  variables:
+6 −0
Original line number Diff line number Diff line
@@ -84,6 +84,12 @@ function add_custom_chart_repository() {
  if [[ -n "$AUTO_DEVOPS_CHART_REPOSITORY_PASSWORD" ]]; then
    helm_repo_auth+=('--password' "$AUTO_DEVOPS_CHART_REPOSITORY_PASSWORD")
  fi

  # Necessary when chart repo's index.yaml and the chart archives are in different domains
  if [[ -n "$AUTO_DEVOPS_CHART_REPOSITORY_PASS_CREDENTIALS" ]]; then
    helm_repo_auth+=('--pass-credentials')
  fi

  helm repo add \
    "${AUTO_DEVOPS_CHART_REPOSITORY_NAME}" \
    "${AUTO_DEVOPS_CHART_REPOSITORY}" \