Merge pull request #25297 from hashicorp/jbardin/terraform-remote-state
don't set remote workspace in state
This commit is contained in:
commit
ff91a2257b
|
@ -104,8 +104,6 @@ func dataSourceRemoteStateRead(d cty.Value) (cty.Value, tfdiags.Diagnostics) {
|
|||
workspaceName = workspaceVal.AsString()
|
||||
}
|
||||
|
||||
newState["workspace"] = cty.StringVal(workspaceName)
|
||||
|
||||
state, err := b.StateMgr(workspaceName)
|
||||
if err != nil {
|
||||
diags = diags.Append(tfdiags.AttributeValue(
|
||||
|
|
|
@ -40,7 +40,27 @@ func TestState_basic(t *testing.T) {
|
|||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||
"foo": cty.StringVal("bar"),
|
||||
}),
|
||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||
}),
|
||||
false,
|
||||
},
|
||||
"workspace": {
|
||||
cty.ObjectVal(map[string]cty.Value{
|
||||
"backend": cty.StringVal("local"),
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
"config": cty.ObjectVal(map[string]cty.Value{
|
||||
"path": cty.StringVal("./testdata/basic.tfstate"),
|
||||
}),
|
||||
}),
|
||||
cty.ObjectVal(map[string]cty.Value{
|
||||
"backend": cty.StringVal("local"),
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
"config": cty.ObjectVal(map[string]cty.Value{
|
||||
"path": cty.StringVal("./testdata/basic.tfstate"),
|
||||
}),
|
||||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||
"foo": cty.StringVal("bar"),
|
||||
}),
|
||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||
}),
|
||||
false,
|
||||
|
@ -60,7 +80,6 @@ func TestState_basic(t *testing.T) {
|
|||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||
"foo": cty.StringVal("bar"),
|
||||
}),
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||
}),
|
||||
false,
|
||||
|
@ -94,7 +113,6 @@ func TestState_basic(t *testing.T) {
|
|||
cty.StringVal("test2"),
|
||||
}),
|
||||
}),
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||
}),
|
||||
false,
|
||||
|
@ -115,7 +133,6 @@ func TestState_basic(t *testing.T) {
|
|||
"map": cty.NullVal(cty.DynamicPseudoType),
|
||||
"list": cty.NullVal(cty.DynamicPseudoType),
|
||||
}),
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||
}),
|
||||
false,
|
||||
|
@ -141,7 +158,6 @@ func TestState_basic(t *testing.T) {
|
|||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||
"foo": cty.StringVal("bar"),
|
||||
}),
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
}),
|
||||
false,
|
||||
},
|
||||
|
@ -159,7 +175,6 @@ func TestState_basic(t *testing.T) {
|
|||
}),
|
||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||
"outputs": cty.EmptyObjectVal,
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
}),
|
||||
true,
|
||||
},
|
||||
|
@ -212,7 +227,6 @@ func TestState_basic(t *testing.T) {
|
|||
}),
|
||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||
"outputs": cty.EmptyObjectVal,
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
}),
|
||||
false,
|
||||
},
|
||||
|
@ -233,7 +247,6 @@ func TestState_basic(t *testing.T) {
|
|||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||
"foo": cty.StringVal("bar"),
|
||||
}),
|
||||
"workspace": cty.StringVal(backend.DefaultStateName),
|
||||
}),
|
||||
false,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue