Skip to content

Conversation

mads-hartmann
Copy link
Contributor

@mads-hartmann mads-hartmann commented May 2, 2022

Description

Jobs using with-clean-slate-deployments would fail if there was no VM for the branch. This has caused preview environment deployments to fail on main as we don't have a VM-based preview environment there yet.

This PR adds --ignore-not-found=true so that kubectl delete will succeed if the resource doesn't exist. That's the behaviour we want in this case.

Related Issue(s)

Fixes #9678

How to test

I could reproduce this by deleting the entire preview-* namespace for my branch.

kubectl delete ns preview-mads-9678-830ab3680f

And then trigger a new job

werft job run github -a with-clean-slate-deployment=true

It failed with the same error as described in the original issue, see here.

I ran a job with the code on this branch and it succeeded, see here.

I also triggered a 2nd with-clean-slate-deployment job (link) to verify it still performs the deletion when the VM does exist ☺️

Release Notes

NONE

Documentation

N/A

Copy link
Member

@meysholdt meysholdt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM. Thank you!

@roboquat roboquat merged commit 84a4ed5 into main May 2, 2022
@roboquat roboquat deleted the mads/9678-clean-slate branch May 2, 2022 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clean-slate-deployment should behave gracefully if there is nothing to clean
3 participants