Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
eb32bf55
Commit
eb32bf55
authored
May 17, 2016
by
Davide Agnello
Committed by
Davide Agnello
Jun 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding support for lbaas-v2 in OpenStack Cloud Provider
parent
8d510898
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
9 deletions
+37
-9
openstack.go
pkg/cloudprovider/providers/openstack/openstack.go
+0
-0
openstack_loadbalancer.go
...oudprovider/providers/openstack/openstack_loadbalancer.go
+0
-0
openstack_test.go
pkg/cloudprovider/providers/openstack/openstack_test.go
+37
-9
No files found.
pkg/cloudprovider/providers/openstack/openstack.go
View file @
eb32bf55
This diff is collapsed.
Click to expand it.
pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go
0 → 100644
View file @
eb32bf55
This diff is collapsed.
Click to expand it.
pkg/cloudprovider/providers/openstack/openstack_test.go
View file @
eb32bf55
...
...
@@ -67,15 +67,15 @@ func TestReadConfig(t *testing.T) {
}
cfg
,
err
:=
readConfig
(
strings
.
NewReader
(
`
[Global]
auth-url = http://auth.url
username = user
[LoadBalancer]
create-monitor = yes
monitor-delay = 1m
monitor-timeout = 30s
monitor-max-retries = 3
`
))
[Global]
auth-url = http://auth.url
username = user
[LoadBalancer]
create-monitor = yes
monitor-delay = 1m
monitor-timeout = 30s
monitor-max-retries = 3
`
))
if
err
!=
nil
{
t
.
Fatalf
(
"Should succeed when a valid config is provided: %s"
,
err
)
}
...
...
@@ -204,6 +204,8 @@ func TestLoadBalancer(t *testing.T) {
t
.
Skipf
(
"No config found in environment"
)
}
cfg
.
LoadBalancer
.
LBVersion
=
"v2"
os
,
err
:=
newOpenStack
(
cfg
)
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to construct/authenticate OpenStack: %s"
,
err
)
...
...
@@ -223,6 +225,32 @@ func TestLoadBalancer(t *testing.T) {
}
}
func
TestLoadBalancerV2
(
t
*
testing
.
T
)
{
cfg
,
ok
:=
configFromEnv
()
if
!
ok
{
t
.
Skipf
(
"No config found in environment"
)
}
cfg
.
LoadBalancer
.
LBVersion
=
"v2"
os
,
err
:=
newOpenStack
(
cfg
)
if
err
!=
nil
{
t
.
Fatalf
(
"Failed to construct/authenticate OpenStack: %s"
,
err
)
}
lbaas
,
ok
:=
os
.
LoadBalancer
()
if
!
ok
{
t
.
Fatalf
(
"LoadBalancer() returned false - perhaps your stack doesn't support Neutron?"
)
}
_
,
exists
,
err
:=
lbaas
.
GetLoadBalancer
(
&
api
.
Service
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"noexist"
}})
if
err
!=
nil
{
t
.
Fatalf
(
"GetLoadBalancer(
\"
noexist
\"
) returned error: %s"
,
err
)
}
if
exists
{
t
.
Fatalf
(
"GetLoadBalancer(
\"
noexist
\"
) returned exists"
)
}
}
func
TestZones
(
t
*
testing
.
T
)
{
os
:=
OpenStack
{
provider
:
&
gophercloud
.
ProviderClient
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment