Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/v1/task/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ type View struct {

// Task represents task's type.
Type Type `json:"-"`

// NodeGroupID contains node group identifier. It can be empty.
NodeGroupID string `json:"nodegroup_id,omitempty"`
}

func (result *View) UnmarshalJSON(b []byte) error {
Expand Down
48 changes: 27 additions & 21 deletions pkg/v1/task/testing/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,17 @@ const testListTasksResponseRaw = `
"started_at": "2020-02-19T11:43:02.868387Z",
"status": "DONE",
"type": "NODE_GROUP_RESIZE",
"updated_at": "2020-02-19T11:43:02.868387Z"
"updated_at": "2020-02-19T11:43:02.868387Z",
"nodegroup_id":"9e714bc6-3815-4af5-9c94-f1560e87641a"
},
{
"cluster_id": "d2e16a48-a9c5-4449-9b71-81f21fc872db",
"id": "5f8fb93c-cf9e-4289-a78c-34393ac75f92",
"started_at": "2020-02-19T11:43:02.868387Z",
"status": "DONE",
"type": "NODE_REINSTALL",
"updated_at": "2020-02-19T11:43:02.868387Z"
"updated_at": "2020-02-19T11:43:02.868387Z",
"nodegroup_id":"9e714bc6-3815-4af5-9c94-f1560e87641a"
},
{
"cluster_id": "d2e16a48-a9c5-4449-9b71-81f21fc872db",
Expand Down Expand Up @@ -124,7 +126,8 @@ const testListTasksResponseRaw = `
"started_at": "2020-02-19T11:43:02.868387Z",
"status": "IN_PROGRESS",
"type": "UPDATE_NODEGROUP_LABELS",
"updated_at": "2020-02-19T11:43:02.868387Z"
"updated_at": "2020-02-19T11:43:02.868387Z",
"nodegroup_id":"9e714bc6-3815-4af5-9c94-f1560e87641a"
},
{
"cluster_id": "d2e16a48-a9c5-4449-9b71-81f21fc872db",
Expand Down Expand Up @@ -173,20 +176,22 @@ var expectedListTasksResponse = []*task.View{
Type: task.TypeRotateCerts,
},
{
ID: "4f8fb93c-cf9e-4289-a78c-34393ac75f92",
StartedAt: &taskResponseTimestamp,
UpdatedAt: &taskResponseTimestamp,
ClusterID: "d2e16a48-a9c5-4449-9b71-81f21fc872db",
Status: task.StatusDone,
Type: task.TypeNodeGroupResize,
ID: "4f8fb93c-cf9e-4289-a78c-34393ac75f92",
StartedAt: &taskResponseTimestamp,
UpdatedAt: &taskResponseTimestamp,
ClusterID: "d2e16a48-a9c5-4449-9b71-81f21fc872db",
Status: task.StatusDone,
Type: task.TypeNodeGroupResize,
NodeGroupID: "9e714bc6-3815-4af5-9c94-f1560e87641a",
},
{
ID: "5f8fb93c-cf9e-4289-a78c-34393ac75f92",
StartedAt: &taskResponseTimestamp,
UpdatedAt: &taskResponseTimestamp,
ClusterID: "d2e16a48-a9c5-4449-9b71-81f21fc872db",
Status: task.StatusDone,
Type: task.TypeNodeReinstall,
ID: "5f8fb93c-cf9e-4289-a78c-34393ac75f92",
StartedAt: &taskResponseTimestamp,
UpdatedAt: &taskResponseTimestamp,
ClusterID: "d2e16a48-a9c5-4449-9b71-81f21fc872db",
Status: task.StatusDone,
Type: task.TypeNodeReinstall,
NodeGroupID: "9e714bc6-3815-4af5-9c94-f1560e87641a",
},
{
ID: "6f8fb93c-cf9e-4289-a78c-34393ac75f92",
Expand All @@ -213,12 +218,13 @@ var expectedListTasksResponse = []*task.View{
Type: task.TypeUpgradeMinorVersion,
},
{
ID: "7f8fb93c-cf9e-4289-a78c-34393ac75f92",
StartedAt: &taskResponseTimestamp,
UpdatedAt: &taskResponseTimestamp,
ClusterID: "d2e16a48-a9c5-4449-9b71-81f21fc872db",
Status: task.StatusInProgress,
Type: task.TypeUpdateNodegroupLabels,
ID: "7f8fb93c-cf9e-4289-a78c-34393ac75f92",
StartedAt: &taskResponseTimestamp,
UpdatedAt: &taskResponseTimestamp,
ClusterID: "d2e16a48-a9c5-4449-9b71-81f21fc872db",
Status: task.StatusInProgress,
Type: task.TypeUpdateNodegroupLabels,
NodeGroupID: "9e714bc6-3815-4af5-9c94-f1560e87641a",
},
{
ID: "7f8fb93c-cf9e-4289-a78c-34393ac75f92",
Expand Down
Loading