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
eaac0f54
Commit
eaac0f54
authored
Jan 19, 2018
by
Di Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Openstack: register metadata.hostname as node name
parent
0770ef06
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
metadata.go
pkg/cloudprovider/providers/openstack/metadata.go
+1
-1
metadata_test.go
pkg/cloudprovider/providers/openstack/metadata_test.go
+3
-3
openstack_instances.go
pkg/cloudprovider/providers/openstack/openstack_instances.go
+1
-1
No files found.
pkg/cloudprovider/providers/openstack/metadata.go
View file @
eaac0f54
...
...
@@ -69,7 +69,7 @@ type DeviceMetadata struct {
// See http://docs.openstack.org/user-guide/cli_config_drive.html
type
Metadata
struct
{
Uuid
string
`json:"uuid"`
Name
string
`json:"
name"`
Hostname
string
`json:"host
name"`
AvailabilityZone
string
`json:"availability_zone"`
Devices
[]
DeviceMetadata
`json:"devices,omitempty"`
// .. and other fields we don't care about. Expand as necessary.
...
...
pkg/cloudprovider/providers/openstack/metadata_test.go
View file @
eaac0f54
...
...
@@ -23,7 +23,7 @@ import (
var
FakeMetadata
=
Metadata
{
Uuid
:
"83679162-1378-4288-a2d4-70e13ec132aa"
,
Name
:
"test"
,
Hostname
:
"test"
,
AvailabilityZone
:
"nova"
,
}
...
...
@@ -81,8 +81,8 @@ func TestParseMetadata(t *testing.T) {
t
.
Fatalf
(
"Should succeed when provided with valid data: %s"
,
err
)
}
if
md
.
Name
!=
"test
"
{
t
.
Errorf
(
"incorrect
name: %s"
,
md
.
N
ame
)
if
md
.
Hostname
!=
"test.novalocal
"
{
t
.
Errorf
(
"incorrect
hostname: %s"
,
md
.
Hostn
ame
)
}
if
md
.
Uuid
!=
"83679162-1378-4288-a2d4-70e13ec132aa"
{
...
...
pkg/cloudprovider/providers/openstack/openstack_instances.go
View file @
eaac0f54
...
...
@@ -58,7 +58,7 @@ func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error) {
if
err
!=
nil
{
return
""
,
err
}
return
types
.
NodeName
(
md
.
N
ame
),
nil
return
types
.
NodeName
(
md
.
Hostn
ame
),
nil
}
func
(
i
*
Instances
)
AddSSHKeyToAllInstances
(
user
string
,
keyData
[]
byte
)
error
{
...
...
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