diff --git a/config/unidesk-host-k8s.yaml b/config/unidesk-host-k8s.yaml index 1a4fa44b..b8d6e48d 100644 --- a/config/unidesk-host-k8s.yaml +++ b/config/unidesk-host-k8s.yaml @@ -106,6 +106,11 @@ delivery: configRef: config/hwlab-node-lanes.yaml#lanes.v03.targets.NC01 manifestPath: deploy/gitops/unidesk-host/hwlab-nc01-v03-runtime-gitops-scripts.yaml namespace: hwlab-ci + - id: hwlab-nc01-production-runtime-gitops-scripts + renderer: hwlab-runtime-gitops-scripts + configRef: config/hwlab-node-lanes.yaml#lanes.production.targets.NC01 + manifestPath: deploy/gitops/unidesk-host/hwlab-nc01-production-runtime-gitops-scripts.yaml + namespace: hwlab-ci author: name: UniDesk Host CI email: unidesk-host-ci@unidesk.local diff --git a/scripts/src/platform-infra-pipelines-as-code-source-artifact.test.ts b/scripts/src/platform-infra-pipelines-as-code-source-artifact.test.ts index 6098430e..02c910f5 100644 --- a/scripts/src/platform-infra-pipelines-as-code-source-artifact.test.ts +++ b/scripts/src/platform-infra-pipelines-as-code-source-artifact.test.ts @@ -471,15 +471,27 @@ describe("HWLAB YAML-owned Pipeline provenance", () => { manifestPath: "deploy/gitops/unidesk-host/hwlab-nc01-v03-runtime-gitops-scripts.yaml", namespace: "hwlab-ci", }); + expect(hostConfig.delivery.gitops.resources).toContainEqual({ + id: "hwlab-nc01-production-runtime-gitops-scripts", + renderer: "hwlab-runtime-gitops-scripts", + configRef: "config/hwlab-node-lanes.yaml#lanes.production.targets.NC01", + manifestPath: "deploy/gitops/unidesk-host/hwlab-nc01-production-runtime-gitops-scripts.yaml", + namespace: "hwlab-ci", + }); const gitopsResources = renderGitOpsResources(hostConfig.delivery.gitops, rootPath()); - expect(gitopsResources).toHaveLength(1); - expect(gitopsResources[0]?.path).toBe("deploy/gitops/unidesk-host/hwlab-nc01-v03-runtime-gitops-scripts.yaml"); - const gitopsConfigMap = Bun.YAML.parse(gitopsResources[0]?.content ?? "") as Record; + expect(gitopsResources).toHaveLength(2); + const v03Resource = gitopsResources.find((resource) => resource.path.endsWith("hwlab-nc01-v03-runtime-gitops-scripts.yaml")); + expect(v03Resource?.path).toBe("deploy/gitops/unidesk-host/hwlab-nc01-v03-runtime-gitops-scripts.yaml"); + const gitopsConfigMap = Bun.YAML.parse(v03Resource?.content ?? "") as Record; expect(gitopsConfigMap.metadata.name).toBe("hwlab-nc01-v03-ci-image-publish-runtime-gitops-scripts"); expect(gitopsConfigMap.metadata.namespace).toBe("hwlab-ci"); expect(gitopsConfigMap.data["runtime-gitops-postprocess.mjs"]).toContain("UNIDESK_RUNTIME_GITOPS_OVERLAY_FILE"); expect(gitopsConfigMap.data["runtime-gitops-postprocess.mjs"].indexOf("UNIDESK_RUNTIME_GITOPS_OVERLAY_FILE")) .toBeLessThan(gitopsConfigMap.data["runtime-gitops-postprocess.mjs"].indexOf("UNIDESK_RUNTIME_GITOPS_OVERLAY_B64")); + const productionResource = gitopsResources.find((resource) => resource.path.endsWith("hwlab-nc01-production-runtime-gitops-scripts.yaml")); + const productionConfigMap = Bun.YAML.parse(productionResource?.content ?? "") as Record; + expect(productionConfigMap.metadata.name).toBe("hwlab-nc01-production-ci-image-publish-runtime-gitops-scripts"); + expect(productionConfigMap.metadata.namespace).toBe("hwlab-ci"); const legacyPayload = Buffer.from(JSON.stringify({ runtimePath: overlay.runtimePath, observability: overlay.observability }), "utf8").toString("base64"); const legacyPipeline = Bun.YAML.parse(readFileSync(pipelinePath, "utf8")) as Record; const legacyStep = legacyPipeline.spec.tasks[0].taskSpec.steps[0];