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

This commit is contained in:
Jeremy Dartigalongue 2021-10-04 14:55:23 -04:00 committed by GitHub
parent 836b410911
commit 25f396bf49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View file

@ -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)

View file

@ -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")
@ -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")
@ -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))
@ -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")