diff --git a/azurerm/internal/services/containers/kubernetes_cluster_node_pool_resource.go b/azurerm/internal/services/containers/kubernetes_cluster_node_pool_resource.go index fbd4243562dac..f8a2073479cc4 100644 --- a/azurerm/internal/services/containers/kubernetes_cluster_node_pool_resource.go +++ b/azurerm/internal/services/containers/kubernetes_cluster_node_pool_resource.go @@ -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) diff --git a/azurerm/internal/services/containers/kubernetes_nodepool.go b/azurerm/internal/services/containers/kubernetes_nodepool.go index c9868c65e4358..aec99d6c6d4d8 100644 --- a/azurerm/internal/services/containers/kubernetes_nodepool.go +++ b/azurerm/internal/services/containers/kubernetes_nodepool.go @@ -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 } @@ -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{}) @@ -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{}) diff --git a/website/docs/r/kubernetes_cluster.html.markdown b/website/docs/r/kubernetes_cluster.html.markdown index d37f09ec96baa..5bd218270c2ef 100644 --- a/website/docs/r/kubernetes_cluster.html.markdown +++ b/website/docs/r/kubernetes_cluster.html.markdown @@ -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.