Skip to content

Commit

Permalink
codereview changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Nov 15, 2018
1 parent 8b5965a commit cbb4fb1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions azurerm/helpers/kubernetes/kube_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ func ParseKubeConfigAAD(config string) (*KubeConfigAAD, error) {
}

var kubeConfig KubeConfigAAD
err := yaml.Unmarshal([]byte(config), &kubeConfig)
if err != nil {
if err := yaml.Unmarshal([]byte(config), &kubeConfig); err != nil {
return nil, fmt.Errorf("Failed to unmarshal YAML config with error %+v", err)
}
if len(kubeConfig.Clusters) <= 0 || len(kubeConfig.Users) <= 0 {
Expand Down
8 changes: 2 additions & 6 deletions azurerm/resource_arm_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,7 @@ func resourceArmKubernetesClusterCreateUpdate(d *schema.ResourceData, meta inter
return fmt.Errorf("Error creating/updating Managed Kubernetes Cluster %q (Resource Group %q): %+v", name, resGroup, err)
}

err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if err = future.WaitForCompletionRef(ctx, client.Client); err != nil {
return fmt.Errorf("Error waiting for completion of Managed Kubernetes Cluster %q (Resource Group %q): %+v", name, resGroup, err)
}

Expand Down Expand Up @@ -712,7 +711,6 @@ func flattenKubernetesClusterAddonProfiles(profile map[string]*containerservice.
func expandKubernetesClusterAgentPoolProfiles(d *schema.ResourceData) []containerservice.ManagedClusterAgentPoolProfile {
configs := d.Get("agent_pool_profile").([]interface{})
config := configs[0].(map[string]interface{})
profiles := make([]containerservice.ManagedClusterAgentPoolProfile, 0, len(configs))

name := config["name"].(string)
count := int32(config["count"].(int))
Expand All @@ -738,9 +736,7 @@ func expandKubernetesClusterAgentPoolProfiles(d *schema.ResourceData) []containe
profile.VnetSubnetID = utils.String(vnetSubnetID)
}

profiles = append(profiles, profile)

return profiles
return []containerservice.ManagedClusterAgentPoolProfile{profile}
}

func flattenKubernetesClusterAgentPoolProfiles(profiles *[]containerservice.ManagedClusterAgentPoolProfile, fqdn *string) []interface{} {
Expand Down
1 change: 1 addition & 0 deletions examples/kubernetes/advanced-networking/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
variable "prefix" {
description = "A prefix used for all resources in this example"
default = "tomdev"
}

variable "location" {
Expand Down
1 change: 1 addition & 0 deletions examples/kubernetes/basic/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
variable "prefix" {
description = "A prefix used for all resources in this example"
default = "tomdev"
}

variable "location" {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/kubernetes_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ A `agent_pool_profile` block exports the following:

* `max_pods` - The maximum number of pods that can run on each agent.

* `name` - The name assigned to this pool of agents
* `name` - The name assigned to this pool of agents.

* `os_disk_size_gb` - The size of the Agent VM's Operating System Disk in GB.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The following arguments are supported:
the `ARM_CLIENT_SECRET` environment variable.

* `tenant_id` - (Optional) The tenant ID to use. It can also be sourced from the
`ARM_TENANT_ID` environment variable.`
`ARM_TENANT_ID` environment variable.

* `use_msi` - (Optional) Set to true to authenticate using managed service identity.
It can also be sourced from the `ARM_USE_MSI` environment variable.
Expand Down

0 comments on commit cbb4fb1

Please sign in to comment.