@highstate/k8s 0.6.2 → 0.7.1
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/assets/charts.json +8 -0
- package/dist/helm-wPTgVV1N.js +413 -0
- package/dist/index.d.ts +412 -52
- package/dist/index.js +518 -335
- package/dist/shared-Clzbl5K-.js +89 -0
- package/dist/units/cert-manager/index.js +25 -7
- package/dist/units/dns01-issuer/index.js +3 -5
- package/dist/units/existing-cluster/index.js +21 -5
- package/package.json +12 -8
- package/assets/cert-manager-v1.16.3.tgz +0 -0
- package/assets/gateway-api.yaml +0 -14974
- package/dist/shared-hajqPzR4.js +0 -64
package/dist/shared-hajqPzR4.js
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
import { readdirSync } from 'node:fs';
|
2
|
-
import { resolve } from 'node:path';
|
3
|
-
import { output, toPromise, resolvePackagePath } from '@highstate/pulumi';
|
4
|
-
import { Provider, core } from '@pulumi/kubernetes';
|
5
|
-
import { mergeDeep } from 'remeda';
|
6
|
-
|
7
|
-
function createProvider(cluster) {
|
8
|
-
const provider = output(cluster).apply((cluster2) => {
|
9
|
-
return new Provider(cluster2.name, {
|
10
|
-
kubeconfig: cluster2.kubeconfig
|
11
|
-
});
|
12
|
-
});
|
13
|
-
return toPromise(provider);
|
14
|
-
}
|
15
|
-
function createNamespace(name, provider, args = {}) {
|
16
|
-
return new core.v1.Namespace(
|
17
|
-
name,
|
18
|
-
mergeDeep(args, {
|
19
|
-
metadata: {
|
20
|
-
name
|
21
|
-
}
|
22
|
-
}),
|
23
|
-
{ provider }
|
24
|
-
);
|
25
|
-
}
|
26
|
-
const commonExtraArgs = ["name", "namespace", "metadata"];
|
27
|
-
function mapMetadata(args, fallbackName) {
|
28
|
-
return {
|
29
|
-
...args.metadata,
|
30
|
-
name: args.name ?? args.metadata?.name ?? fallbackName,
|
31
|
-
namespace: args.namespace ? mapNamespaceLikeToNamespaceName(args.namespace) : void 0
|
32
|
-
};
|
33
|
-
}
|
34
|
-
function resolveChartPath(packageName, chartName, parent) {
|
35
|
-
const resolvedChartsPath = resolvePackagePath(packageName, "assets", parent);
|
36
|
-
const files = readdirSync(resolvedChartsPath).filter((file) => file.startsWith(chartName));
|
37
|
-
if (files.length === 0) {
|
38
|
-
throw new Error(`No chart found for ${chartName}`);
|
39
|
-
}
|
40
|
-
if (files.length > 1) {
|
41
|
-
throw new Error(`Multiple charts found for ${chartName}`);
|
42
|
-
}
|
43
|
-
return resolve(resolvedChartsPath, files[0]);
|
44
|
-
}
|
45
|
-
function mapSelectorLikeToSelector(selector) {
|
46
|
-
if ("matchLabels" in selector || "matchExpressions" in selector) {
|
47
|
-
return selector;
|
48
|
-
}
|
49
|
-
return {
|
50
|
-
matchLabels: selector
|
51
|
-
};
|
52
|
-
}
|
53
|
-
function mapNamespaceLikeToNamespaceName(namespace) {
|
54
|
-
return core.v1.Namespace.isInstance(namespace) ? namespace.metadata.name : output(namespace);
|
55
|
-
}
|
56
|
-
function mapNamespaceNameToSelector(namespace) {
|
57
|
-
return {
|
58
|
-
matchLabels: {
|
59
|
-
"kubernetes.io/metadata.name": namespace
|
60
|
-
}
|
61
|
-
};
|
62
|
-
}
|
63
|
-
|
64
|
-
export { mapSelectorLikeToSelector as a, mapNamespaceNameToSelector as b, commonExtraArgs as c, mapNamespaceLikeToNamespaceName as d, createProvider as e, createNamespace as f, mapMetadata as m, resolveChartPath as r };
|