-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[kots]: delete channel on branch delete #11323
Conversation
/hold cancel The secrets have been added to GitHub Actions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, apart from that question!
/hold just on the discussion. Feel free to remove this if you don't think that's necessary. :)
fi | ||
|
||
# Allowed to fail if customers on channel - this will need to be manually deleted | ||
replicated channel rm "${CHANNEL_ID}" || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIOLI: How about we also do the check manually? Just want to be on the safer side, as its a v important operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To the best of my knowledge, there's no way of checking if a channel has customers using the CLI. Honestly, it's all a little undocumented so I've had to dig through the source code. The closest we have is channel counts
but keeps coming back with Error: This feature is not supported for Kots applications.
which makes no sense.
It is documented that you cannot delete a channel with customers and there's no option to force delete. And we wouldn't habitually use branches with the channel names stable
, beta
, unstable
, enterprise
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the elaborate answer. It makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's any issues, we can always get revert this commit (I'm going to create/delete a branch now)
/unhold |
NICE @mrsimonemms |
Description
GitHub Action to delete a KOTS channel on branch deletion. This will cut down on the amount of manual work that @gitpod-io/engineering-self-hosted have to do in housekeeping in the Replicated vendor portal.
In most cases, this will actually do nothing. Most branches do not create a channel in Replicated - the only time is if a PR is run with
/werft run publish-to-kots
when it will publish to a channel with the same name as the branch. This Action exists to delete these channels when the branch is deleted.If a channel has customers assigned to it, it will not delete the channel as the workflow is that channels must have zero customers before they can be deleted - that's a failsafe against customer channels such as
stable
orenterprise
being deleted. Also, this Action can never error as thecontinue-on-error: true
param is set./hold Before this is merged, a secret will need to be added to our GitHub settings.
How to test
I have built this using a noddy repo and done various tests to prove it works:
Release Notes
Documentation
Werft options: