File tree Expand file tree Collapse file tree 5 files changed +22
-6
lines changed Expand file tree Collapse file tree 5 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ func main() {
6363 Usage : "skip 'helm install' for all charts, assume charts have already been installed for upstream and tester clusters" ,
6464 DefaultText : "false" ,
6565 },
66+ & cli.BoolFlag {
67+ Name : subcommands .ArgSkipRefresh ,
68+ Value : false ,
69+ Usage : "skip refresh phase for tofu resources, assume resources are refreshed and up-to-date" ,
70+ DefaultText : "false" ,
71+ },
6672 },
6773 },
6874 {
Original file line number Diff line number Diff line change @@ -27,7 +27,10 @@ func Apply(cli *cli.Context) error {
2727 if err = tf .PrintVersion (); err != nil {
2828 return err
2929 }
30- if err = tf .Apply (); err != nil {
30+
31+ skipRefresh := cli .Bool (ArgSkipRefresh )
32+
33+ if err = tf .Apply (skipRefresh ); err != nil {
3134 return err
3235 }
3336
Original file line number Diff line number Diff line change @@ -53,11 +53,13 @@ func Deploy(cli *cli.Context) error {
5353 return err
5454 }
5555
56+ skipRefresh := cli .Bool (ArgSkipRefresh )
57+
5658 if ! cli .Bool (ArgSkipApply ) {
5759 if err = tf .PrintVersion (); err != nil {
5860 return err
5961 }
60- if err = tf .Apply (); err != nil {
62+ if err = tf .Apply (skipRefresh ); err != nil {
6163 return err
6264 }
6365 } else {
Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ import (
3131)
3232
3333const (
34- ArgDart = "dart"
35- ArgSkipApply = "skip-apply"
36- ArgSkipCharts = "skip-charts"
34+ ArgDart = "dart"
35+ ArgSkipApply = "skip-apply"
36+ ArgSkipCharts = "skip-charts"
37+ ArgSkipRefresh = "skip-refresh"
3738)
3839
3940type clusterAddress struct {
Original file line number Diff line number Diff line change @@ -220,14 +220,18 @@ func (t *Tofu) newWorkspace() error {
220220 return t .exec (nil , args ... )
221221}
222222
223- func (t * Tofu ) Apply () error {
223+ func (t * Tofu ) Apply (skipRefresh bool ) error {
224224 err := t .handleWorkspace ()
225225 if err != nil {
226226 return err
227227 }
228228
229229 args := t .commonArgs ("apply" )
230230
231+ if skipRefresh {
232+ args = append (args , "-refresh=false" )
233+ }
234+
231235 return t .exec (nil , args ... )
232236}
233237
You can’t perform that action at this time.
0 commit comments