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

Fix Go automation API --target / --replace args #8109

Merged
merged 2 commits into from Oct 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG_PENDING.md
Expand Up @@ -11,3 +11,6 @@

- [codegen/go] - Fix generation of cyclic struct types.
[#8049](https://github.com/pulumi/pulumi/pull/8049)

- [sdk/go] - Fix --target / --replace args
[#8109](https://github.com/pulumi/pulumi/pull/8109)
12 changes: 6 additions & 6 deletions sdk/go/auto/stack.go
Expand Up @@ -227,10 +227,10 @@ func (s *Stack) Preview(ctx context.Context, opts ...optpreview.Option) (Preview
sharedArgs = append(sharedArgs, "--diff")
}
for _, rURN := range preOpts.Replace {
sharedArgs = append(sharedArgs, fmt.Sprintf("--replace %s", rURN))
sharedArgs = append(sharedArgs, fmt.Sprintf("--replace=%s", rURN))
}
for _, tURN := range preOpts.Target {
sharedArgs = append(sharedArgs, fmt.Sprintf("--target %s", tURN))
sharedArgs = append(sharedArgs, fmt.Sprintf("--target=%s", tURN))
}
if preOpts.TargetDependents {
sharedArgs = append(sharedArgs, "--target-dependents")
Expand Down Expand Up @@ -322,10 +322,10 @@ func (s *Stack) Up(ctx context.Context, opts ...optup.Option) (UpResult, error)
sharedArgs = append(sharedArgs, "--diff")
}
for _, rURN := range upOpts.Replace {
sharedArgs = append(sharedArgs, fmt.Sprintf("--replace %s", rURN))
sharedArgs = append(sharedArgs, fmt.Sprintf("--replace=%s", rURN))
}
for _, tURN := range upOpts.Target {
sharedArgs = append(sharedArgs, fmt.Sprintf("--target %s", tURN))
sharedArgs = append(sharedArgs, fmt.Sprintf("--target=%s", tURN))
}
if upOpts.TargetDependents {
sharedArgs = append(sharedArgs, "--target-dependents")
Expand Down Expand Up @@ -409,7 +409,7 @@ func (s *Stack) Refresh(ctx context.Context, opts ...optrefresh.Option) (Refresh
args = append(args, "--expect-no-changes")
}
for _, tURN := range refreshOpts.Target {
args = append(args, fmt.Sprintf("--target %s", tURN))
args = append(args, fmt.Sprintf("--target=%s", tURN))
}
if refreshOpts.Parallel > 0 {
args = append(args, fmt.Sprintf("--parallel=%d", refreshOpts.Parallel))
Expand Down Expand Up @@ -474,7 +474,7 @@ func (s *Stack) Destroy(ctx context.Context, opts ...optdestroy.Option) (Destroy
args = append(args, fmt.Sprintf("--message=%q", destroyOpts.Message))
}
for _, tURN := range destroyOpts.Target {
args = append(args, fmt.Sprintf("--target %s", tURN))
args = append(args, fmt.Sprintf("--target=%s", tURN))
}
if destroyOpts.TargetDependents {
args = append(args, "--target-dependents")
Expand Down