diff --git a/internal/knowledge/kpis/plugins/infrastructure/shared.go b/internal/knowledge/kpis/plugins/infrastructure/shared.go index 079dbf006..4647cc28f 100644 --- a/internal/knowledge/kpis/plugins/infrastructure/shared.go +++ b/internal/knowledge/kpis/plugins/infrastructure/shared.go @@ -102,7 +102,7 @@ func (h kvmHost) getHostLabels() []string { buildingBlock = parts[1] } - osVersion := h.Spec.OperatingSystemVersion + osVersion := h.Status.OperatingSystem.Version if osVersion == "" { osVersion = "unknown" } diff --git a/internal/knowledge/kpis/plugins/infrastructure/shared_test.go b/internal/knowledge/kpis/plugins/infrastructure/shared_test.go index 302023ef2..68d5941f0 100644 --- a/internal/knowledge/kpis/plugins/infrastructure/shared_test.go +++ b/internal/knowledge/kpis/plugins/infrastructure/shared_test.go @@ -206,7 +206,7 @@ func TestKVMHost_GetHostLabels(t *testing.T) { name: "os version set", host: kvmHost{hv1.Hypervisor{ ObjectMeta: metav1.ObjectMeta{Name: "node001-bb01"}, - Spec: hv1.HypervisorSpec{OperatingSystemVersion: "1.1.1"}, + Status: hv1.HypervisorStatus{OperatingSystem: hv1.OperatingSystemStatus{Version: "1.1.1"}}, }}, want: []string{"node001-bb01", "unknown", "bb01", "cascade-lake", "general-purpose", "true", "false", "false", "false", "1.1.1"}, },