Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Kubernetes nodepool tags #164

Merged
merged 3 commits into from Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion kubernetes.go
Expand Up @@ -62,6 +62,7 @@ type NodePool struct {
Plan string `json:"plan"`
Status string `json:"status"`
NodeQuantity int `json:"node_quantity"`
Tag string `json:"tag"`
Nodes []Node `json:"nodes"`
}

Expand Down Expand Up @@ -96,11 +97,13 @@ type NodePoolReq struct {
NodeQuantity int `json:"node_quantity"`
Label string `json:"label"`
Plan string `json:"plan"`
Tag string `json:"tag"`
}

// NodePoolReqUpdate struct used to update a node pool
type NodePoolReqUpdate struct {
NodeQuantity int `json:"node_quantity"`
NodeQuantity int `json:"node_quantity,omitempty"`
Tag string `json:"tag,omitempty"`
}

type vkeClustersBase struct {
Expand Down
11 changes: 11 additions & 0 deletions kubernetes_test.go
Expand Up @@ -215,6 +215,7 @@ func TestKubernetesHandler_ListClusters(t *testing.T) {
"label": "my-label-48957292",
"plan": "vc2-1c-2gb",
"status": "pending",
"tag": "mytag",
"node_quantity": 1,
"nodes": [
{
Expand Down Expand Up @@ -263,6 +264,7 @@ func TestKubernetesHandler_ListClusters(t *testing.T) {
Label: "my-label-48957292",
Plan: "vc2-1c-2gb",
Status: "pending",
Tag: "mytag",
NodeQuantity: 1,
Nodes: []Node{
{
Expand Down Expand Up @@ -355,6 +357,7 @@ func TestKubernetesHandler_CreateNodePool(t *testing.T) {
"plan": "vc2-1c-2gb",
"status": "pending",
"node_quantity": 1,
"tag": "mytag",
"nodes": [
{
"id": "3e1ca1e0-25be-4977-907a-3dee42b9bb15",
Expand All @@ -372,6 +375,7 @@ func TestKubernetesHandler_CreateNodePool(t *testing.T) {
NodeQuantity: 1,
Label: "nodepool-48959140",
Plan: "vc2-1c-2gb",
Tag: "mytag",
}
np, err := client.Kubernetes.CreateNodePool(ctx, "1", createReq)
if err != nil {
Expand All @@ -385,6 +389,7 @@ func TestKubernetesHandler_CreateNodePool(t *testing.T) {
Plan: "vc2-1c-2gb",
Status: "pending",
NodeQuantity: 1,
Tag: "mytag",
Nodes: []Node{
{
ID: "3e1ca1e0-25be-4977-907a-3dee42b9bb15",
Expand Down Expand Up @@ -420,6 +425,7 @@ func TestKubernetesHandler_GetNodePool(t *testing.T) {
"plan": "vc2-1c-2gb",
"status": "pending",
"node_quantity": 1,
"tag": "mytag",
"nodes": [
{
"id": "3e1ca1e0-25be-4977-907a-3dee42b9bb15",
Expand All @@ -444,6 +450,7 @@ func TestKubernetesHandler_GetNodePool(t *testing.T) {
Label: "nodepool-48959140",
Plan: "vc2-1c-2gb",
Status: "pending",
Tag: "mytag",
NodeQuantity: 1,
Nodes: []Node{
{
Expand Down Expand Up @@ -480,6 +487,7 @@ func TestKubernetesHandler_ListNodePools(t *testing.T) {
"plan": "vc2-1c-2gb",
"status": "pending",
"node_quantity": 1,
"tag": "mytag",
"nodes": [
{
"id": "3e1ca1e0-25be-4977-907a-3dee42b9bb15",
Expand Down Expand Up @@ -512,6 +520,7 @@ func TestKubernetesHandler_ListNodePools(t *testing.T) {
Label: "nodepool-48959140",
Plan: "vc2-1c-2gb",
Status: "pending",
Tag: "mytag",
NodeQuantity: 1,
Nodes: []Node{
{
Expand Down Expand Up @@ -562,6 +571,7 @@ func TestKubernetesHandler_UpdateNodePool(t *testing.T) {
"plan": "vc2-1c-2gb",
"status": "active",
"node_quantity": 1,
"tag": "mytag",
"nodes": [
{
"id": "f2e11430-76e5-4dc6-a1c9-ef5682c21ddf",
Expand All @@ -588,6 +598,7 @@ func TestKubernetesHandler_UpdateNodePool(t *testing.T) {
Plan: "vc2-1c-2gb",
Status: "active",
NodeQuantity: 1,
Tag: "mytag",
Nodes: []Node{
{
ID: "f2e11430-76e5-4dc6-a1c9-ef5682c21ddf",
Expand Down