Skip to content

Commit 2720f49

Browse files
pivotal-marcela-campodrich10
authored andcommitted
kiln test: Allow for configuration of ops-manifest dollar overrides
file. ops-manifest has an [option](https://github.com/pivotal-cf/ops-manager/blob/releases/3.0/gems/ops-manifest/exe/ops-manifest) to override the dollar overrides file. This file is used when tile configuration references $ properties (e.g $runtime) This commit just adds the possibility to configure kiln test to pass that value to ops-manager in the same way it passes tile-config and tile-manifest overrides. Co-authored-by: Marcela Campo <[email protected]>
1 parent 05449cb commit 2720f49

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

pkg/planitest/internal/ops_manifest_runner_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ var _ = Describe("OMRunner", func() {
6363

6464
When("the runner was instantiated with additional arguments", func() {
6565
const (
66-
tasMetadataPath = "/path/to/tas/metadata.yml"
67-
tasConfigPath = "/path/to/tas/config.yml"
66+
tasMetadataPath = "/path/to/tas/metadata.yml"
67+
tasConfigPath = "/path/to/tas/config.yml"
68+
dollarOverridesPath = "/path/to/dollar/overrides.yml"
6869
)
6970

7071
BeforeEach(func() {
7172
opsManifestRunner = internal.NewOpsManifestRunner(cmdRunner, internal.RealIO,
7273
"--tas-metadata-path", tasMetadataPath,
7374
"--tas-config-file", tasConfigPath,
75+
"--dollar-accessor-values-file", dollarOverridesPath,
7476
)
7577
})
7678

@@ -84,7 +86,7 @@ var _ = Describe("OMRunner", func() {
8486
Expect(cmdRunner.RunCallCount()).To(Equal(1))
8587
command, args := cmdRunner.RunArgsForCall(0)
8688
Expect(command).To(Equal("ops-manifest"))
87-
Expect(args).To(HaveLen(8))
89+
Expect(args).To(HaveLen(10))
8890
Expect(args[0]).To(ContainSubstring("--config-file"))
8991
Expect(args[1]).To(HaveSuffix(".yml"))
9092
Expect(args[2]).To(ContainSubstring("--metadata-path"))
@@ -93,6 +95,8 @@ var _ = Describe("OMRunner", func() {
9395
Expect(args[5]).To(Equal(tasMetadataPath))
9496
Expect(args[6]).To(Equal("--tas-config-file"))
9597
Expect(args[7]).To(Equal(tasConfigPath))
98+
Expect(args[8]).To(Equal("--dollar-accessor-values-file"))
99+
Expect(args[9]).To(Equal(dollarOverridesPath))
96100

97101
Expect(manifest).To(Equal(map[string]any{
98102
"name": "cf-some-guid",

pkg/planitest/product_service.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ func NewProductService(config ProductConfig) (*ProductService, error) {
5454
func opsManifestAdditionalArgs() []string {
5555
tasMetadataPath := os.Getenv("TAS_METADATA_PATH")
5656
tasConfigFile := os.Getenv("TAS_CONFIG_FILE")
57+
dollarOverridesFile := os.Getenv("DOLLAR_OVERRIDES_FILE")
58+
5759
var args []string
5860

5961
if tasMetadataPath != "" {
@@ -64,6 +66,10 @@ func opsManifestAdditionalArgs() []string {
6466
args = append(args, "--tas-config-file", tasConfigFile)
6567
}
6668

69+
if dollarOverridesFile != "" {
70+
args = append(args, "--dollar-accessor-values-file", dollarOverridesFile)
71+
}
72+
6773
return args
6874
}
6975

0 commit comments

Comments
 (0)