Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Terraform
Commits
f7264a24
Commit
f7264a24
authored
6 years ago
by
Martin Atkins
Browse files
Options
Download
Email Patches
Plain Diff
core: Don't panic in TestContext2Apply_dataDependsOn if data source fails
parent
09a33ed1
f-v0.12-cmdvars
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
terraform/context_apply_test.go
+9
-1
terraform/context_apply_test.go
with
9 additions
and
1 deletion
+9
-1
terraform/context_apply_test.go
+
9
-
1
View file @
f7264a24
...
...
@@ -9276,8 +9276,16 @@ func TestContext2Apply_dataDependsOn(t *testing.T) {
assertNoErrors
(
t
,
diags
)
root
:=
state
.
Module
(
addrs
.
RootModuleInstance
)
is
:=
root
.
ResourceInstance
(
addrs
.
Resource
{
Mode
:
addrs
.
DataResourceMode
,
Type
:
"null_data_source"
,
Name
:
"read"
,
}
.
Instance
(
addrs
.
NoKey
))
if
is
==
nil
{
t
.
Fatal
(
"data resource instance is not present in state; should be"
)
}
var
attrs
map
[
string
]
interface
{}
err
:=
json
.
Unmarshal
(
root
.
Resources
[
"data.null_data_source.read"
]
.
Instances
[
addrs
.
NoKey
]
.
Current
.
AttrsJSON
,
&
attrs
)
err
:=
json
.
Unmarshal
(
is
.
Current
.
AttrsJSON
,
&
attrs
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help