actions icon indicating copy to clipboard operation
actions copied to clipboard

converge use kubeconfig from previous invocation

Open diafour opened this issue 4 years ago • 0 comments

Overview

I've got these steps:

      - name: Deploy to stage
        uses: werf/actions/[email protected]
        with:
          kube-config-base64-data: "${{ secrets.KUBECONFIG_FOR_STAGE }}"
        env:
          WERF_NAMESPACE: web-stage

      - name: Deploy to production
        uses: werf/actions/[email protected]
        with:
          kube-config-base64-data: "${{ secrets.KUBECONFIG_FOR_PROD }}"
        env:
          WERF_NAMESPACE: web-production

Non-relevant envs and options are omitted.

Expected behavior

'Deploy to production' step should fail if KUBECONFIG_FOR_PROD secret is not set for the repository.

Actual behavior

'Deploy to production' step uses secrets.KUBECONFIG_FOR_STAGE if KUBECONFIG_FOR_PROD is not set. web-production namespace is created in the stage cluster.

Possible ways to fix

  • Additional option kube-context to use specified context from kube-config.
  • Add cleanup to remove created kube-config at workflow finish.

diafour avatar Dec 01 '21 06:12 diafour