Skip to content
This repository was archived by the owner on Dec 5, 2020. It is now read-only.

Commit aa69712

Browse files
committed
Reverted a few changes
1 parent 6946734 commit aa69712

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

chef/resource_environment.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ func resourceChefEnvironment() *schema.Resource {
3434
"default_attributes_json": {
3535
Type: schema.TypeString,
3636
Optional: true,
37+
Default: "{}",
3738
StateFunc: jsonStateFunc,
3839
},
3940
"override_attributes_json": {
4041
Type: schema.TypeString,
4142
Optional: true,
43+
Default: "{}",
4244
StateFunc: jsonStateFunc,
4345
},
4446
"cookbook_constraints": {

chef/resource_environment_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ func TestAccEnvironment_basic(t *testing.T) {
5959
ImportState: true,
6060
ImportStateVerify: true,
6161
},
62+
{
63+
Config: testAccEnvironmentConfig_basic2,
64+
ResourceName: "chef_environment.test",
65+
ImportState: true,
66+
ImportStateVerify: true,
67+
},
6268
},
6369
})
6470
}
@@ -123,3 +129,12 @@ EOT
123129
}
124130
}
125131
`
132+
const testAccEnvironmentConfig_basic2 = `
133+
resource "chef_environment" "test" {
134+
name = "terraform-acc-test-basic"
135+
description = "Terraform Acceptance Tests"
136+
cookbook_constraints = {
137+
"terraform" = "= 1.0.0"
138+
}
139+
}
140+
`

chef/resource_node.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,25 @@ func resourceChefNode() *schema.Resource {
3535
Type: schema.TypeString,
3636
Optional: true,
3737
StateFunc: jsonStateFunc,
38+
Default: "{}",
3839
},
3940
"normal_attributes_json": {
4041
Type: schema.TypeString,
4142
Optional: true,
4243
StateFunc: jsonStateFunc,
44+
Default: "{}",
4345
},
4446
"default_attributes_json": {
4547
Type: schema.TypeString,
4648
Optional: true,
4749
StateFunc: jsonStateFunc,
50+
Default: "{}",
4851
},
4952
"override_attributes_json": {
5053
Type: schema.TypeString,
5154
Optional: true,
5255
StateFunc: jsonStateFunc,
56+
Default: "{}",
5357
},
5458
"run_list": {
5559
Type: schema.TypeList,

chef/resource_node_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ resource "chef_environment" "test" {
118118
}
119119
resource "chef_node" "test" {
120120
name = "terraform-acc-test-basic"
121-
environment_name = "terraform-acc-test-node-basic"
121+
environment_name = chef_environment.test.name
122122
automatic_attributes_json = <<EOT
123123
{
124124
"terraform_acc_test": true

chef/resource_role.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ func resourceChefRole() *schema.Resource {
3434
"default_attributes_json": {
3535
Type: schema.TypeString,
3636
Optional: true,
37+
Default: "{}",
3738
StateFunc: jsonStateFunc,
3839
},
3940
"override_attributes_json": {
4041
Type: schema.TypeString,
4142
Optional: true,
43+
Default: "{}",
4244
StateFunc: jsonStateFunc,
4345
},
4446
"run_list": {

0 commit comments

Comments
 (0)