Skip to content

Commit 53aa895

Browse files
authored
fix: update KVM host OS version retrieval to use status field (#872)
1 parent efaee78 commit 53aa895

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

internal/knowledge/kpis/plugins/infrastructure/shared.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (h kvmHost) getHostLabels() []string {
102102
buildingBlock = parts[1]
103103
}
104104

105-
osVersion := h.Spec.OperatingSystemVersion
105+
osVersion := h.Status.OperatingSystem.Version
106106
if osVersion == "" {
107107
osVersion = "unknown"
108108
}

internal/knowledge/kpis/plugins/infrastructure/shared_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func TestKVMHost_GetHostLabels(t *testing.T) {
206206
name: "os version set",
207207
host: kvmHost{hv1.Hypervisor{
208208
ObjectMeta: metav1.ObjectMeta{Name: "node001-bb01"},
209-
Spec: hv1.HypervisorSpec{OperatingSystemVersion: "1.1.1"},
209+
Status: hv1.HypervisorStatus{OperatingSystem: hv1.OperatingSystemStatus{Version: "1.1.1"}},
210210
}},
211211
want: []string{"node001-bb01", "unknown", "bb01", "cascade-lake", "general-purpose", "true", "false", "false", "false", "1.1.1"},
212212
},

0 commit comments

Comments
 (0)