Skip to content

Commit

Permalink
fixing tflint and lintrest violations
Browse files Browse the repository at this point in the history
  • Loading branch information
jrauschenbusch committed May 6, 2020
1 parent f305c0b commit a9f12ae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func resourceArmEventGridEventSubscription() *schema.Resource {
Type: schema.TypeString,
Required: true,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if strings.ToLower(old) == strings.ToLower(new) {
if strings.EqualFold(old, new) {
return true
} else if o, err := strconv.ParseFloat(old, 64); err == nil {
n, err := strconv.ParseFloat(new, 64)
Expand Down Expand Up @@ -285,7 +285,7 @@ func resourceArmEventGridEventSubscription() *schema.Resource {
Type: schema.TypeString,
ValidateFunc: validation.StringIsNotEmpty,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if strings.ToLower(old) == strings.ToLower(new) {
if strings.EqualFold(old, new) {
return true
} else if o, err := strconv.ParseFloat(old, 64); err == nil {
n, err := strconv.ParseFloat(new, 64)
Expand Down Expand Up @@ -394,7 +394,7 @@ func resourceArmEventGridEventSubscriptionCreateUpdate(d *schema.ResourceData, m
return fmt.Errorf("Error creating/updating EventGrid Event Subscription %q (Scope %q): %s", name, scope, err)
}

expirationTime := date.Time{parsedTime}
expirationTime := date.Time{Time: parsedTime}

eventSubscriptionProperties := eventgrid.EventSubscriptionProperties{
Destination: destination,
Expand Down Expand Up @@ -463,7 +463,7 @@ func resourceArmEventGridEventSubscriptionRead(d *schema.ResourceData, meta inte
d.Set("scope", id.Scope)

if props := resp.EventSubscriptionProperties; props != nil {
d.Set("expiration_time_utc", props.ExpirationTimeUtc)
d.Set("expiration_time_utc", props.ExpirationTimeUtc.Format(time.RFC3339))

if props.Topic != nil && *props.Topic != "" {
d.Set("topic_name", props.Topic)
Expand Down Expand Up @@ -712,9 +712,8 @@ func expandEventGridEventSubscriptionFilter(d *schema.ResourceData) (*eventgrid.
}
}

if advancedFilterCompound, ok := d.GetOk("advanced_filter_array"); ok {

for _, v := range advancedFilterCompound.([]interface{}) {
if advancedFilterArray, ok := d.GetOk("advanced_filter_array"); ok {
for _, v := range advancedFilterArray.([]interface{}) {
config := v.(map[string]interface{})

key := config["key"].(string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ resource "azurerm_eventgrid_domain" "test" {
}
resource "azurerm_eventgrid_domain_topic" "test" {
name = "acctestegtopic-%d"
domain_name = azurerm_eventgrid_domain.test.name
resource_group_name = azurerm_resource_group.test.name
}
name = "acctestegtopic-%d"
domain_name = azurerm_eventgrid_domain.test.name
resource_group_name = azurerm_resource_group.test.name
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,15 @@ resource "azurerm_eventgrid_event_subscription" "test" {
}
advanced_filter_scalar {
key = "data.filesize"
operator_type = "NumberLessThan"
value = 2000.0
key = "data.filesize"
operator_type = "NumberLessThan"
value = 42.0
}
advanced_filter_array {
key = "topic"
operator_type = "StringBeginsWith"
value = ["topic_prefix"]
key = "topic"
operator_type = "StringBeginsWith"
value = ["topic_prefix"]
}
}
`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger)
Expand Down

0 comments on commit a9f12ae

Please sign in to comment.