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
ab5250ef
Commit
ab5250ef
authored
Aug 30, 2016
by
Angus Lees
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openstack: Set GetZone FailureDomain to nova AZ
Set FailureDomain in GetZone result to value of availability_zone in local instance metadata.
parent
8167df29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
openstack.go
pkg/cloudprovider/providers/openstack/openstack.go
+11
-2
openstack_test.go
pkg/cloudprovider/providers/openstack/openstack_test.go
+7
-0
No files found.
pkg/cloudprovider/providers/openstack/openstack.go
View file @
ab5250ef
...
...
@@ -395,9 +395,18 @@ func (os *OpenStack) Zones() (cloudprovider.Zones, bool) {
return
os
,
true
}
func
(
os
*
OpenStack
)
GetZone
()
(
cloudprovider
.
Zone
,
error
)
{
glog
.
V
(
1
)
.
Infof
(
"Current zone is %v"
,
os
.
region
)
md
,
err
:=
getMetadata
()
if
err
!=
nil
{
return
cloudprovider
.
Zone
{},
err
}
zone
:=
cloudprovider
.
Zone
{
FailureDomain
:
md
.
AvailabilityZone
,
Region
:
os
.
region
,
}
glog
.
V
(
1
)
.
Infof
(
"Current zone is %v"
,
zone
)
return
cloudprovider
.
Zone
{
Region
:
os
.
region
}
,
nil
return
zone
,
nil
}
func
(
os
*
OpenStack
)
Routes
()
(
cloudprovider
.
Routes
,
bool
)
{
...
...
pkg/cloudprovider/providers/openstack/openstack_test.go
View file @
ab5250ef
...
...
@@ -232,6 +232,9 @@ func TestLoadBalancer(t *testing.T) {
}
func
TestZones
(
t
*
testing
.
T
)
{
SetMetadataFixture
(
&
FakeMetadata
)
defer
ClearMetadata
()
os
:=
OpenStack
{
provider
:
&
gophercloud
.
ProviderClient
{
IdentityBase
:
"http://auth.url/"
,
...
...
@@ -252,6 +255,10 @@ func TestZones(t *testing.T) {
if
zone
.
Region
!=
"myRegion"
{
t
.
Fatalf
(
"GetZone() returned wrong region (%s)"
,
zone
.
Region
)
}
if
zone
.
FailureDomain
!=
"nova"
{
t
.
Fatalf
(
"GetZone() returned wrong failure domain (%s)"
,
zone
.
FailureDomain
)
}
}
func
TestVolumes
(
t
*
testing
.
T
)
{
...
...
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