Skip to content

Commit

Permalink
Fix Go automation API --target / --replace args (#8109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Dartigalongue committed Oct 4, 2021
1 parent 836b410 commit 25f396b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
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

0 comments on commit 25f396b

Please sign in to comment.