Skip to content

Commit

Permalink
refactor: working through todo's
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Mar 23, 2022
1 parent 7105b46 commit e83fc1e
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion internal/services/bot/bot_web_app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func resourceBotWebAppCreate(d *pluginsdk.ResourceData, meta interface{}) error
return fmt.Errorf("creating Web App Bot %q (Resource Group %q): %+v", resourceId.Name, resourceId.ResourceGroup, err)
}

// TODO: in 3.0 we should remove the "Default Site" on the Directline resource at this point if we can
// TODO: in 4.0 we should remove the "Default Site" on the Directline resource at this point if we can

d.SetId(resourceId.ID())
return resourceBotWebAppRead(d, meta)
Expand Down
2 changes: 1 addition & 1 deletion internal/services/cdn/cdn_endpoint_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func TestAccCdnEndpoint_fullFields(t *testing.T) {
check.That(data.ResourceName).Key("tags.environment").HasValue("Production"),
),
},
// TODO -- add import step. Import step now gives us an error complaining that `is_compression_enabled` is not imported
data.ImportStep(),
})
}

Expand Down
6 changes: 1 addition & 5 deletions internal/services/compute/managed_disk_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1257,10 +1257,6 @@ resource "azurerm_managed_disk" "import" {
}

func (ManagedDiskResource) diskEncryptionSetDependencies(data acceptance.TestData) string {
// whilst this is in Preview it's only supported in: West Central US, Canada Central, North Europe
// TODO: switch back to default location
location := "westus2"

return fmt.Sprintf(`
provider "azurerm" {
features {
Expand Down Expand Up @@ -1356,7 +1352,7 @@ resource "azurerm_role_assignment" "disk-encryption-read-keyvault" {
role_definition_name = "Reader"
principal_id = azurerm_disk_encryption_set.test.identity.0.principal_id
}
`, data.RandomInteger, location, data.RandomString, data.RandomInteger)
`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger)
}

func (r ManagedDiskResource) diskEncryptionSetEncrypted(data acceptance.TestData) string {
Expand Down
2 changes: 0 additions & 2 deletions internal/services/compute/windows_virtual_machine_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/utils"
)

// TODO: confirm locking as appropriate

func resourceWindowsVirtualMachine() *pluginsdk.Resource {
return &pluginsdk.Resource{
Create: resourceWindowsVirtualMachineCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func (r ContainerRegistryTaskResource) Arguments() map[string]*pluginsdk.Schema
ValidateFunc: validation.StringIsNotEmpty,
},
"identity": {
// TODO - 3.0: should this be `user_assigned_identity_id`?
// TODO - 4.0: this should be `user_assigned_identity_id`?
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringIsNotEmpty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,6 @@ func dataSourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{}
d.Set("kubernetes_version", props.KubernetesVersion)
d.Set("node_resource_group", props.NodeResourceGroup)

// TODO: 2.0 we should introduce a access_profile block to match the new API design,
if accessProfile := props.APIServerAccessProfile; accessProfile != nil {
apiServerAuthorizedIPRanges := utils.FlattenStringSlice(accessProfile.AuthorizedIPRanges)
if err := d.Set("api_server_authorized_ip_ranges", apiServerAuthorizedIPRanges); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ func dataSourceKubernetesClusterNodePool() *pluginsdk.Resource {
}

if !features.ThreePointOhBeta() {
// TODO: document that this is replaced by `zones` in 3.0
s["availability_zones"] = &schema.Schema{
Type: pluginsdk.TypeList,
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,6 @@ func resourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{})
}
d.Set("automatic_channel_upgrade", upgradeChannel)

// TODO: 2.0 we should introduce a access_profile block to match the new API design,
if accessProfile := props.APIServerAccessProfile; accessProfile != nil {
apiServerAuthorizedIPRanges := utils.FlattenStringSlice(accessProfile.AuthorizedIPRanges)
if err := d.Set("api_server_authorized_ip_ranges", apiServerAuthorizedIPRanges); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,16 @@ func (k KubernetesClusterNodePoolV0ToV1) Schema() map[string]*pluginsdk.Schema {
},
},

// TODO 4.0: change this from enable_* to *_enabled
"enable_auto_scaling": {
Type: pluginsdk.TypeBool,
Optional: true,
},

// TODO 4.0: change this from enable_* to *_enabled
"enable_host_encryption": {
Type: pluginsdk.TypeBool,
Optional: true,
},

// TODO 4.0: change this from enable_* to *_enabled
"enable_node_public_ip": {
Type: pluginsdk.TypeBool,
Optional: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ func resourceDataFactoryDatasetCosmosDbSQLAPICreateUpdate(d *pluginsdk.ResourceD
}

description := d.Get("description").(string)
// TODO
cosmosDbTableset := datafactory.CosmosDbSQLAPICollectionDataset{
CosmosDbSQLAPICollectionDatasetTypeProperties: &cosmosDbDatasetProperties,
LinkedServiceName: linkedService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ func resourceDataFactoryDatasetDelimitedTextCreateUpdate(d *pluginsdk.ResourceDa
}

description := d.Get("description").(string)
// TODO
delimited_textTableset := datafactory.DelimitedTextDataset{
DelimitedTextDatasetTypeProperties: &delimited_textDatasetProperties,
LinkedServiceName: linkedService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func resourceDataFactoryDatasetHTTPCreateUpdate(d *pluginsdk.ResourceData, meta
}

description := d.Get("description").(string)
// TODO
httpTableset := datafactory.HTTPDataset{
HTTPDatasetTypeProperties: &httpDatasetProperties,
LinkedServiceName: linkedService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ func resourceDataFactoryDatasetJSONCreateUpdate(d *pluginsdk.ResourceData, meta
}

description := d.Get("description").(string)
// TODO
jsonTableset := datafactory.JSONDataset{
JSONDatasetTypeProperties: &jsonDatasetProperties,
LinkedServiceName: linkedService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ func resourceDataFactoryDatasetParquetCreateUpdate(d *pluginsdk.ResourceData, me
}

description := d.Get("description").(string)
// TODO
parquetTableset := datafactory.ParquetDataset{
ParquetDatasetTypeProperties: &parquetDatasetProperties,
LinkedServiceName: linkedService,
Expand Down

0 comments on commit e83fc1e

Please sign in to comment.