Skip to content

Commit 3ec8a76

Browse files
committed
SUMO-0 removing the validation
1 parent d37b4f9 commit 3ec8a76

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

sumologic/resource_sumologic_field.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ func resourceSumologicFieldUpdate(d *schema.ResourceData, meta interface{}) erro
137137
return err
138138
}
139139

140-
if f.FieldName != name || f.DataType != tpe {
141-
return errors.New("Only state field is updatable")
142-
}
143-
144140
if state == "Enabled" {
145141
err := c.EnableField(id)
146142
if err != nil {

sumologic/resource_sumologic_field_test.go

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -92,53 +92,6 @@ func TestAccSumologicField_update(t *testing.T) {
9292
})
9393
}
9494

95-
func TestAccSumologicField_OnlyStateFieldIsUpdatable(t *testing.T) {
96-
97-
var field Field
98-
99-
resourceName := "sumologic_field.test"
100-
testFieldName := "fields_provider_test"
101-
testDataType := "String"
102-
testState := "Enabled"
103-
updatedDataType := "int"
104-
105-
resource.Test(t, resource.TestCase{
106-
PreCheck: func() { testAccPreCheck(t) },
107-
Providers: testAccProviders,
108-
CheckDestroy: testAccCheckFieldDestroy(field),
109-
Steps: []resource.TestStep{
110-
{
111-
Config: fmt.Sprintf(`
112-
resource "sumologic_field" "test" {
113-
field_name = "%s"
114-
data_type = "%s"
115-
state = "%s"
116-
}
117-
`, testFieldName, testDataType, testState),
118-
Check: resource.ComposeTestCheckFunc(
119-
resource.TestCheckResourceAttr(resourceName, "field_name", testFieldName),
120-
resource.TestCheckResourceAttr(resourceName, "data_type", testDataType),
121-
resource.TestCheckResourceAttr(resourceName, "state", testState),
122-
),
123-
},
124-
125-
{
126-
Config: fmt.Sprintf(`
127-
resource "sumologic_field" "test" {
128-
field_name = "%s"
129-
data_type = "%s"
130-
state = "%s"
131-
}
132-
`, testFieldName, updatedDataType, testState),
133-
ExpectError: regexp.MustCompile("Only state field is updatable"),
134-
Check: resource.ComposeTestCheckFunc(
135-
resource.TestCheckResourceAttr(resourceName, "data_type", testDataType),
136-
),
137-
},
138-
},
139-
})
140-
}
141-
14295
func testAccCheckFieldDestroy(field Field) resource.TestCheckFunc {
14396
return func(s *terraform.State) error {
14497
client := testAccProvider.Meta().(*Client)

0 commit comments

Comments
 (0)