diff --git a/pkg/cloudprovider/providers/openstack/metadata.go b/pkg/cloudprovider/providers/openstack/metadata.go index a69b3d81763..6ef8eb98d85 100644 --- a/pkg/cloudprovider/providers/openstack/metadata.go +++ b/pkg/cloudprovider/providers/openstack/metadata.go @@ -70,7 +70,7 @@ type DeviceMetadata struct { // See http://docs.openstack.org/user-guide/cli_config_drive.html type Metadata struct { UUID string `json:"uuid"` - Hostname string `json:"hostname"` + Name string `json:"name"` 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 53bd9532b5f..53a0da250dd 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", - Hostname: "test", + Name: "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.Hostname != "test.novalocal" { - t.Errorf("incorrect hostname: %s", md.Hostname) + if md.Name != "test" { + t.Errorf("incorrect name: %s", md.Name) } 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 d852ccb27a2..638b78508d8 100644 --- a/pkg/cloudprovider/providers/openstack/openstack_instances.go +++ b/pkg/cloudprovider/providers/openstack/openstack_instances.go @@ -61,7 +61,7 @@ func (i *Instances) CurrentNodeName(ctx context.Context, hostname string) (types if err != nil { return "", err } - return types.NodeName(md.Hostname), nil + return types.NodeName(md.Name), nil } // AddSSHKeyToAllInstances is not implemented for OpenStack