Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestCase: Fix TC for Log Analytics #18205

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"log"
"strings"
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
Expand Down Expand Up @@ -199,7 +198,7 @@ func flattenLogAnalyticsDataSourceWindowsEventEventType(eventTypes []dataSourceW
for _, e := range eventTypes {
// The casing isn't preserved by the API for event types, so we need to normalise it here until
// https://github.com/Azure/azure-rest-api-specs/issues/18163 is fixed
output = append(output, strings.ToLower(e.EventType))
output = append(output, e.EventType)
}
return output
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package loganalytics
import (
"fmt"
"log"
"strings"
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
Expand All @@ -12,6 +11,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
"github.com/hashicorp/terraform-provider-azurerm/utils"
Expand Down Expand Up @@ -41,14 +41,15 @@ func resourceLogAnalyticsLinkedStorageAccount() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
// TODO 4.0: change ignoreCase from true to false and remove diff suppress to respect correct casing
ValidateFunc: validation.StringInSlice([]string{
strings.ToLower(string(linkedstorageaccounts.DataSourceTypeCustomLogs)),
strings.ToLower(string(linkedstorageaccounts.DataSourceTypeAzureWatson)),
strings.ToLower(string(linkedstorageaccounts.DataSourceTypeQuery)),
strings.ToLower(string(linkedstorageaccounts.DataSourceTypeAlerts)),
// Value removed from enum in 2020-08-01, but effectively still works
"ingestion",
}, false),
string(linkedstorageaccounts.DataSourceTypeAlerts),
string(linkedstorageaccounts.DataSourceTypeAzureWatson),
string(linkedstorageaccounts.DataSourceTypeCustomLogs),
string(linkedstorageaccounts.DataSourceTypeIngestion),
string(linkedstorageaccounts.DataSourceTypeQuery),
}, true),
DiffSuppressFunc: suppress.CaseDifference,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we flag these with 4.0 - we want all 4.0 changes flagged so 4.0 is just a matter of flipping the flag

Suggested change
}, true),
DiffSuppressFunc: suppress.CaseDifference,
}, !features.FourPointOhBeta),
DiffSuppressFunc: !features.FourPointOhBeta,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use "DiffSuppressFunc: !features.FourPointOhBeta" since DiffSuppressFunc requires dynamic value. So I flag it via another way. Please take another look. Thanks.

},

"resource_group_name": azure.SchemaResourceGroupName(),
Expand Down