mirror of https://github.com/kubernetes/kops.git
Don't try to add node name to instances without node object
This commit is contained in:
parent
97b63d2fd4
commit
321f82368d
|
|
@ -56,7 +56,7 @@ var (
|
|||
|
||||
type renderableCloudInstance struct {
|
||||
ID string `json:"id"`
|
||||
NodeName string `json:"nodeName"`
|
||||
NodeName string `json:"nodeName,omitempty"`
|
||||
Status string `json:"status"`
|
||||
Roles []string `json:"roles"`
|
||||
InternalIP string `json:"internalIP"`
|
||||
|
|
@ -217,7 +217,6 @@ func asRenderable(instances []*cloudinstances.CloudInstance) []*renderableCloudI
|
|||
for i, ci := range instances {
|
||||
arr[i] = &renderableCloudInstance{
|
||||
ID: ci.ID,
|
||||
NodeName: ci.Node.Name,
|
||||
Status: ci.Status,
|
||||
Roles: ci.Roles,
|
||||
InternalIP: ci.PrivateIP,
|
||||
|
|
@ -225,6 +224,9 @@ func asRenderable(instances []*cloudinstances.CloudInstance) []*renderableCloudI
|
|||
MachineType: ci.MachineType,
|
||||
State: string(ci.State),
|
||||
}
|
||||
if ci.Node != nil {
|
||||
arr[i].NodeName = ci.Node.Name
|
||||
}
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue