@appthrust/kest 0.14.0 → 0.15.0
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/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { generateName } from "../naming";
|
|
2
|
-
import { create } from "./create";
|
|
3
2
|
import type { MutateDef } from "./types";
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -22,14 +21,20 @@ export const createNamespace = {
|
|
|
22
21
|
({ kubectl }) =>
|
|
23
22
|
async (input) => {
|
|
24
23
|
const name = resolveNamespaceName(input);
|
|
25
|
-
|
|
24
|
+
await kubectl.create({
|
|
26
25
|
apiVersion: "v1",
|
|
27
26
|
kind: "Namespace",
|
|
28
|
-
metadata: {
|
|
29
|
-
name,
|
|
30
|
-
},
|
|
27
|
+
metadata: { name },
|
|
31
28
|
});
|
|
32
|
-
return {
|
|
29
|
+
return {
|
|
30
|
+
async revert() {
|
|
31
|
+
await kubectl.delete("Namespace", name, {
|
|
32
|
+
ignoreNotFound: true,
|
|
33
|
+
wait: false,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
output: name,
|
|
37
|
+
};
|
|
33
38
|
},
|
|
34
39
|
describe: (input) => {
|
|
35
40
|
if (input === undefined) {
|
package/ts/kubectl/index.ts
CHANGED
|
@@ -163,6 +163,8 @@ export interface KubectlDeleteOptions {
|
|
|
163
163
|
* that does not exist succeeds silently instead of failing.
|
|
164
164
|
*/
|
|
165
165
|
readonly ignoreNotFound?: undefined | boolean;
|
|
166
|
+
/** When false, adds --wait=false so delete returns immediately. */
|
|
167
|
+
readonly wait?: undefined | boolean;
|
|
166
168
|
readonly context?: undefined | KubectlContext;
|
|
167
169
|
}
|
|
168
170
|
|
|
@@ -304,6 +306,9 @@ export class RealKubectl implements Kubectl {
|
|
|
304
306
|
if (options?.ignoreNotFound) {
|
|
305
307
|
args.push("--ignore-not-found");
|
|
306
308
|
}
|
|
309
|
+
if (options?.wait === false) {
|
|
310
|
+
args.push("--wait=false");
|
|
311
|
+
}
|
|
307
312
|
return await this.runKubectl({
|
|
308
313
|
args,
|
|
309
314
|
stdoutLanguage: "text",
|