Skip to content

Commit

Permalink
Remove evreything on suspend
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Aug 4, 2023
1 parent b115abc commit e27955a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kubernetes.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,18 @@ module.exports = {
stop: async (project) => {
// Stop the project, but don't remove all of its resources.
this._projects[project.id].state = 'stopping'

try {
await this._k8sNetApi.deleteNamespacedIngress(project.safeName, this._namespace)
} catch (err) {
this._app.log.error(`[k8s] Project ${project.id} - error deleting ingress: ${err.toString()}`)
}
if (project.safeName.match(/^[0-9]/)) {
await this._k8sApi.deleteNamespacedService('srv-' + project.safeName, this._namespace)
} else {
await this._k8sApi.deleteNamespacedService(project.safeName, this._namespace)
}

// For now, we just want to remove the Pod/Deployment
const currentType = await project.getSetting('k8sType')
let pod = true
Expand Down

0 comments on commit e27955a

Please sign in to comment.