File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,11 @@ type Init struct {
73
73
PluginPath FlagStringSlice
74
74
75
75
Args []string
76
+
77
+ // The -enable-pss flag is used in control flow logic in the init command.
78
+ // TODO(SarahFrench/radeksimko): Remove this once the feature is no longer
79
+ // experimental
80
+ EnablePssExperiment bool
76
81
}
77
82
78
83
// ParseInit processes CLI arguments, returning an Init value and errors.
@@ -107,6 +112,9 @@ func ParseInit(args []string) (*Init, tfdiags.Diagnostics) {
107
112
cmdFlags .Var (& init .BackendConfig , "backend-config" , "" )
108
113
cmdFlags .Var (& init .PluginPath , "plugin-dir" , "plugin directory" )
109
114
115
+ // Used for enabling experimental code that's invoked before configuration is parsed.
116
+ cmdFlags .BoolVar (& init .EnablePssExperiment , "enable-pss" , false , "Enable the PSS experiment" )
117
+
110
118
if err := cmdFlags .Parse (args ); err != nil {
111
119
diags = diags .Append (tfdiags .Sourceless (
112
120
tfdiags .Error ,
Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ func (c *InitCommand) Run(args []string) int {
50
50
view .Diagnostics (diags )
51
51
return 1
52
52
}
53
+
54
+ // The else condition below invokes the original logic of the init command.
55
+ // An experimental version of the init code will be used if:
56
+ // > The user uses an experimental version of TF (alpha or built from source)
57
+ // > The flag -enable-pss is passed to the init command.
58
+ if c .Meta .AllowExperimentalFeatures && initArgs .EnablePssExperiment {
59
+ // TODO(SarahFrench/radeksimko): Remove forked init logic once feature is no longer experimental
60
+ panic ("pss: experimental init code hasn't been added yet" )
61
+ } else {
62
+ }
53
63
return c .run (initArgs , view )
54
64
}
55
65
You can’t perform that action at this time.
0 commit comments