alchemy-docker-k3s 0.1.3 → 0.1.4
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/index.mjs +9 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import * as Provider from "alchemy/Provider";
|
|
|
5
5
|
import * as Redacted from "effect/Redacted";
|
|
6
6
|
import { parse } from "yaml";
|
|
7
7
|
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
8
|
-
import { dirname, join
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
9
9
|
import { execFile } from "node:child_process";
|
|
10
10
|
import { promisify } from "node:util";
|
|
11
11
|
import * as Layer from "effect/Layer";
|
|
@@ -131,9 +131,16 @@ const resolveChannelVersion = async (channel, fetcher = fetch) => {
|
|
|
131
131
|
};
|
|
132
132
|
//#endregion
|
|
133
133
|
//#region ../shared/src/kubeconfig.ts
|
|
134
|
+
/**
|
|
135
|
+
* Relative to the directory Alchemy runs from. Alchemy identifies a cluster by
|
|
136
|
+
* its connection's auth, which contains this path, so an absolute path would
|
|
137
|
+
* make every checkout or workspace look like a different cluster and replace
|
|
138
|
+
* everything deployed to it. Reading the cluster rewrites the file wherever
|
|
139
|
+
* Alchemy runs.
|
|
140
|
+
*/
|
|
134
141
|
const kubeconfigPath = (provider, fqn) => {
|
|
135
142
|
const safe = fqn.replace(/[^a-zA-Z0-9_.-]+/g, "-").replace(/^-|-$/g, "");
|
|
136
|
-
return
|
|
143
|
+
return join(".alchemy", "kubeconfigs", provider, `${safe}.yaml`);
|
|
137
144
|
};
|
|
138
145
|
const writeKubeconfig = async (path, contents) => {
|
|
139
146
|
await mkdir(dirname(path), {
|