Skip to content

Commit

Permalink
Merge pull request #1 from terraform-providers/master
Browse files Browse the repository at this point in the history
Syncing from TF
  • Loading branch information
Matt Betts authored Jul 28, 2018
2 parents 788d959 + 05fa852 commit e5e75f2
Show file tree
Hide file tree
Showing 130 changed files with 623 additions and 298 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ FEATURES:

* **New Data Source:** `azurerm_container_registry` [GH-1642]


IMPROVEMENTS:

* sdk: switching from `WaitForCompletion` -> `WaitForCompletionRef` when polling Future's [GH-1660]
* Data Source: `azurerm_kubernetes_cluster` - support for specifying the `network_profile` block [GH-1479]
* Data Source: `azurerm_kubernetes_cluster` - outputting the `node_resource_group` field [GH-1649]
* `azurerm_kubernetes_cluster` - support for specifying the `network_profile` block [GH-1479]
* `azurerm_kubernetes_cluster` - outputting the `node_resource_group` field [GH-1649]
* `azurerm_virtual_machine` - setting the connection information for Provisioners [GH-1646]

## 1.11.0 (July 25, 2018)

Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func dataSourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error
if err != nil {
return err
}
err = siteCredFuture.WaitForCompletion(ctx, client.Client)
err = siteCredFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_app_service_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (
func dataSourceAppServicePlan() *schema.Resource {
return &schema.Resource{
Read: dataSourceAppServicePlanRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_application_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (
func dataSourceArmApplicationSecurityGroup() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmApplicationSecurityGroupRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_azuread_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import (
func dataSourceArmAzureADApplication() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmAzureADApplicationRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"object_id": {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_azuread_service_principal.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import (
func dataSourceArmActiveDirectoryServicePrincipal() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmActiveDirectoryServicePrincipalRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"object_id": {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_cosmos_db_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import (
func dataSourceArmCosmosDBAccount() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmCosmosDBAccountRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
6 changes: 6 additions & 0 deletions azurerm/data_source_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func dataSourceArmKubernetesCluster() *schema.Resource {
Computed: true,
},

"node_resource_group": {
Type: schema.TypeString,
Computed: true,
},

"kube_config": {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -233,6 +238,7 @@ func dataSourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{}
d.Set("dns_prefix", props.DNSPrefix)
d.Set("fqdn", props.Fqdn)
d.Set("kubernetes_version", props.KubernetesVersion)
d.Set("node_resource_group", props.NodeResourceGroup)

linuxProfile := flattenKubernetesClusterDataSourceLinuxProfile(props.LinuxProfile)
if err := d.Set("linux_profile", linuxProfile); err != nil {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_logic_app_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import (
func dataSourceArmLogicAppWorkflow() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmLogicAppWorkflowRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_network_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (
func dataSourceArmNetworkInterface() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmNetworkInterfaceRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_recovery_services_vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import (
func dataSourceArmRecoveryServicesVault() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmRecoveryServicesVaultRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
3 changes: 0 additions & 3 deletions azurerm/data_source_scheduler_job_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (
func dataSourceArmSchedulerJobCollection() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmSchedulerJobCollectionRead,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
8 changes: 4 additions & 4 deletions azurerm/resource_arm_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func resourceArmAppServiceCreate(d *schema.ResourceData, meta interface{}) error
return err
}

err = createFuture.WaitForCompletion(ctx, client.Client)
err = createFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -289,7 +289,7 @@ func resourceArmAppServiceUpdate(d *schema.ResourceData, meta interface{}) error
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -364,7 +364,7 @@ func resourceArmAppServiceUpdate(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("Error updating Managed Service Identity for App Service %q: %+v", name, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)

if err != nil {
return fmt.Errorf("Error updating Managed Service Identity for App Service %q: %+v", name, err)
Expand Down Expand Up @@ -420,7 +420,7 @@ func resourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error {
if err != nil {
return err
}
err = siteCredFuture.WaitForCompletion(ctx, client.Client)
err = siteCredFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_app_service_active_slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func resourceArmAppServiceActiveSlotCreate(d *schema.ResourceData, meta interfac
if err != nil {
return fmt.Errorf("Error swapping App Service Slot %q/%q: %+v", appServiceName, targetSlot, err)
}
err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error swapping App Service Slot %q/%q: %+v", appServiceName, targetSlot, err)
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_app_service_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func resourceArmAppServicePlanCreateUpdate(d *schema.ResourceData, meta interfac
return err
}

err = createFuture.WaitForCompletion(ctx, client.Client)
err = createFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_app_service_slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func resourceArmAppServiceSlotCreate(d *schema.ResourceData, meta interface{}) e
return err
}

err = createFuture.WaitForCompletion(ctx, client.Client)
err = createFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -253,7 +253,7 @@ func resourceArmAppServiceSlotUpdate(d *schema.ResourceData, meta interface{}) e
return err
}

err = createFuture.WaitForCompletion(ctx, client.Client)
err = createFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_application_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ func resourceArmApplicationGatewayCreateUpdate(d *schema.ResourceData, meta inte
return fmt.Errorf("Error Creating/Updating ApplicationGateway %q (Resource Group %q): %+v", name, resGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error Creating/Updating ApplicationGateway %q (Resource Group %q): %+v", name, resGroup, err)
}
Expand Down Expand Up @@ -857,7 +857,7 @@ func resourceArmApplicationGatewayDelete(d *schema.ResourceData, meta interface{
return fmt.Errorf("Error deleting for AppGateway %q (Resource Group %q): %+v", name, resGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for deletion of AppGateway %q (Resource Group %q): %+v", name, resGroup, err)
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_application_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func testSweepApplicationGateways(region string) error {
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
continue
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_application_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func resourceArmApplicationSecurityGroupCreateUpdate(d *schema.ResourceData, met
return fmt.Errorf("Error creating Application Security Group %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for the Application Security Group %q (Resource Group %q) to finish creating: %+v", name, resourceGroup, err)
}
Expand Down Expand Up @@ -123,7 +123,7 @@ func resourceArmApplicationSecurityGroupDelete(d *schema.ResourceData, meta inte
}
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if !response.WasNotFound(future.Response()) {
return fmt.Errorf("Error waiting for deletion of Application Security Group %q (Resource Group %q): %+v", name, resourceGroup, err)
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_cdn_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func resourceArmCdnEndpointCreate(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error creating CDN Endpoint %q (Profile %q / Resource Group %q): %+v", name, profileName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for CDN Endpoint %q (Profile %q / Resource Group %q) to finish creating: %+v", name, profileName, resourceGroup, err)
}
Expand Down Expand Up @@ -312,7 +312,7 @@ func resourceArmCdnEndpointUpdate(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error updating CDN Endpoint %q (Profile %q / Resource Group %q): %s", name, profileName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, endpointsClient.Client)
err = future.WaitForCompletionRef(ctx, endpointsClient.Client)
if err != nil {
return fmt.Errorf("Error waiting for the CDN Endpoint %q (Profile %q / Resource Group %q) to finish updating: %+v", name, profileName, resourceGroup, err)
}
Expand Down Expand Up @@ -408,7 +408,7 @@ func resourceArmCdnEndpointDelete(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error deleting CDN Endpoint %q (Profile %q / Resource Group %q): %+v", name, profileName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_cdn_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func testCheckAzureRMCdnEndpointDisappears(name string) resource.TestCheckFunc {
return fmt.Errorf("Bad: Delete on cdnEndpointsClient: %+v", err)
}

err = future.WaitForCompletion(ctx, conn.Client)
err = future.WaitForCompletionRef(ctx, conn.Client)
if err != nil {
return fmt.Errorf("Bad: Delete on cdnEndpointsClient: %+v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_cdn_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func resourceArmCdnProfileCreate(d *schema.ResourceData, meta interface{}) error
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func resourceArmCdnProfileUpdate(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("Error issuing update request for CDN Profile %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for the update of CDN Profile %q (Resource Group %q) to commplete: %+v", name, resourceGroup, err)
}
Expand Down Expand Up @@ -178,7 +178,7 @@ func resourceArmCdnProfileDelete(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("Error issuing delete request for CDN Profile %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_cdn_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func testSweepCDNProfiles(region string) error {
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
29 changes: 18 additions & 11 deletions azurerm/resource_arm_container_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceArmContainerGroup() *schema.Resource {
Create: resourceArmContainerGroupCreate,
Read: resourceArmContainerGroupRead,
Delete: resourceArmContainerGroupDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down Expand Up @@ -464,12 +467,14 @@ func flattenContainerVolumes(volumeMounts *[]containerinstance.VolumeMount, cont

// find corresponding volume in config
// and use the data
for _, cvr := range *containerVolumesConfig {
cv := cvr.(map[string]interface{})
rawName := cv["name"].(string)
if *vm.Name == rawName {
storageAccountKey := cv["storage_account_key"].(string)
volumeConfig["storage_account_key"] = storageAccountKey
if containerVolumesConfig != nil {
for _, cvr := range *containerVolumesConfig {
cv := cvr.(map[string]interface{})
rawName := cv["name"].(string)
if *vm.Name == rawName {
storageAccountKey := cv["storage_account_key"].(string)
volumeConfig["storage_account_key"] = storageAccountKey
}
}
}

Expand Down Expand Up @@ -605,11 +610,13 @@ func flattenContainerImageRegistryCredentials(d *schema.ResourceData, credsPtr *
credConfig["username"] = *cred.Username
}

data := configsOld[i].(map[string]interface{})
oldServer := data["server"].(string)
if cred.Server != nil && *cred.Server == oldServer {
if v, ok := d.GetOk(fmt.Sprintf("image_registry_credential.%d.password", i)); ok {
credConfig["password"] = v.(string)
if len(configsOld) > i {
data := configsOld[i].(map[string]interface{})
oldServer := data["server"].(string)
if cred.Server != nil && *cred.Server == oldServer {
if v, ok := d.GetOk(fmt.Sprintf("image_registry_credential.%d.password", i)); ok {
credConfig["password"] = v.(string)
}
}
}

Expand Down
Loading

0 comments on commit e5e75f2

Please sign in to comment.