mirror of
https://github.com/rancher/os.git
synced 2025-10-20 23:14:30 +00:00
simplistic start
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
3
config/cloudinit/datasource/metadata/digitalocean/metadata.go
Normal file → Executable file
3
config/cloudinit/datasource/metadata/digitalocean/metadata.go
Normal file → Executable file
@@ -66,6 +66,9 @@ type MetadataService struct {
|
||||
}
|
||||
|
||||
func NewDatasource(root string) *MetadataService {
|
||||
if root == "" {
|
||||
root = DefaultAddress
|
||||
}
|
||||
return &MetadataService{Service: metadata.NewDatasource(root, apiVersion, userdataURL, metadataPath, nil)}
|
||||
}
|
||||
|
||||
|
3
config/cloudinit/datasource/metadata/ec2/metadata.go
Normal file → Executable file
3
config/cloudinit/datasource/metadata/ec2/metadata.go
Normal file → Executable file
@@ -39,6 +39,9 @@ type MetadataService struct {
|
||||
}
|
||||
|
||||
func NewDatasource(root string) *MetadataService {
|
||||
if root == "" {
|
||||
root = DefaultAddress
|
||||
}
|
||||
return &MetadataService{metadata.NewDatasource(root, apiVersion, userdataPath, metadataPath, nil)}
|
||||
}
|
||||
|
||||
|
@@ -26,9 +26,10 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
apiVersion = "computeMetadata/v1/"
|
||||
metadataPath = apiVersion
|
||||
userdataPath = apiVersion + "instance/attributes/user-data"
|
||||
DefaultAddress = "http://metadata.google.internal/"
|
||||
apiVersion = "computeMetadata/v1/"
|
||||
metadataPath = apiVersion
|
||||
userdataPath = apiVersion + "instance/attributes/user-data"
|
||||
)
|
||||
|
||||
type MetadataService struct {
|
||||
@@ -36,6 +37,9 @@ type MetadataService struct {
|
||||
}
|
||||
|
||||
func NewDatasource(root string) *MetadataService {
|
||||
if root == "" {
|
||||
root = DefaultAddress
|
||||
}
|
||||
return &MetadataService{metadata.NewDatasource(root, apiVersion, userdataPath, metadataPath, http.Header{"Metadata-Flavor": {"Google"}})}
|
||||
}
|
||||
|
||||
|
4
config/cloudinit/datasource/metadata/packet/metadata.go
Normal file → Executable file
4
config/cloudinit/datasource/metadata/packet/metadata.go
Normal file → Executable file
@@ -62,6 +62,10 @@ type MetadataService struct {
|
||||
}
|
||||
|
||||
func NewDatasource(root string) *MetadataService {
|
||||
if root == "" {
|
||||
root = DefaultAddress
|
||||
}
|
||||
|
||||
return &MetadataService{Service: metadata.NewDatasource(root, apiVersion, userdataURL, metadataPath, nil)}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user