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
bf8ebde4
Commit
bf8ebde4
authored
Jan 30, 2018
by
jianglingxia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct the URL of openstack and make test case more detail
parent
8d9a9dca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
metadata.go
pkg/cloudprovider/providers/openstack/metadata.go
+3
-3
metadata_test.go
pkg/cloudprovider/providers/openstack/metadata_test.go
+4
-0
No files found.
pkg/cloudprovider/providers/openstack/metadata.go
View file @
bf8ebde4
...
...
@@ -36,7 +36,7 @@ const (
// metadataUrlTemplate allows building an OpenStack Metadata service URL.
// It's a hardcoded IPv4 link-local address as documented in "OpenStack Cloud
// Administrator Guide", chapter Compute - Networking with nova-network.
//
https://docs.openstack.org/admin-guide/compute-
networking-nova.html#metadata-service
//
https://docs.openstack.org/nova/latest/admin/
networking-nova.html#metadata-service
defaultMetadataVersion
=
"2012-08-10"
metadataUrlTemplate
=
"http://169.254.169.254/openstack/%s/meta_data.json"
...
...
@@ -45,7 +45,7 @@ const (
// Config drive is defined as an iso9660 or vfat (deprecated) drive
// with the "config-2" label.
//
http://docs.openstack.org/user-guide/cli-
config-drive.html
//
https://docs.openstack.org/nova/latest/user/
config-drive.html
configDriveLabel
=
"config-2"
configDrivePathTemplate
=
"openstack/%s/meta_data.json"
...
...
@@ -66,7 +66,7 @@ type DeviceMetadata struct {
}
// Assumes the "2012-08-10" meta_data.json format.
//
See http://docs.openstack.org/user-guide/cli_config_
drive.html
//
https://docs.openstack.org/nova/latest/user/config-
drive.html
type
Metadata
struct
{
Uuid
string
`json:"uuid"`
Hostname
string
`json:"hostname"`
...
...
pkg/cloudprovider/providers/openstack/metadata_test.go
View file @
bf8ebde4
...
...
@@ -108,4 +108,8 @@ func TestParseMetadata(t *testing.T) {
if
md
.
Devices
[
0
]
.
Type
!=
"disk"
{
t
.
Errorf
(
"incorrect device type: %s"
,
md
.
Devices
[
0
]
.
Type
)
}
if
md
.
Devices
[
0
]
.
Serial
!=
"6df1888b-f373-41cf-b960-3786e60a28ef"
{
t
.
Errorf
(
"incorrect device serial: %s"
,
md
.
Devices
[
0
]
.
Serial
)
}
}
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