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:
parent
75fef397d3
commit
e5e57978af
5 changed files with 79 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue