Skip to content

Commit

Permalink
Adds support for kubernetes node pool taints (#596)
Browse files Browse the repository at this point in the history
* Adds support for kubernetes node pool taints

* Address feedback and fix update logic

* Address feedback and fix the failing cluster test

* Removed commented lines
  • Loading branch information
scotchneat committed Mar 18, 2021
1 parent 21da913 commit c73e7a5
Show file tree
Hide file tree
Showing 9 changed files with 595 additions and 331 deletions.
63 changes: 10 additions & 53 deletions digitalocean/datasource_digitalocean_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ import (
)

func dataSourceDigitalOceanKubernetesCluster() *schema.Resource {
dsNodePoolSchema := nodePoolSchema(false)

for _, k := range dsNodePoolSchema {
k.Computed = true
k.Required = false
k.Default = nil
k.ValidateFunc = nil
}

return &schema.Resource{
ReadContext: dataSourceDigitalOceanKubernetesClusterRead,
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -65,59 +74,7 @@ func dataSourceDigitalOceanKubernetesCluster() *schema.Resource {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
},

"name": {
Type: schema.TypeString,
Computed: true,
},

"size": {
Type: schema.TypeString,
Computed: true,
},

"actual_node_count": {
Type: schema.TypeInt,
Computed: true,
},

"node_count": {
Type: schema.TypeInt,
Computed: true,
},

"auto_scale": {
Type: schema.TypeBool,
Computed: true,
},

"min_nodes": {
Type: schema.TypeInt,
Computed: true,
},

"max_nodes": {
Type: schema.TypeInt,
Computed: true,
},

"tags": tagsSchema(),

"labels": {
Type: schema.TypeMap,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},

"nodes": nodeSchema(),
},
Schema: dsNodePoolSchema,
},
},

Expand Down
Loading

0 comments on commit c73e7a5

Please sign in to comment.