Skip to content

Commit

Permalink
kubernetes: add supported_features field to the kubernetes/options en…
Browse files Browse the repository at this point in the history
…dpoint response (#478)
  • Loading branch information
sunny-b authored Sep 22, 2021
1 parent cd7326c commit 22fcabb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
5 changes: 3 additions & 2 deletions kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,9 @@ type KubernetesOptions struct {

// KubernetesVersion is a DigitalOcean Kubernetes release.
type KubernetesVersion struct {
Slug string `json:"slug,omitempty"`
KubernetesVersion string `json:"kubernetes_version,omitempty"`
Slug string `json:"slug,omitempty"`
KubernetesVersion string `json:"kubernetes_version,omitempty"`
SupportedFeatures []string `json:"supported_features,omitempty"`
}

// KubernetesNodeSize is a node sizes supported for Kubernetes clusters.
Expand Down
19 changes: 17 additions & 2 deletions kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,16 @@ func TestKubernetesVersions_List(t *testing.T) {

want := &KubernetesOptions{
Versions: []*KubernetesVersion{
{Slug: "1.10.0-gen0", KubernetesVersion: "1.10.0"},
{
Slug: "1.10.0-gen0",
KubernetesVersion: "1.10.0",
SupportedFeatures: []string{
"cluster-autoscaler",
"docr-integration",
"ha-control-plane",
"token-authentication",
},
},
},
Regions: []*KubernetesRegion{
{Name: "New York 3", Slug: "nyc3"},
Expand All @@ -1587,7 +1596,13 @@ func TestKubernetesVersions_List(t *testing.T) {
"versions": [
{
"slug": "1.10.0-gen0",
"kubernetes_version": "1.10.0"
"kubernetes_version": "1.10.0",
"supported_features": [
"cluster-autoscaler",
"docr-integration",
"ha-control-plane",
"token-authentication"
]
}
],
"regions": [
Expand Down

0 comments on commit 22fcabb

Please sign in to comment.