Skip to content

Commit

Permalink
Merge pull request hashicorp#14170 from hashicorp/f/linting
Browse files Browse the repository at this point in the history
datalakestore: fixing linting issues
  • Loading branch information
tombuildsstuff authored Nov 12, 2021
2 parents 6ed425d + 431afb5 commit 6964085
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
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

0 comments on commit 6964085

Please sign in to comment.