Revert "Openstack: register metadata.hostname as node name"
This reverts commit eaac0f5489
.
This commit is contained in:
parent
2f48ad3ff5
commit
6ab76041b7
@ -70,7 +70,7 @@ type DeviceMetadata struct {
|
|||||||
// See http://docs.openstack.org/user-guide/cli_config_drive.html
|
// See http://docs.openstack.org/user-guide/cli_config_drive.html
|
||||||
type Metadata struct {
|
type Metadata struct {
|
||||||
UUID string `json:"uuid"`
|
UUID string `json:"uuid"`
|
||||||
Hostname string `json:"hostname"`
|
Name string `json:"name"`
|
||||||
AvailabilityZone string `json:"availability_zone"`
|
AvailabilityZone string `json:"availability_zone"`
|
||||||
Devices []DeviceMetadata `json:"devices,omitempty"`
|
Devices []DeviceMetadata `json:"devices,omitempty"`
|
||||||
// .. and other fields we don't care about. Expand as necessary.
|
// .. and other fields we don't care about. Expand as necessary.
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
var FakeMetadata = Metadata{
|
var FakeMetadata = Metadata{
|
||||||
UUID: "83679162-1378-4288-a2d4-70e13ec132aa",
|
UUID: "83679162-1378-4288-a2d4-70e13ec132aa",
|
||||||
Hostname: "test",
|
Name: "test",
|
||||||
AvailabilityZone: "nova",
|
AvailabilityZone: "nova",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,8 +81,8 @@ func TestParseMetadata(t *testing.T) {
|
|||||||
t.Fatalf("Should succeed when provided with valid data: %s", err)
|
t.Fatalf("Should succeed when provided with valid data: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if md.Hostname != "test.novalocal" {
|
if md.Name != "test" {
|
||||||
t.Errorf("incorrect hostname: %s", md.Hostname)
|
t.Errorf("incorrect name: %s", md.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if md.UUID != "83679162-1378-4288-a2d4-70e13ec132aa" {
|
if md.UUID != "83679162-1378-4288-a2d4-70e13ec132aa" {
|
||||||
|
@ -61,7 +61,7 @@ func (i *Instances) CurrentNodeName(ctx context.Context, hostname string) (types
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return types.NodeName(md.Hostname), nil
|
return types.NodeName(md.Name), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddSSHKeyToAllInstances is not implemented for OpenStack
|
// AddSSHKeyToAllInstances is not implemented for OpenStack
|
||||||
|
Loading…
Reference in New Issue
Block a user