Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kiln test: Allow for configuration of ops-manifest dollar overrides #496

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile-upstream:master-labs
# syntax=docker/dockerfile:1

FROM golang as go-image
FROM pivotalcfreleng/kiln:v0.77.0 as kiln
Expand Down
10 changes: 7 additions & 3 deletions pkg/planitest/internal/ops_manifest_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ var _ = Describe("OMRunner", func() {

When("the runner was instantiated with additional arguments", func() {
const (
tasMetadataPath = "/path/to/tas/metadata.yml"
tasConfigPath = "/path/to/tas/config.yml"
tasMetadataPath = "/path/to/tas/metadata.yml"
tasConfigPath = "/path/to/tas/config.yml"
dollarOverridesPath = "/path/to/dollar/overrides.yml"
)

BeforeEach(func() {
opsManifestRunner = internal.NewOpsManifestRunner(cmdRunner, internal.RealIO,
"--tas-metadata-path", tasMetadataPath,
"--tas-config-file", tasConfigPath,
"--dollar-accessor-values-file", dollarOverridesPath,
)
})

Expand All @@ -84,7 +86,7 @@ var _ = Describe("OMRunner", func() {
Expect(cmdRunner.RunCallCount()).To(Equal(1))
command, args := cmdRunner.RunArgsForCall(0)
Expect(command).To(Equal("ops-manifest"))
Expect(args).To(HaveLen(8))
Expect(args).To(HaveLen(10))
Expect(args[0]).To(ContainSubstring("--config-file"))
Expect(args[1]).To(HaveSuffix(".yml"))
Expect(args[2]).To(ContainSubstring("--metadata-path"))
Expand All @@ -93,6 +95,8 @@ var _ = Describe("OMRunner", func() {
Expect(args[5]).To(Equal(tasMetadataPath))
Expect(args[6]).To(Equal("--tas-config-file"))
Expect(args[7]).To(Equal(tasConfigPath))
Expect(args[8]).To(Equal("--dollar-accessor-values-file"))
Expect(args[9]).To(Equal(dollarOverridesPath))

Expect(manifest).To(Equal(map[string]any{
"name": "cf-some-guid",
Expand Down
6 changes: 6 additions & 0 deletions pkg/planitest/product_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func NewProductService(config ProductConfig) (*ProductService, error) {
func opsManifestAdditionalArgs() []string {
tasMetadataPath := os.Getenv("TAS_METADATA_PATH")
tasConfigFile := os.Getenv("TAS_CONFIG_FILE")
dollarOverridesFile := os.Getenv("DOLLAR_OVERRIDES_FILE")

var args []string

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

if dollarOverridesFile != "" {
args = append(args, "--dollar-accessor-values-file", dollarOverridesFile)
}

return args
}

Expand Down
Loading