mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
ovirt: report the nodes external id
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
parent
a450da4fd0
commit
1fc56aa023
@ -34,6 +34,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type OVirtInstance struct {
|
type OVirtInstance struct {
|
||||||
|
UUID string
|
||||||
Name string
|
Name string
|
||||||
IPAddress string
|
IPAddress string
|
||||||
}
|
}
|
||||||
@ -61,6 +62,7 @@ type XmlVmAddress struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type XmlVmInfo struct {
|
type XmlVmInfo struct {
|
||||||
|
UUID string `xml:"id,attr"`
|
||||||
Name string `xml:"name"`
|
Name string `xml:"name"`
|
||||||
Hostname string `xml:"guest_info>fqdn"`
|
Hostname string `xml:"guest_info>fqdn"`
|
||||||
Addresses []XmlVmAddress `xml:"guest_info>ips>ip"`
|
Addresses []XmlVmAddress `xml:"guest_info>ips>ip"`
|
||||||
@ -155,7 +157,11 @@ func (v *OVirtCloud) IPAddress(name string) (net.IP, error) {
|
|||||||
|
|
||||||
// ExternalID returns the cloud provider ID of the specified instance.
|
// ExternalID returns the cloud provider ID of the specified instance.
|
||||||
func (v *OVirtCloud) ExternalID(name string) (string, error) {
|
func (v *OVirtCloud) ExternalID(name string) (string, error) {
|
||||||
return "", fmt.Errorf("unimplemented")
|
instance, err := v.fetchInstance(name)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return instance.UUID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getInstancesFromXml(body io.Reader) (OVirtInstanceMap, error) {
|
func getInstancesFromXml(body io.Reader) (OVirtInstanceMap, error) {
|
||||||
@ -185,6 +191,7 @@ func getInstancesFromXml(body io.Reader) (OVirtInstanceMap, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
instances[vm.Hostname] = OVirtInstance{
|
instances[vm.Hostname] = OVirtInstance{
|
||||||
|
UUID: vm.UUID,
|
||||||
Name: vm.Name,
|
Name: vm.Name,
|
||||||
IPAddress: address,
|
IPAddress: address,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user