From 096e191b97f277db8fb863895a3df604401e08b5 Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Tue, 20 Aug 2019 17:34:12 +0800 Subject: [PATCH 1/2] Add cce node userPassword --- openstack/cce/v3/nodes/results.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openstack/cce/v3/nodes/results.go b/openstack/cce/v3/nodes/results.go index fb1d453f1..f223d7c74 100644 --- a/openstack/cce/v3/nodes/results.go +++ b/openstack/cce/v3/nodes/results.go @@ -86,7 +86,14 @@ type Status struct { type LoginSpec struct { // Select the key pair name when logging in by key pair mode - SshKey string `json:"sshKey" required:"true"` + SshKey string `json:"sshKey,omitempty"` + // Select the user/password when logging in + UserPassword UserPassword `json:"userPassword,omitempty"` +} + +type UserPassword struct { + Username string `json:"username" required:"true"` + Password string `json:"password" required:"true"` } type VolumeSpec struct { From d7d9ea1cbd85eacbccdc30b93bfe95541b6c7a31 Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Wed, 21 Aug 2019 11:49:36 +0800 Subject: [PATCH 2/2] Fix tests --- openstack/cce/v3/nodes/testing/requests_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openstack/cce/v3/nodes/testing/requests_test.go b/openstack/cce/v3/nodes/testing/requests_test.go index 02f4c3801..9e2a603a2 100644 --- a/openstack/cce/v3/nodes/testing/requests_test.go +++ b/openstack/cce/v3/nodes/testing/requests_test.go @@ -148,7 +148,11 @@ func TestCreateV3Node(t *testing.T) { ], "flavor": "s3.large.2", "login": { - "sshKey": "test-keypair" + "sshKey": "test-keypair", + "userPassword": { + "password": "", + "username": "" + } }, "publicIP": { "eip": {