mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
Update GCP metadata provider
Signed-off-by: Preston Holmes <preston@ptone.com>
This commit is contained in:
parent
bdf1d0558f
commit
d11404ca97
@ -53,7 +53,7 @@ func (p *ProviderGCP) Extract() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generic userdata
|
// Generic userdata
|
||||||
userData, err := gcpGet(instance + "attributes/userdata")
|
userData, err := gcpGet(instance + "attributes/user-data")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("GCP: Failed to get user-data: %s", err)
|
log.Printf("GCP: Failed to get user-data: %s", err)
|
||||||
// This is not an error
|
// This is not an error
|
||||||
@ -102,8 +102,10 @@ func (p *ProviderGCP) handleSSH() error {
|
|||||||
return fmt.Errorf("Failed to get sshKeys: %s", err)
|
return fmt.Errorf("Failed to get sshKeys: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.Mkdir(path.Join(ConfigPath, SSH), 0755); err != nil {
|
if _, err := os.Stat(path.Join(ConfigPath, SSH)); os.IsNotExist(err) {
|
||||||
return fmt.Errorf("Failed to create %s: %s", SSH, err)
|
if err := os.Mkdir(path.Join(ConfigPath, SSH), 0755); err != nil {
|
||||||
|
return fmt.Errorf("Failed to create %s: %s", SSH, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootKeys := ""
|
rootKeys := ""
|
||||||
|
Loading…
Reference in New Issue
Block a user