diff --git a/pkg/cloudprovider/providers/openstack/metadata.go b/pkg/cloudprovider/providers/openstack/metadata.go index d3cf22d9238..6b3a34c7cdf 100644 --- a/pkg/cloudprovider/providers/openstack/metadata.go +++ b/pkg/cloudprovider/providers/openstack/metadata.go @@ -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:"hostname"` AvailabilityZone string `json:"availability_zone"` Devices []DeviceMetadata `json:"devices,omitempty"` // .. and other fields we don't care about. Expand as necessary. diff --git a/pkg/cloudprovider/providers/openstack/metadata_test.go b/pkg/cloudprovider/providers/openstack/metadata_test.go index d224a598bbb..dfdb102a342 100644 --- a/pkg/cloudprovider/providers/openstack/metadata_test.go +++ b/pkg/cloudprovider/providers/openstack/metadata_test.go @@ -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.Name) + if md.Hostname != "test.novalocal" { + t.Errorf("incorrect hostname: %s", md.Hostname) } if md.Uuid != "83679162-1378-4288-a2d4-70e13ec132aa" { diff --git a/pkg/cloudprovider/providers/openstack/openstack_instances.go b/pkg/cloudprovider/providers/openstack/openstack_instances.go index c1031e4f5e9..51d177a638d 100644 --- a/pkg/cloudprovider/providers/openstack/openstack_instances.go +++ b/pkg/cloudprovider/providers/openstack/openstack_instances.go @@ -58,7 +58,7 @@ func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error) { if err != nil { return "", err } - return types.NodeName(md.Name), nil + return types.NodeName(md.Hostname), nil } func (i *Instances) AddSSHKeyToAllInstances(user string, keyData []byte) error {