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

fix: incl. ingresses & services in delete command. #286

Merged
merged 2 commits into from
Sep 20, 2018
Merged

Conversation

thsig
Copy link
Collaborator

@thsig thsig commented Sep 19, 2018

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.

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"]
Copy link
Collaborator

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 },
Copy link
Collaborator

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).

Copy link
Collaborator Author

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 = {},
Copy link
Collaborator

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.

@edvald edvald merged commit 24ae2f3 into master Sep 20, 2018
@edvald edvald deleted the fix-delete-service branch September 20, 2018 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants