Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Canary deployment the promote action doesn't fail even when kubectl apply return error #305

Open
1 task done
cha7ri opened this issue Nov 30, 2023 · 2 comments
Open
1 task done
Labels
bug Something isn't working idle Inactive for 14 days

Comments

@cha7ri
Copy link

cha7ri commented Nov 30, 2023

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

  • I am using the latest 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
@cha7ri cha7ri added the bug Something isn't working label Nov 30, 2023
Copy link

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle Inactive for 14 days label Dec 14, 2023
@cha7ri
Copy link
Author

cha7ri commented Feb 26, 2024

Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working idle Inactive for 14 days
Projects
None yet
Development

No branches or pull requests

1 participant