Closed motcke closed 1 month ago
In my case it detects multiple manifests, but duplicates first one.
Run ls -l manifests
total 8
drwxr-xr-x 2 runner docker [4]096 Jun 18 22:19 manifests-front
drwxr-xr-x 2 runner docker 4096 Jun 18 22:19 manifests-imgproxy
In both (or more) directories there are deployment.yml
service.yml
and ingress.yml
And then I'm applying them:
-
name: Deploy manifests to cluster
uses: azure/k8s-deploy@v5
with:
manifests: |
manifests
imagepullsecrets: ghcr
But for some reason instead using all files for kubectl apply
, it is duplicating paths always from first one. So also If will try to deploy manifests for 3 services (x, y, z), it will try to deploy "x" three times instead. That has to be a bug.
/usr/bin/kubectl apply -f /tmp/Deployment_imgproxy_1718749155628, /tmp/Ingress_imgproxy_1718749155628, /tmp/Service_imgproxy_1718749155628, /tmp/Deployment_imgproxy_1718749155628, // it should be "front" /tmp/Ingress_imgproxy_1718749155628, // it should be "front" /tmp/Service_imgproxy_1718749155628 // it should be "front" --namespace default
Checking manifest stability /usr/bin/kubectl rollout status Deployment/imgproxy --namespace default deployment "imgproxy" successfully rolled out /usr/bin/kubectl rollout status Deployment/imgproxy --namespace default deployment "imgproxy" successfully rolled out
@motcke you said that issue is maybe due to fact that all directories are merged into /tmp
. It is true, but in theory it should be handled ok. In logs we can see that this action is generating unique names based on original subdirectory and timestamp, so there should be no problem with conflicts.
Edit: @motcke was right - file name is indeed not unique in tmp https://github.com/Azure/k8s-deploy/blob/main/src/utilities/manifestUpdateUtils.ts#L95
looking into this!
What happened?
I have the following:
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:
Version
Runner
ubuntu-latest
Relevant log output