Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
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
9 changes: 9 additions & 0 deletions openstack/cce/v3/clusters/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ type Spec struct {
HostNetwork HostNetworkSpec `json:"hostNetwork" required:"true"`
//Container network parameters
ContainerNetwork ContainerNetworkSpec `json:"containerNetwork" required:"true"`
//ENI network parameters
EniNetwork EniNetworkSpec `json:"eniNetwork,omitempty"`
//Authentication parameters
Authentication AuthenticationSpec `json:"authentication,omitempty"`
// Charging mode of the cluster, which is 0 (on demand)
Expand Down Expand Up @@ -89,6 +91,13 @@ type ContainerNetworkSpec struct {
Cidr string `json:"cidr,omitempty"`
}

type EniNetworkSpec struct {
//Eni network subnet id
SubnetId string `json:"eniSubnetId" required:"true"`
//Eni network cidr
Cidr string `json:"eniSubnetCIDR" required:"true"`
}

//Authentication parameters
type AuthenticationSpec struct {
//Authentication mode: rbac , x509 or authenticating_proxy
Expand Down
8 changes: 8 additions & 0 deletions openstack/cce/v3/clusters/testing/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const Output = `
"containerNetwork": {
"mode": "overlay_l2"
},
"eniNetwork": {
"eniSubnetCIDR": "192.168.2.0/24",
"eniSubnetId": "fb8f0799-94a7-4ea3-99ca-1d9c3c8d1526"
},
"billingMode": 0
},
"status": {
Expand Down Expand Up @@ -86,6 +90,10 @@ var Expected = &clusters.Clusters{
ContainerNetwork: clusters.ContainerNetworkSpec{
Mode: "overlay_l2",
},
EniNetwork: clusters.EniNetworkSpec{
SubnetId: "fb8f0799-94a7-4ea3-99ca-1d9c3c8d1526",
Cidr: "192.168.2.0/24",
},
BillingMode: 0,
},
Status: clusters.Status{
Expand Down
10 changes: 9 additions & 1 deletion openstack/cce/v3/clusters/testing/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ func TestCreateV3Cluster(t *testing.T) {
},
"containerNetwork": {
"mode": "overlay_l2"
},
},
"eniNetwork": {
"eniSubnetCIDR": "192.168.2.0/24",
"eniSubnetId": "fb8f0799-94a7-4ea3-99ca-1d9c3c8d1526"
},
"authentication": {
"mode": "rbac",
"authenticatingProxy": {}
Expand All @@ -153,6 +157,10 @@ func TestCreateV3Cluster(t *testing.T) {
VpcId: "3305eb40-2707-4940-921c-9f335f84a2ca",
SubnetId: "00e41db7-e56b-4946-bf91-27bb9effd664"},
ContainerNetwork: clusters.ContainerNetworkSpec{Mode: "overlay_l2"},
EniNetwork: clusters.EniNetworkSpec{
SubnetId: "fb8f0799-94a7-4ea3-99ca-1d9c3c8d1526",
Cidr: "192.168.2.0/24",
},
Authentication: clusters.AuthenticationSpec{
Mode: "rbac",
AuthenticatingProxy: make(map[string]string)},
Expand Down