Add TRACE logs when uploading to the cloud and remote backends (#36757)

Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
sams/invalid-triggered-by-ref
Rémi Lapeyre 11 months ago committed by GitHub
parent 008978d694
commit 5a8de9d70d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -258,19 +258,24 @@ in order to capture the filesystem context the remote workspace expects:
}
}
log.Printf("[TRACE] backend/remote: starting configuration upload at %q", configDir)
err = b.client.ConfigurationVersions.Upload(stopCtx, cv.UploadURL, configDir)
if err != nil {
return nil, generalError("Failed to upload configuration files", err)
}
log.Printf("[TRACE] backend/remote: finished configuration upload")
uploaded := false
for i := 0; i < 60 && !uploaded; i++ {
select {
case <-stopCtx.Done():
log.Printf("[TRACE] backend/remote: deadline reached while waiting for configuration status")
return nil, context.Canceled
case <-cancelCtx.Done():
log.Printf("[TRACE] backend/remote: operation cancelled while waiting for configuration status")
return nil, context.Canceled
case <-time.After(planConfigurationVersionsPollInterval):
log.Printf("[TRACE] backend/remote: reading configuration status")
cv, err = b.client.ConfigurationVersions.Read(stopCtx, cv.ID)
if err != nil {
return nil, generalError("Failed to retrieve configuration version", err)
@ -287,6 +292,7 @@ in order to capture the filesystem context the remote workspace expects:
"Failed to upload configuration files", errors.New("operation timed out"))
}
log.Printf("[TRACE] backend/remote: configuration uploaded and ready")
runOptions := tfe.RunCreateOptions{
ConfigurationVersion: cv,
Refresh: tfe.Bool(op.PlanRefresh),

@ -197,19 +197,24 @@ in order to capture the filesystem context the remote workspace expects:
}
}
log.Printf("[TRACE] backend/cloud: starting configuration upload at %q", configDir)
err = b.client.ConfigurationVersions.Upload(stopCtx, cv.UploadURL, configDir)
if err != nil {
return nil, b.generalError("Failed to upload configuration files", err)
}
log.Printf("[TRACE] backend/cloud: finished configuration upload")
uploaded := false
for i := 0; i < 60 && !uploaded; i++ {
select {
case <-stopCtx.Done():
log.Printf("[TRACE] backend/cloud: deadline reached while waiting for configuration status")
return nil, context.Canceled
case <-cancelCtx.Done():
log.Printf("[TRACE] backend/cloud: operation cancelled while waiting for configuration status")
return nil, context.Canceled
case <-time.After(planConfigurationVersionsPollInterval):
log.Printf("[TRACE] backend/cloud: reading configuration status")
cv, err = b.client.ConfigurationVersions.Read(stopCtx, cv.ID)
if err != nil {
return nil, b.generalError("Failed to retrieve configuration version", err)
@ -226,6 +231,7 @@ in order to capture the filesystem context the remote workspace expects:
"Failed to upload configuration files", errors.New("operation timed out"))
}
log.Printf("[TRACE] backend/cloud: configuration uploaded and ready")
runOptions := tfe.RunCreateOptions{
ConfigurationVersion: cv,
Refresh: tfe.Bool(op.PlanRefresh),

Loading…
Cancel
Save