Skip to content

Commit

Permalink
Merge pull request #42 from volcengine/feat/updateVke-v2.7.0
Browse files Browse the repository at this point in the history
Feat/update vke v2.7.0
  • Loading branch information
xuyaming0800 authored Dec 1, 2022
2 parents 1da1328 + b5c7685 commit 91c7fff
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/common_volcengine_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package common

const (
TerraformProviderName = "terraform-provider-volcengine"
TerraformProviderVersion = "0.0.36"
TerraformProviderVersion = "0.0.37"
)
1 change: 0 additions & 1 deletion volcengine/vke/cluster/service_volcengine_vke_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.",
},
},
},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions website/docs/d/vke_support_addons.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 91c7fff

Please sign in to comment.