1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

delete force terminating namespace (#7081)

This commit is contained in:
Prabhat Khera 2022-06-28 16:35:30 +12:00 committed by GitHub
parent 75fef397d3
commit e5e57978af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 79 additions and 9 deletions

View file

@ -17,6 +17,8 @@ class KubernetesNamespaceService {
this.getAllAsync = this.getAllAsync.bind(this);
this.createAsync = this.createAsync.bind(this);
this.deleteAsync = this.deleteAsync.bind(this);
this.getJSONAsync = this.getJSONAsync.bind(this);
this.updateFinalizeAsync = this.updateFinalizeAsync.bind(this);
}
/**
@ -36,6 +38,31 @@ class KubernetesNamespaceService {
}
}
/**
* GET namesspace in JSON format
*/
async getJSONAsync(name) {
try {
const params = new KubernetesCommonParams();
params.id = name;
await this.KubernetesNamespaces().status(params).$promise;
return await this.KubernetesNamespaces().getJSON(params).$promise;
} catch (err) {
throw new PortainerError('Unable to retrieve namespace', err);
}
}
/**
* Update finalize
*/
async updateFinalizeAsync(namespace) {
try {
return await this.KubernetesNamespaces().update({ id: namespace.metadata.name, action: 'finalize' }, namespace).$promise;
} catch (err) {
throw new PortainerError('Unable to update namespace', err);
}
}
async getAllAsync() {
try {
const data = await this.KubernetesNamespaces().get().$promise;