diff --git a/common/common_volcengine_version.go b/common/common_volcengine_version.go index 645ba0ca..8f54ec3b 100644 --- a/common/common_volcengine_version.go +++ b/common/common_volcengine_version.go @@ -2,5 +2,5 @@ package common const ( TerraformProviderName = "terraform-provider-volcengine" - TerraformProviderVersion = "0.0.36" + TerraformProviderVersion = "0.0.37" ) diff --git a/volcengine/vke/cluster/service_volcengine_vke_cluster.go b/volcengine/vke/cluster/service_volcengine_vke_cluster.go index 8bf56ecb..a87375d2 100644 --- a/volcengine/vke/cluster/service_volcengine_vke_cluster.go +++ b/volcengine/vke/cluster/service_volcengine_vke_cluster.go @@ -437,7 +437,6 @@ func (s *VolcengineVkeClusterService) ModifyResource(resourceData *schema.Resour } (*call.SdkParam)["Id"] = d.Id() - // 删除UpdateClusterConfig中的Tags字段 delete(*call.SdkParam, "Tags") return true, nil }, diff --git a/volcengine/vke/default_node_pool/service_volcengine_vke_default_node_pool.go b/volcengine/vke/default_node_pool/service_volcengine_vke_default_node_pool.go index f35353dd..adb4d692 100644 --- a/volcengine/vke/default_node_pool/service_volcengine_vke_default_node_pool.go +++ b/volcengine/vke/default_node_pool/service_volcengine_vke_default_node_pool.go @@ -333,7 +333,6 @@ func (s *VolcengineDefaultNodePoolService) ModifyResource(resourceData *schema.R (*call.SdkParam)["Id"] = d.Id() (*call.SdkParam)["ClusterId"] = d.Get("cluster_id") - // 删除UpdateClusterConfig中的Tags字段 delete(*call.SdkParam, "Tags") return true, nil }, diff --git a/volcengine/vke/node_pool/service_volcengine_vke_node_pool.go b/volcengine/vke/node_pool/service_volcengine_vke_node_pool.go index dc6abc2f..16838fa8 100644 --- a/volcengine/vke/node_pool/service_volcengine_vke_node_pool.go +++ b/volcengine/vke/node_pool/service_volcengine_vke_node_pool.go @@ -542,7 +542,6 @@ func (s *VolcengineNodePoolService) ModifyResource(resourceData *schema.Resource (*call.SdkParam)["Id"] = d.Id() (*call.SdkParam)["ClusterId"] = d.Get("cluster_id") - // 删除UpdateClusterConfig中的Tags字段 delete(*call.SdkParam, "Tags") return true, nil }, diff --git a/volcengine/vke/support_addon/data_source_volcengine_vke_support_addons.go b/volcengine/vke/support_addon/data_source_volcengine_vke_support_addons.go index 1dbfcbde..c5edc7e9 100644 --- a/volcengine/vke/support_addon/data_source_volcengine_vke_support_addons.go +++ b/volcengine/vke/support_addon/data_source_volcengine_vke_support_addons.go @@ -51,6 +51,13 @@ func DataSourceVolcengineVkeVkeSupportedAddons() *schema.Resource { Optional: true, Description: "The categories of addons, the value is `Storage` or `Network` or `Monitor` or `Scheduler` or `Dns` or `Security` or `Gpu` or `Image`.", }, + "kubernetes_versions": { + Type: schema.TypeSet, + Set: schema.HashString, + Elem: &schema.Schema{Type: schema.TypeString}, + Optional: true, + Description: "A list of Kubernetes Versions.", + }, "output_file": { Type: schema.TypeString, Optional: true, @@ -90,6 +97,20 @@ func DataSourceVolcengineVkeVkeSupportedAddons() *schema.Resource { Description: "The compatible version list.", Elem: &schema.Schema{Type: schema.TypeString}, }, + "compatibilities": { + Type: schema.TypeList, + Computed: true, + Description: "The compatible version list.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "kubernetes_version": { + Type: schema.TypeString, + Computed: true, + Description: "The Kubernetes Version of addon.", + }, + }, + }, + }, }, }, }, diff --git a/volcengine/vke/support_addon/service_volcengine_vke_support_addon.go b/volcengine/vke/support_addon/service_volcengine_vke_support_addon.go index 5760acec..aa9a878f 100644 --- a/volcengine/vke/support_addon/service_volcengine_vke_support_addon.go +++ b/volcengine/vke/support_addon/service_volcengine_vke_support_addon.go @@ -33,6 +33,13 @@ func (s *VolcengineVkeSupportAddonService) ReadResources(condition map[string]in ok bool ) + if _, ok := condition["Filter"]; ok { + if kubernetesVersions, ok := condition["Filter"].(map[string]interface{})["KubernetesVersions"]; ok { + condition["Filter"].(map[string]interface{})["Versions.Compatibilities.KubernetesVersions"] = kubernetesVersions + delete(condition["Filter"].(map[string]interface{}), "KubernetesVersions") + } + } + action := "ListSupportedAddons" logger.Debug(logger.ReqFormat, action, condition) if condition == nil { @@ -111,6 +118,10 @@ func (s *VolcengineVkeSupportAddonService) DatasourceResources(*schema.ResourceD TargetField: "Filter.Categories", ConvertType: ve.ConvertJsonArray, }, + "kubernetes_versions": { + TargetField: "Filter.KubernetesVersions", + ConvertType: ve.ConvertJsonArray, + }, }, ContentType: ve.ContentTypeJson, NameField: "Name", diff --git a/website/docs/d/vke_support_addons.html.markdown b/website/docs/d/vke_support_addons.html.markdown index 6952ebd6..9e87145a 100644 --- a/website/docs/d/vke_support_addons.html.markdown +++ b/website/docs/d/vke_support_addons.html.markdown @@ -20,6 +20,7 @@ The following arguments are supported: * `categories` - (Optional) The categories of addons, the value is `Storage` or `Network` or `Monitor` or `Scheduler` or `Dns` or `Security` or `Gpu` or `Image`. * `deploy_modes` - (Optional) The deploy model, the value is `Managed` or `Unmanaged`. * `deploy_node_types` - (Optional) The deploy node types, the value is `Node` or `VirtualNode`. Only effected when deploy_mode is `Unmanaged`. +* `kubernetes_versions` - (Optional) A list of Kubernetes Versions. * `name` - (Optional) The name of the addon. * `necessaries` - (Optional) The necessaries of addons, the value is `Required` or `Recommended` or `OnDemand`. * `output_file` - (Optional) File name where to save data source results. @@ -33,6 +34,8 @@ In addition to all arguments above, the following attributes are exported: * `name` - The name of addon. * `pod_network_modes` - The network modes of pod. * `versions` - The version info of addon. + * `compatibilities` - The compatible version list. + * `kubernetes_version` - The Kubernetes Version of addon. * `compatible_versions` - The compatible version list. * `version` - The basic version info. * `total_count` - The total count of addons query.