add expectnochanges to stack.refresh
This commit is contained in:
parent
09964d2031
commit
5458e2f685
|
@ -24,6 +24,13 @@ func Parallel(n int) Option {
|
|||
})
|
||||
}
|
||||
|
||||
// ExpectNoChanges will cause the preview to return an error if any changes occur
|
||||
func ExpectNoChanges() Option {
|
||||
return optionFunc(func(opts *Options) {
|
||||
opts.ExpectNoChanges = true
|
||||
})
|
||||
}
|
||||
|
||||
// Message (optional) to associate with the refresh operation
|
||||
func Message(message string) Option {
|
||||
return optionFunc(func(opts *Options) {
|
||||
|
@ -52,6 +59,8 @@ type Options struct {
|
|||
Parallel int
|
||||
// Message (optional) to associate with the refresh operation
|
||||
Message string
|
||||
// Return an error if any changes occur during this preview
|
||||
ExpectNoChanges bool
|
||||
// Specify an exclusive list of resource URNs to re
|
||||
Target []string
|
||||
}
|
||||
|
|
|
@ -320,6 +320,9 @@ func (s *Stack) Refresh(ctx context.Context, opts ...optrefresh.Option) (Refresh
|
|||
if refreshOpts.Message != "" {
|
||||
args = append(args, fmt.Sprintf("--message=%q", refreshOpts.Message))
|
||||
}
|
||||
if refreshOpts.ExpectNoChanges {
|
||||
args = append(args, "--expect-no-changes")
|
||||
}
|
||||
for _, tURN := range refreshOpts.Target {
|
||||
args = append(args, "--target %s", tURN)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue