@kustodian/plugin-k0s 1.1.0 → 2.0.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/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/executor.d.ts +39 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8569 -0
- package/dist/plugin.d.ts +13 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/provider.d.ts +14 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/types.d.ts +99 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +15 -11
- package/src/config.ts +0 -84
- package/src/executor.ts +0 -170
- package/src/index.ts +0 -38
- package/src/plugin.ts +0 -82
- package/src/provider.ts +0 -182
- package/src/types.ts +0 -132
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NodeListType, NodeType, SshConfigType } from '@kustodian/nodes';
|
|
2
|
+
import { type K0sProviderOptionsType, type K0sctlConfigType, type K0sctlHostType } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Generates a k0sctl configuration from node definitions.
|
|
5
|
+
*/
|
|
6
|
+
export declare function generate_k0sctl_config(node_list: NodeListType, options?: K0sProviderOptionsType): K0sctlConfigType;
|
|
7
|
+
/**
|
|
8
|
+
* Converts a node to a k0sctl host configuration.
|
|
9
|
+
*/
|
|
10
|
+
export declare function node_to_k0sctl_host(node: NodeType, default_ssh?: SshConfigType): K0sctlHostType;
|
|
11
|
+
/**
|
|
12
|
+
* Serializes k0sctl config to YAML-compatible object.
|
|
13
|
+
* Removes undefined values for clean output.
|
|
14
|
+
*/
|
|
15
|
+
export declare function serialize_k0sctl_config(config: K0sctlConfigType): unknown;
|
|
16
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG9E,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,YAAY,EACvB,OAAO,GAAE,sBAA2B,GACnC,gBAAgB,CAmBlB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,aAAa,GAAG,cAAc,CAS/F;AA2BD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAEzE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { KustodianErrorType } from '@kustodian/core';
|
|
2
|
+
import { type ResultType } from '@kustodian/core';
|
|
3
|
+
/**
|
|
4
|
+
* Result of a command execution.
|
|
5
|
+
*/
|
|
6
|
+
export interface CommandResultType {
|
|
7
|
+
stdout: string;
|
|
8
|
+
stderr: string;
|
|
9
|
+
exit_code: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Options for command execution.
|
|
13
|
+
*/
|
|
14
|
+
export interface ExecOptionsType {
|
|
15
|
+
cwd?: string | undefined;
|
|
16
|
+
timeout?: number | undefined;
|
|
17
|
+
env?: Record<string, string> | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Executes a shell command and returns the result.
|
|
21
|
+
*/
|
|
22
|
+
export declare function exec_command(command: string, args?: string[], options?: ExecOptionsType): Promise<ResultType<CommandResultType, KustodianErrorType>>;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if k0sctl is available in the system PATH.
|
|
25
|
+
*/
|
|
26
|
+
export declare function check_k0sctl_available(): Promise<ResultType<string, KustodianErrorType>>;
|
|
27
|
+
/**
|
|
28
|
+
* Runs k0sctl apply with the given config file.
|
|
29
|
+
*/
|
|
30
|
+
export declare function k0sctl_apply(config_path: string, options?: ExecOptionsType): Promise<ResultType<CommandResultType, KustodianErrorType>>;
|
|
31
|
+
/**
|
|
32
|
+
* Runs k0sctl kubeconfig to get the cluster kubeconfig.
|
|
33
|
+
*/
|
|
34
|
+
export declare function k0sctl_kubeconfig(config_path: string, options?: ExecOptionsType): Promise<ResultType<string, KustodianErrorType>>;
|
|
35
|
+
/**
|
|
36
|
+
* Runs k0sctl reset to tear down the cluster.
|
|
37
|
+
*/
|
|
38
|
+
export declare function k0sctl_reset(config_path: string, force?: boolean, options?: ExecOptionsType): Promise<ResultType<CommandResultType, KustodianErrorType>>;
|
|
39
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAU,KAAK,UAAU,EAAoB,MAAM,iBAAiB,CAAC;AAI5E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC1C;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,CA0B5D;AAeD;;GAEG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAoB9F;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,CAY5D;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAejD;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,KAAK,UAAQ,EACb,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,CAoB5D"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { generate_k0sctl_config, node_to_k0sctl_host, serialize_k0sctl_config } from './config.js';
|
|
2
|
+
export { type CommandResultType, check_k0sctl_available, type ExecOptionsType, exec_command, k0sctl_apply, k0sctl_kubeconfig, k0sctl_reset, } from './executor.js';
|
|
3
|
+
export { create_k0s_plugin, plugin, plugin as default } from './plugin.js';
|
|
4
|
+
export { create_k0s_provider, validate_k0s_config } from './provider.js';
|
|
5
|
+
export { type K0sApiConfigType, type K0sConfigSpecType, type K0sctlConfigType, type K0sctlHostRoleType, type K0sctlHostType, type K0sctlK0sConfigType, type K0sctlMetadataType, type K0sctlSpecType, type K0sctlSshConfigType, type K0sProviderOptionsType, type K0sTelemetryConfigType, type K0sVersionType, to_k0sctl_role, to_k0sctl_ssh_config, } from './types.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEnG,OAAO,EACL,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,KAAK,eAAe,EACpB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,cAAc,EACd,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|