What happened?
I changed an immutable field in the deployment matchLabels , when deploying it using canary, the promote action should fail because it can't apply the new deployment manifest, but it didn't.
I can see the kubectl error in the logs
The Deployment "forked-myapp-dev" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"forked-myapp-dev", "app.kubernetes.io/name":"myapp-tmp"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
I think the issue from the code is the exit code is not handled here
|
promoteResult = await PodCanaryHelper.deployPodCanary( |
I think the issue can be fixed by adding checkForErros like here https://github.com/Azure/k8s-deploy/blob/93550c22f0e0656c2a6b0cf5252a94cc3e2710fc/src/strategyHelpers/deploymentHelper.ts#L58C10-L58C24
Expected behaviour
The pipeline should fail if it can't apply the manifest
Version
Runner
self-hosted
Relevant log output
The Deployment "forked-myapp-dev" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"forked-myapp-dev", "app.kubernetes.io/name":"myapp-tmp"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
What happened?
I changed an immutable field in the deployment
matchLabels, when deploying it using canary, the promote action should fail because it can't apply the new deployment manifest, but it didn't.I can see the kubectl error in the logs
I think the issue from the code is the exit code is not handled here
k8s-deploy/src/actions/promote.ts
Line 107 in 93550c2
I think the issue can be fixed by adding checkForErros like here https://github.com/Azure/k8s-deploy/blob/93550c22f0e0656c2a6b0cf5252a94cc3e2710fc/src/strategyHelpers/deploymentHelper.ts#L58C10-L58C24
Expected behaviour
The pipeline should fail if it can't apply the manifest
Version
Runner
self-hosted
Relevant log output