Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
njuCZ committed May 21, 2021
1 parent 88913a5 commit 9b402d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func resourceKubernetesClusterNodePoolCreate(d *schema.ResourceData, meta interf
}

if linuxOSConfig := d.Get("linux_os_config").([]interface{}); len(linuxOSConfig) > 0 {
if osType != string(containerservice.Linux) {
if osType != string(containerservice.OSTypeLinux) {
return fmt.Errorf("`linux_os_config` can only be configured when `os_type` is set to `linux`")
}
linuxOSConfig, err := expandAgentPoolLinuxOSConfig(linuxOSConfig)
Expand Down
6 changes: 3 additions & 3 deletions azurerm/internal/services/containers/kubernetes_nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ func ExpandDefaultNodePool(d *schema.ResourceData) (*[]containerservice.ManagedC
}

func expandAgentPoolKubeletConfig(input []interface{}) *containerservice.KubeletConfig {
if len(input) == 0 {
if len(input) == 0 || input[0] == nil {
return nil
}

Expand Down Expand Up @@ -746,7 +746,7 @@ func expandAgentPoolKubeletConfig(input []interface{}) *containerservice.Kubelet
}

func expandAgentPoolLinuxOSConfig(input []interface{}) (*containerservice.LinuxOSConfig, error) {
if len(input) == 0 {
if len(input) == 0 || input[0] == nil {
return nil, nil
}
raw := input[0].(map[string]interface{})
Expand All @@ -771,7 +771,7 @@ func expandAgentPoolLinuxOSConfig(input []interface{}) (*containerservice.LinuxO
}

func expandAgentPoolSysctlConfig(input []interface{}) (*containerservice.SysctlConfig, error) {
if len(input) == 0 {
if len(input) == 0 || input[0] == nil {
return nil, nil
}
raw := input[0].(map[string]interface{})
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/kubernetes_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ A `ssh_key` block supports the following:

A `sysctl_config` block supports the following:

~> For more information, please refer to [Linux Kernel Doc](https://www.kernel.org/doc/html/latest/admin-guide/sysctl/index.html).

* `fs_aio_max_nr` - (Optional) The sysctl setting fs.aio-max-nr. Must be between `65536` and `6553500`. Changing this forces a new resource to be created.

* `fs_file_max` - (Optional) The sysctl setting fs.file-max. Must be between `8192` and `12000500`. Changing this forces a new resource to be created.
Expand Down

0 comments on commit 9b402d4

Please sign in to comment.