Skip to content

Commit

Permalink
Added extra debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
BSick7 committed Jan 17, 2021
1 parent 00a1500 commit 6bb1562
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/provider/data_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,14 @@ func (d *dataConnection) getStateFile(workspaceName string) (*ns.StateFile, erro
if err != nil {
return nil, fmt.Errorf(`error reading workspace (org=%s, workspace=%s): %w`, orgName, workspaceName, err)
}
log.Printf("[DEBUG] Found workspace (org=%s, workspace=%s), workspace id=%s", orgName, workspaceName, workspace.ID)

sv, err := tfeClient.StateVersions.Current(context.Background(), workspace.ID)
if err != nil {
return nil, fmt.Errorf(`error reading current state version (org=%s, workspace=%s): %w`, orgName, workspaceName, err)
}

log.Printf("[DEBUG] Downloading state file (org=%s, workspace=%s) from %s", orgName, workspaceName, sv.DownloadURL)
state, err := tfeClient.StateVersions.Download(context.Background(), sv.DownloadURL)
if err != nil {
return nil, fmt.Errorf(`error downloading state file (org=%s, workspace=%s): %w`, orgName, workspaceName, err)
Expand Down

0 comments on commit 6bb1562

Please sign in to comment.