You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the state for that state key should come from a backend,
60
+
// obtain and use that
61
+
ift.BackendFactory==nil {
62
+
returnfmt.Errorf("error retrieving state for state key %q from backend: nil BackendFactory. This is a bug in Terraform and should be reported.", key)
63
+
}
64
+
65
+
f:=t.BackendFactory(bc.Backend.Type)
66
+
iff==nil {
67
+
returnfmt.Errorf("error retrieving state for state key %q from backend: No init function found for backend type %q. This is a bug in Terraform and should be reported.", key, bc.Backend.Type)
68
+
}
69
+
be, err:=getBackendInstance(key, bc.Backend, f)
70
+
iferr!=nil {
71
+
returnerr
72
+
}
73
+
74
+
stmgr, err:=be.StateMgr(backend.DefaultStateName) // We only allow use of the default workspace
75
+
iferr!=nil {
76
+
returnfmt.Errorf("error retrieving state for state key %q from backend: error retrieving state manager: %w", key, err)
77
+
}
78
+
79
+
log.Printf("[TRACE] TestConfigTransformer.Transform: set initial state for state key %q using backend of type %T declared at %s", key, be, bc.Backend.DeclRange)
80
+
state=&TestFileState{
81
+
Run: nil,
82
+
State: stmgr.State(),
83
+
}
84
+
} else {
85
+
// Else, set an empty in-memory state for the state key
86
+
log.Printf("[TRACE] TestConfigTransformer.Transform: set initial state for state key %q as empty state", key)
0 commit comments