Skip to content

Commit ea76697

Browse files
authored
prevent loading additional config for splice clusters in the internal repo and reattach resolved config targets to update-expected targets (#3373)
[static] Signed-off-by: Mateusz Błażejewski <[email protected]>
1 parent 3f4604b commit ea76697

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cluster/pulumi/common/src/config/configLoader.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0
33
import * as Yaml from 'js-yaml';
4-
import { existsSync, readFileSync } from 'fs';
4+
import { existsSync, readFileSync, realpathSync } from 'fs';
55
import { merge, mergeWith } from 'lodash';
66
import { dirname, join, resolve } from 'path';
77

@@ -129,7 +129,9 @@ export function loadClusterYamlConfig(): unknown {
129129
);
130130
// Load an additional common overrides config if it exists;
131131
// if the file is identical to the base config for some reason, loading it will not change anything.
132-
const commonOverridesConfigPath = `${spliceEnvConfig.context.clusterPath()}/../config.yaml`;
132+
// It is resolved against the cluster path with expanded symlinks to ensure that additional
133+
// overrides from the internal repository are not applied to clusters defined in splice.
134+
const commonOverridesConfigPath = `${realpathSync(spliceEnvConfig.context.clusterPath())}/../config.yaml`;
133135
const commonOverridesConfig = existsSync(commonOverridesConfigPath)
134136
? readAndParseYaml(commonOverridesConfigPath)
135137
: {};

cluster/pulumi/local.mk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ $(dir)/unit-test: $(dir)/.build
2626

2727
pulumi_projects ::= operator deployment gcp infra canton-network sv-runbook validator-runbook multi-validator cluster sv-canton validator1 splitwell
2828

29-
# TODO(#3237) Reattach resolved config targets to test and update-expected after resolving issues
30-
# with loading scratchnet configs in the internal repository.
3129
.PHONY: $(dir)/test $(dir)/update-expected
32-
$(dir)/test: $(dir)/unit-test $(foreach project,$(pulumi_projects),$(dir)/$(project)/test) # $(deployment_dir)/check-resolved-config
30+
$(dir)/test: $(dir)/unit-test $(foreach project,$(pulumi_projects),$(dir)/$(project)/test) $(deployment_dir)/check-resolved-config
3331

3432
.PHONY: $(dir)/update-expected
35-
$(dir)/update-expected: $(foreach project,$(pulumi_projects),$(dir)/$(project)/update-expected) # $(deployment_dir)/update-resolved-config
33+
$(dir)/update-expected: $(foreach project,$(pulumi_projects),$(dir)/$(project)/update-expected) $(deployment_dir)/update-resolved-config
3634

3735
include $(pulumi_projects:%=$(dir)/%/local.mk)

0 commit comments

Comments
 (0)