Skip to content

Commit 5e40600

Browse files
committed
ContainerInfra: extract ID from cluster resize result
1 parent c99da27 commit 5e40600

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

openstack/containerinfra/v1/clusters/results.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ func (r UpdateResult) Extract() (string, error) {
6060
return s.UUID, err
6161
}
6262

63+
func (r ResizeResult) Extract() (string, error) {
64+
var s struct {
65+
UUID string
66+
}
67+
err := r.ExtractInto(&s)
68+
return s.UUID, err
69+
}
70+
6371
type Cluster struct {
6472
APIAddress string `json:"api_address"`
6573
COEVersion string `json:"coe_version"`

openstack/containerinfra/v1/clusters/testing/fixtures.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ func HandleDeleteClusterSuccessfully(t *testing.T) {
289289

290290
var ResizeResponse = fmt.Sprintf(`
291291
{
292-
"uuid": "%s",
293-
"node_count": 2
292+
"uuid": "%s"
294293
}`, clusterUUID)
295294

296295
func HandleResizeClusterSuccessfully(t *testing.T) {

openstack/containerinfra/v1/clusters/testing/requests_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,5 @@ func TestResizeCluster(t *testing.T) {
201201
actual, err := res.Extract()
202202
th.AssertNoErr(t, err)
203203

204-
th.AssertEquals(t, nodeCount, actual.NodeCount)
204+
th.AssertDeepEquals(t, clusterUUID, actual)
205205
}

0 commit comments

Comments
 (0)