k8s-deploy icon indicating copy to clipboard operation
k8s-deploy copied to clipboard

Bug: fails to deploy two manifests with the same name

Open motcke opened this issue 11 months ago • 1 comments

What happened?

I have the following:

      ...
      ...
      - name: Deploy frontend & backend
        uses: azure/k8s-deploy@v4
        with:
          namespace: default
          manifests: |
            artifacts/frontend/deployment.yaml
            artifacts/backend/deployment.yaml
      ...
      ...

Since the two manifests have the same name (deployment.yaml) it deploys the same file twice. Probably, because all files are copied to the same /tmp folder, overwrite each other, and then deployed by their name only.

There's a simple workaround to use two separate steps for that, which I did and it works fine now, But I have suffered a lot before figuring out the issue.

The workaround:

      ...
      ...
      - name: Deploy frontend
        uses: azure/k8s-deploy@v4
        with:
          namespace: default
          manifests: |
            artifacts/frontend/deployment.yaml

      - name: Deploy backend
        uses: azure/k8s-deploy@v4
        with:
          namespace: default
          manifests: |
            artifacts/backend/deployment.yaml
      ...
      ...

Version

  • [X] I am using the latest version

Runner

ubuntu-latest

Relevant log output

##[debug]Evaluating condition for step: 'Deploy frontend & backend'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Deploy frontend & backend
##[debug]Loading inputs
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run azure/k8s-deploy@v[4](https://github.com/motcke/*****#step:6:4)
  
##[debug]Input manifest files: /tmp/deployment.yaml,/tmp/deployment.yaml
::group::Deploying manifests
Deploying manifests
  ##[debug]Kubectl run with command: /usr/bin/kubectl apply,-f,/tmp/deployment.yaml,/tmp/deployment.yaml,--namespace,default
  /usr/bin/kubectl apply -f /tmp/deployment.yaml,/tmp/deployment.yaml --namespace default
  service/*****-svc unchanged
  deployment.apps/*****-deploy configured
  horizontalpodautoscaler.autoscaling/*****-scaler unchanged
  secretproviderclass.secrets-store.csi.x-k8s.io/******-sync-env-vars configured
  service/******-svc unchanged
  deployment.apps/******-deploy configured
  horizontalpodautoscaler.autoscaling/******-scaler unchanged
  secretproviderclass.secrets-store.csi.x-k8s.io/******-sync-env-vars unchanged
  ##[debug]Deployed manifest files: /tmp/deployment.yaml,/tmp/deployment.yaml
  ::endgroup::
::group::Checking manifest stability
Checking manifest stability
...
...
...

motcke avatar Mar 09 '24 22:03 motcke