Merge pull request #2240 from pikasTech/fix/2234-d518-secret-plane

fix: enable D518 secret-plane smoke
This commit is contained in:
Lyon
2026-06-28 14:32:40 +08:00
committed by GitHub
3 changed files with 17 additions and 9 deletions
+3 -3
View File
@@ -4,12 +4,12 @@ metadata:
id: hwlab-v03-secret-plane id: hwlab-v03-secret-plane
owner: HWLAB owner: HWLAB
spec: pikasTech/HWLAB#2234 spec: pikasTech/HWLAB#2234
boundary: D601/v0.3 only boundary: D518/v0.3 only
secretPlane: secretPlane:
enabled: true enabled: true
issue: pikasTech/HWLAB#2234 issue: pikasTech/HWLAB#2234
enabledOnNodes: enabledOnNodes:
- D601 - D518
valuesPrinted: false valuesPrinted: false
store: store:
kind: ClusterSecretStore kind: ClusterSecretStore
@@ -19,7 +19,7 @@ secretPlane:
- id: hwlab-secret-plane-smoke - id: hwlab-secret-plane-smoke
externalSecretName: hwlab-secret-plane-smoke externalSecretName: hwlab-secret-plane-smoke
targetSecretName: hwlab-secret-plane-smoke targetSecretName: hwlab-secret-plane-smoke
purpose: Low-risk D601/v0.3 smoke secret for platform-infra secret-plane integration. purpose: Low-risk D518/v0.3 smoke secret for platform-infra secret-plane integration.
data: data:
- targetKey: password - targetKey: password
remoteRef: hwlab-secret-plane/poc remoteRef: hwlab-secret-plane/poc
+1 -1
View File
@@ -5566,7 +5566,7 @@ function gitopsRootNodeId(gitopsRoot) {
function runtimeSecretPlaneManifest({ config, namespace, labels, annotations }) { function runtimeSecretPlaneManifest({ config, namespace, labels, annotations }) {
const store = config?.store; const store = config?.store;
assert.ok(store && typeof store === "object" && !Array.isArray(store), "secretPlane.store must be an object"); assert.ok(store && typeof store === "object" && !Array.isArray(store), "secretPlane.store must be an object");
assert.equal(store.kind, "ClusterSecretStore", "secretPlane.store.kind must be ClusterSecretStore for D601/v0.3"); assert.equal(store.kind, "ClusterSecretStore", "secretPlane.store.kind must be ClusterSecretStore for node-scoped v0.3");
assert.ok(typeof store.name === "string" && store.name.trim(), "secretPlane.store.name must be set"); assert.ok(typeof store.name === "string" && store.name.trim(), "secretPlane.store.name must be set");
const secrets = Array.isArray(config.secrets) ? config.secrets : []; const secrets = Array.isArray(config.secrets) ? config.secrets : [];
assert.ok(secrets.length > 0, "secretPlane.secrets must not be empty"); assert.ok(secrets.length > 0, "secretPlane.secrets must not be empty");
+13 -5
View File
@@ -549,7 +549,7 @@ test("v03 render keeps node identity as data instead of generated structure", as
"scripts/run-bun.mjs", "scripts/run-bun.mjs",
"scripts/gitops-render.mjs", "scripts/gitops-render.mjs",
"--lane", "v03", "--lane", "v03",
"--node", "D601", "--node", "D518",
"--catalog-path", staleCatalogPath, "--catalog-path", staleCatalogPath,
"--image-tag-mode", "full", "--image-tag-mode", "full",
"--source-branch", "v0.3", "--source-branch", "v0.3",
@@ -630,7 +630,7 @@ test("v03 render keeps node identity as data instead of generated structure", as
.flatMap((container) => container.env ?? []) .flatMap((container) => container.env ?? [])
.filter((entry) => entry.name === "HWLAB_CODE_AGENT_AGENTRUN_PROVIDER_ID"); .filter((entry) => entry.name === "HWLAB_CODE_AGENT_AGENTRUN_PROVIDER_ID");
assert.ok(agentRunNodeEnv.length > 0, "expected AgentRun provider id env to carry configured node id"); assert.ok(agentRunNodeEnv.length > 0, "expected AgentRun provider id env to carry configured node id");
assert.deepEqual([...new Set(agentRunNodeEnv.map((entry) => entry.value))], ["D601"]); assert.deepEqual([...new Set(agentRunNodeEnv.map((entry) => entry.value))], ["D518"]);
} finally { } finally {
await rm(outDir, { recursive: true, force: true }); await rm(outDir, { recursive: true, force: true });
@@ -638,7 +638,7 @@ test("v03 render keeps node identity as data instead of generated structure", as
} }
}); });
test("v03 render skips D601 secret-plane smoke on D518 gitops root", async () => { test("v03 render includes D518 secret-plane smoke on D518 gitops root", async () => {
const outDir = await mkdtemp(path.join(os.tmpdir(), "hwlab-v03-d518-render-test-")); const outDir = await mkdtemp(path.join(os.tmpdir(), "hwlab-v03-d518-render-test-"));
const scratchDir = path.join(".tmp", `gitops-render-v03-d518-${process.pid}-${Date.now()}`); const scratchDir = path.join(".tmp", `gitops-render-v03-d518-${process.pid}-${Date.now()}`);
const staleCatalogPath = path.join(scratchDir, "artifact-catalog.v03.json"); const staleCatalogPath = path.join(scratchDir, "artifact-catalog.v03.json");
@@ -689,9 +689,17 @@ test("v03 render skips D601 secret-plane smoke on D518 gitops root", async () =>
const generatedPaths = generatedFiles.map((filePath) => path.relative(outDir, filePath)); const generatedPaths = generatedFiles.map((filePath) => path.relative(outDir, filePath));
assert.ok(generatedPaths.includes("runtime-v03/kustomization.yaml")); assert.ok(generatedPaths.includes("runtime-v03/kustomization.yaml"));
assert.ok(generatedPaths.includes("runtime-v03/workloads.yaml")); assert.ok(generatedPaths.includes("runtime-v03/workloads.yaml"));
assert.equal(generatedPaths.includes("runtime-v03/external-secrets.yaml"), false); assert.equal(generatedPaths.includes("runtime-v03/external-secrets.yaml"), true);
const kustomization = await readFile(path.join(outDir, "runtime-v03", "kustomization.yaml"), "utf8"); const kustomization = await readFile(path.join(outDir, "runtime-v03", "kustomization.yaml"), "utf8");
assert.doesNotMatch(kustomization, /external-secrets\.yaml/u); assert.match(kustomization, /external-secrets\.yaml/u);
const externalSecretsJson = JSON.parse(await readFile(path.join(outDir, "runtime-v03", "external-secrets.yaml"), "utf8"));
const smokeExternalSecret = (externalSecretsJson.items ?? []).find((item) => item.kind === "ExternalSecret" && item.metadata?.name === "hwlab-secret-plane-smoke");
assert.ok(smokeExternalSecret, "expected D518 v03 secret-plane smoke ExternalSecret");
assert.equal(smokeExternalSecret.metadata?.namespace, "hwlab-v03");
assert.equal(smokeExternalSecret.spec?.secretStoreRef?.kind, "ClusterSecretStore");
assert.equal(smokeExternalSecret.spec?.secretStoreRef?.name, "hwlab-secret-plane-vault-cluster");
assert.equal(smokeExternalSecret.spec?.target?.name, "hwlab-secret-plane-smoke");
assert.deepEqual(smokeExternalSecret.spec?.data, [{ secretKey: "password", remoteRef: { key: "hwlab-secret-plane/poc", property: "password" } }]);
const workloadsJson = JSON.parse(await readFile(path.join(outDir, "runtime-v03", "workloads.yaml"), "utf8")); const workloadsJson = JSON.parse(await readFile(path.join(outDir, "runtime-v03", "workloads.yaml"), "utf8"));
const cloudApi = (workloadsJson.items ?? []).find((item) => item.kind === "Deployment" && item.metadata?.name === "hwlab-cloud-api"); const cloudApi = (workloadsJson.items ?? []).find((item) => item.kind === "Deployment" && item.metadata?.name === "hwlab-cloud-api");