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

datalakestore: fixing linting issues #14170

Merged
merged 4 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 6 additions & 5 deletions internal/acceptance/testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/provider"
)

// lintignore:AT001
func (td TestData) DataSourceTest(t *testing.T, steps []TestStep) {
// DataSources don't need a check destroy - however since this is a wrapper function
// and not matching the ignore pattern `XXX_data_source_test.go`, this needs to be explicitly opted out

// lintignore:AT001
testCase := resource.TestCase{
PreCheck: func() { PreCheck(t) },
Steps: steps,
}
td.runAcceptanceTest(t, testCase)
}

// lintignore:AT001
func (td TestData) DataSourceTestInSequence(t *testing.T, steps []TestStep) {
// DataSources don't need a check destroy - however since this is a wrapper function
// and not matching the ignore pattern `XXX_data_source_test.go`, this needs to be explicitly opted out

// lintignore:AT001
testCase := resource.TestCase{
PreCheck: func() { PreCheck(t) },
Steps: steps,
Expand All @@ -36,7 +38,6 @@ func (td TestData) DataSourceTestInSequence(t *testing.T, steps []TestStep) {
td.runAcceptanceSequentialTest(t, testCase)
}

// lintignore:AT001
func (td TestData) ResourceTest(t *testing.T, testResource types.TestResource, steps []TestStep) {
testCase := resource.TestCase{
PreCheck: func() { PreCheck(t) },
Expand All @@ -54,17 +55,17 @@ func (td TestData) ResourceTest(t *testing.T, testResource types.TestResource, s

// ResourceTestIgnoreCheckDestroyed skips the check to confirm the resource test has been destroyed.
// This is done because certain resources can't actually be deleted.
// lintignore:AT001
func (td TestData) ResourceTestSkipCheckDestroyed(t *testing.T, steps []TestStep) {
// lintignore:AT001
testCase := resource.TestCase{
PreCheck: func() { PreCheck(t) },
Steps: steps,
}
td.runAcceptanceTest(t, testCase)
}

// lintignore:AT001
func (td TestData) ResourceSequentialTestSkipCheckDestroyed(t *testing.T, steps []TestStep) {
// lintignore:AT001
testCase := resource.TestCase{
PreCheck: func() { PreCheck(t) },
Steps: steps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ func resourceArmDateLakeAnalyticsAccountRead(d *pluginsdk.ResourceData, meta int
}

if properties := model.Properties; properties != nil {
d.Set("tier", properties.CurrentTier)
tier := ""
if properties.CurrentTier != nil {
tier = string(*properties.CurrentTier)
}
d.Set("tier", tier)
d.Set("default_store_account_name", properties.DefaultDataLakeStoreAccount)
}

Expand Down
26 changes: 22 additions & 4 deletions internal/services/datalake/data_lake_store_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,29 @@ func dataSourceArmDateLakeStoreAccountRead(d *pluginsdk.ResourceData, meta inter
}

if properties := model.Properties; properties != nil {
d.Set("tier", properties.CurrentTier)
tier := ""
if properties.CurrentTier != nil {
tier = string(*properties.CurrentTier)
}
d.Set("tier", tier)

encryptionState := ""
if properties.EncryptionState != nil {
encryptionState = string(*properties.EncryptionState)
}
d.Set("encryption_state", encryptionState)

d.Set("encryption_state", properties.EncryptionState)
d.Set("firewall_allow_azure_ips", properties.FirewallAllowAzureIps)
d.Set("firewall_state", properties.FirewallState)
firewallState := ""
if properties.FirewallState != nil {
firewallState = string(*properties.FirewallState)
}
d.Set("firewall_state", firewallState)

firewallAllowAzureIps := ""
if properties.FirewallAllowAzureIps != nil {
firewallAllowAzureIps = string(*properties.FirewallAllowAzureIps)
}
d.Set("firewall_allow_azure_ips", firewallAllowAzureIps)

if config := properties.EncryptionConfig; config != nil {
d.Set("encryption_type", string(config.Type))
Expand Down