k8s-deploy
k8s-deploy copied to clipboard
Bug: kubectl annotate files loses annotations with private cluster
What happened?
Using k8s-deploy with a private cluster, fails to annotate (and label) deployment resource after successfully annotated namespace (see logs below, removed key-value pairs for simplicity).
Workflow step:
- uses: Azure/k8s-deploy@v4
with:
namespace: next-test
private-cluster: true
resource-group: ${{ env.RESOURCE_GROUP }}
name: ${{ env.CLUSTER_NAME }}
manifests: |
k8s/deployment.yaml
images: |
${{ env.CONTAINER_REGISTRY }}.azurecr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
Not sure if related but noticed any JSON output (docker inspect
, kubectl get namespace/next-test -o json
) shows malformed (***
instead of {
), for example (fragment):
##[debug]private cluster Kubectl run with invoke command: kubectl get namespace/next-test -o json
/usr/bin/az aks command invoke --resource-group mappdev-kaas --name mappdev-cluster --command kubectl get namespace/next-test -o json
command started at 2022-10-11 15:39:02+00:00, finished at 2022-10-11 15:39:03+00:00 with exitcode=0
***
"apiVersion": "v1",
...
Version
- [X] I am using the latest version
Runner
self-hosted Ubuntu 20.04
Relevant log output
##[debug]private cluster Kubectl run with invoke command: kubectl annotate namespace next-test actions.github.com/k8s-deploy=***"run":"496145",<other key-value pairs> --overwrite
command started at 2022-10-11 15:39:20+00:00, finished at 2022-10-11 15:39:21+00:00 with exitcode=0
namespace/next-test annotated
##[debug]private cluster Kubectl run with invoke command: kubectl annotate -f deployment.yaml --overwrite
##[debug]Successfully moved file 'deployment.yaml' from /tmp to /tmp/manifest directory
/usr/bin/az aks command invoke --resource-group mappdev-kaas --name mappdev-cluster --command kubectl annotate -f deployment.yaml --overwrite --file .
command started at 2022-10-11 15:39:37+00:00, finished at 2022-10-11 15:39:37+00:00 with exitcode=1
error: at least one annotation update is required
##[debug]private cluster Kubectl run with invoke command: kubectl describe deployment next-ui-deployment
##[debug]private cluster Kubectl run with invoke command: kubectl label -f deployment.yaml --overwrite
##[debug]Successfully moved file 'deployment.yaml' from /tmp to /tmp/manifest directory
/usr/bin/az aks command invoke --resource-group mappdev-kaas --name mappdev-cluster --command kubectl label -f deployment.yaml --overwrite --file .
command started at 2022-10-11 15:40:08+00:00, finished at 2022-10-11 15:40:08+00:00 with exitcode=1
error: at least one label update is required
Investigating this :). Thanks!
Hello! The newest 4.6 (and 4) releases should fix this. Thanks!