-
Notifications
You must be signed in to change notification settings - Fork 273
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
fix: incl. ingresses & services in delete command. #286
Conversation
When deleting a container service via the delete command, also delete its k8s service and ingress. This fixes problems previously caused by dangling k8s ingresses/services.
@@ -193,3 +198,28 @@ export async function applyMany( | |||
return result.output | |||
} | |||
} | |||
|
|||
const defaultObjectTypesForDelete = ["deployment", "service", "ingress"] |
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.
I think it makes sense to simply make this a required parameter and not have defaults.
}) { | ||
const api = new KubeApi(provider) | ||
export async function deleteContainerService( | ||
{ namespace, provider, serviceName, deploymentOnly, logEntry }, |
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.
Instead of this flag, I'd just implement this logic specifically in the OpenFaaS handler. And actually I'd suggest using the faas-cli command there instead (and perhaps make a quick helper for it, because of all that docker run
stuff we do there now).
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.
Yeah, makes sense.
|
||
export async function deleteObjectsByLabel( | ||
context: string, namespace: string, labelKey: string, labelValue: string, | ||
{ includeUninitialized = false, objectTypes = defaultObjectTypesForDelete }: DeleteOptions = {}, |
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.
Because we have so many parameters here now, I'd suggest putting all of them in an object. Too many positionals are just confusing to write.
When deleting a container service via the delete command, also delete
its k8s service and ingress.
This fixes problems previously caused by dangling k8s
ingresses/services.