Commit a22b1c4c authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason
Browse files

Merge branch 'auto-deploy-image-fix-postgres-chart' into 'master'

fix: pin postgres helm chart repository index

See merge request gitlab-org/cluster-integration/auto-deploy-image!277
parents 73432ed5 6bdb54c2
Loading
Loading
Loading
Loading
+0 −47
Original line number Diff line number Diff line
@@ -494,53 +494,6 @@ test-chart-major-version-upgrade:
    - auto-deploy deploy| tee deploy.log
    - grep -q "allowed to force deploy" deploy.log || exit 1

test-upgrade-from-helm2-fails:
  extends:
    - .rules:except-docs
  image: docker:20.10.5
  services:
    - docker:20.10.5-dind
    - name: registry.gitlab.com/gitlab-org/cluster-integration/test-utils/k3s-gitlab-ci/releases/v1.16.7-k3s1
      alias: k3s
  interruptible: true
  retry: 1
  before_script:
    - cat /etc/hosts
    - apk add curl
    # get an IP for k3s that can be accessed from within docker containers
    - K3S_IP=$(cat /etc/hosts | awk '{if ($2 == "k3s") print $1;}')
    - curl -fs k3s:8081?service="$K3S_IP" > k3s.yaml
    - export KUBECONFIG=$(pwd)/k3s.yaml
    - cat $KUBECONFIG
  script:
    # use an env-file to forward variables to the containers
    - |
      echo 'CI_APPLICATION_REPOSITORY=registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image/auto-build-image-with-psql
        CI_APPLICATION_TAG=5d248f6fa69a
        CI_ENVIRONMENT_SLUG=production
        CI_ENVIRONMENT_URL=example.com
        CI_PROJECT_PATH_SLUG=gitlab-org/cluster-integration/auto-build-image
        CI_PROJECT_ID=1
        CI_PROJECT_VISIBILITY=public
        KUBE_NAMESPACE=default
        KUBE_INGRESS_BASE_DOMAIN=example.com
        ROLLOUT_RESOURCE_TYPE=deployment
        POSTGRES_USER=user
        POSTGRES_PASSWORD=testing-password
        POSTGRES_ENABLED=true
        POSTGRES_DB=production
        HELM_HOST=localhost:44134
        KUBECONFIG=/tmp/k3s.yaml' > /tmp/env
    # helm 2 deployment should succeed
    - |
      docker run -v $KUBECONFIG:/tmp/k3s.yaml --env-file /tmp/env registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.1.0 \
        sh -c 'auto-deploy initialize_tiller && auto-deploy download_chart && auto-deploy deploy'
    # helm 3 deployment should fail because the deployment would overwrite an existing resource
    - |
      docker run -v $KUBECONFIG:/tmp/k3s.yaml  --env-file /tmp/env "$BUILD_IMAGE_NAME" \
        sh -c 'auto-deploy initialize_tiller && auto-deploy download_chart && auto-deploy deploy 2>&1 && exit 1 || exit 0' \
        | grep 'Error: rendered manifests contain a resource that already exists.'

rspec:
  extends:
    - .rules:except-docs
+2 −1
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@ function add_chart_repositories() {
  helm repo add stable https://charts.helm.sh/stable
  # bitnami repository is used for in-cluster PostgreSQL installation.
  if [[ "$POSTGRES_ENABLED" == "true" ]]; then
    helm repo add bitnami https://charts.bitnami.com/bitnami
    # See https://github.com/bitnami/charts/issues/10545
    helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
  fi
  # Additionaly, users can specify their custom chart repository.
  add_custom_chart_repository