@@ -136,7 +136,7 @@ func (s *server) Provision(stream proto.DRPCProvisioner_ProvisionStream) error {
136
136
return xerrors .Errorf ("initialize terraform: %w" , err )
137
137
}
138
138
s .logger .Debug (ctx , "ran initialization" )
139
- env , err := provisionEnv (config , request .GetPlan ().GetParameterValues (), request .GetPlan ().GetRichParameterValues (), request .GetPlan ().GetGitAuthProviders (), config .ProvisionerLogLevel )
139
+ env , err := provisionEnv (config , request .GetPlan ().GetParameterValues (), request .GetPlan ().GetRichParameterValues (), request .GetPlan ().GetGitAuthProviders (), config .ProvisionerLogLevel != "" )
140
140
if err != nil {
141
141
return err
142
142
}
@@ -205,7 +205,7 @@ func planVars(plan *proto.Provision_Plan) ([]string, error) {
205
205
return vars , nil
206
206
}
207
207
208
- func provisionEnv (config * proto.Provision_Config , params []* proto.ParameterValue , richParams []* proto.RichParameterValue , gitAuth []* proto.GitAuthProvider , logLevel string ) ([]string , error ) {
208
+ func provisionEnv (config * proto.Provision_Config , params []* proto.ParameterValue , richParams []* proto.RichParameterValue , gitAuth []* proto.GitAuthProvider , verbose bool ) ([]string , error ) {
209
209
env := safeEnviron ()
210
210
env = append (env ,
211
211
"CODER_AGENT_URL=" + config .Metadata .CoderUrl ,
@@ -237,7 +237,7 @@ func provisionEnv(config *proto.Provision_Config, params []*proto.ParameterValue
237
237
env = append (env , provider .GitAuthAccessTokenEnvironmentVariable (gitAuth .Id )+ "=" + gitAuth .AccessToken )
238
238
}
239
239
240
- if logLevel == "debug" {
240
+ if verbose {
241
241
// TF_LOG=JSON enables all kind of logging: trace-debug-info-warn-error.
242
242
// The idea behind using TF_LOG=JSON instead of TF_LOG=debug is ensuring the proper log format.
243
243
env = append (env , "TF_LOG=JSON" )
0 commit comments