@kwirthmagnify/kwirth-plugin-magnify 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/back.js +30 -4
- package/front.js +56 -56
- package/package.json +1 -1
package/back.js
CHANGED
|
@@ -3244,7 +3244,7 @@ var reaches = (grant, namespace) => {
|
|
|
3244
3244
|
if (!namespace) return false;
|
|
3245
3245
|
return grant.namespaces.some((pattern) => {
|
|
3246
3246
|
try {
|
|
3247
|
-
return new RegExp(
|
|
3247
|
+
return new RegExp(pattern).test(namespace);
|
|
3248
3248
|
} catch (err) {
|
|
3249
3249
|
return false;
|
|
3250
3250
|
}
|
|
@@ -4245,12 +4245,38 @@ var MagnifyChannel = class {
|
|
|
4245
4245
|
this.sendSignalMessage(webSocket, import_kwirth_common2.EInstanceMessageAction.COMMAND, import_kwirth_common2.EInstanceMessageFlow.RESPONSE, import_kwirth_common2.ESignalMessageLevel.ERROR, instance.instanceId, JSON.stringify(err.body));
|
|
4246
4246
|
}
|
|
4247
4247
|
}
|
|
4248
|
+
/*
|
|
4249
|
+
The objects to delete, and 'force' appended as the LAST parameter when the delete must not wait.
|
|
4250
|
+
|
|
4251
|
+
At the end and not at the front on purpose: a list with no flag is exactly what it always was —
|
|
4252
|
+
every entry an object— so nothing has to be sent for the normal case and an older front end goes
|
|
4253
|
+
on working unchanged. 'force' is not valid YAML for an object, so it cannot be confused with one.
|
|
4254
|
+
|
|
4255
|
+
It is Kubernetes' `--force`: a grace period of ZERO, which is the only thing that flag does. The
|
|
4256
|
+
object leaves the API immediately instead of being asked to stop first.
|
|
4257
|
+
|
|
4258
|
+
⚠️ On a Pod that means the container may still be running on its node. It is what you want when
|
|
4259
|
+
the node is unreachable and the pod will never confirm it died; it is NOT a faster delete. The
|
|
4260
|
+
dialog that offers it says so, which is why it is offered and never applied by default.
|
|
4261
|
+
*/
|
|
4248
4262
|
async executeDelete(webSocket, instance, params) {
|
|
4263
|
+
const force = params[params.length - 1] === "force";
|
|
4264
|
+
const objects = force ? params.slice(0, -1) : params;
|
|
4265
|
+
this.log.info(`DELETE of ${objects.length} object(s)${force ? " FORCED (gracePeriodSeconds=0)" : ""}`);
|
|
4249
4266
|
try {
|
|
4250
|
-
for (let obj of
|
|
4267
|
+
for (let obj of objects) {
|
|
4251
4268
|
try {
|
|
4252
|
-
|
|
4253
|
-
|
|
4269
|
+
const res = yaml.load(obj);
|
|
4270
|
+
if (!this.mayChange(webSocket, instance, res, "delete")) continue;
|
|
4271
|
+
await this.clusterInfo.objectsApi.delete(
|
|
4272
|
+
res,
|
|
4273
|
+
void 0,
|
|
4274
|
+
void 0,
|
|
4275
|
+
force ? 0 : void 0,
|
|
4276
|
+
void 0,
|
|
4277
|
+
void 0,
|
|
4278
|
+
force ? { gracePeriodSeconds: 0 } : void 0
|
|
4279
|
+
);
|
|
4254
4280
|
} catch (err) {
|
|
4255
4281
|
this.log.info(err);
|
|
4256
4282
|
this.sendSignalMessage(webSocket, import_kwirth_common2.EInstanceMessageAction.COMMAND, import_kwirth_common2.EInstanceMessageFlow.RESPONSE, import_kwirth_common2.ESignalMessageLevel.ERROR, instance.instanceId, JSON.stringify(err.body));
|