Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -925,9 +925,12 @@ func TestLookupGuestOS(t *testing.T) {
},
"v2 unknown guest OS leaves scan OS empty": {
v2Enabled: true,
v2VM: &storage.VirtualMachineV2{GuestOs: pkgVM.UnknownGuestOS},
v2Found: true,
wantOS: "",
v2VM: &storage.VirtualMachineV2{
GuestOs: pkgVM.UnknownGuestOS,
Facts: map[string]string{pkgVM.GuestOSKey: pkgVM.UnknownGuestOS},
},
v2Found: true,
wantOS: "",
},
"v1 store error leaves scan OS empty": {
v1Err: errors.New("db error"),
Expand Down
6 changes: 5 additions & 1 deletion sensor/common/virtualmachine/vmscraper/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,15 @@ func (s *VMScraper) reconcile() {
liveKeys.Add(key)
st, ok := s.vmState[key]
if !ok {
nextAt := now.Add(randOffset(newVMWindow, s.randFloat64()))
st = &vmState{
nextAttemptAt: now.Add(randOffset(newVMWindow, s.randFloat64())),
nextAttemptAt: nextAt,
vmID: vm.ID,
mappingPath: metrics.MappingPathUnspecified,
}
s.vmState[key] = st
log.Infof("VMScraper: queued %q for first index pull in %s (spread window %s)",
key, nextAt.Sub(now), newVMWindow)
} else if st.vmID != vm.ID {
// namespace/name can outlive a KubeVirt recreate; do not inherit scrape state.
st = &vmState{
Expand All @@ -426,6 +429,7 @@ func (s *VMScraper) reconcile() {
mappingPath: metrics.MappingPathUnspecified,
}
s.vmState[key] = st
log.Infof("VMScraper: re-queued %q for index pull (VM identity changed)", key)
}
}
for key := range s.vmState {
Expand Down
Loading