mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Fix deleting UIDs tracking expectations
Change-Id: I5dad644cf5cb232ebed0950a14b35a781a38eeb0
This commit is contained in:
parent
bd9444c1cf
commit
c1e0dac461
@ -105,8 +105,11 @@ func (u *uidTrackingExpectations) finalizerRemovalObserved(jobKey, deleteKey str
|
|||||||
|
|
||||||
// DeleteExpectations deletes the UID set.
|
// DeleteExpectations deletes the UID set.
|
||||||
func (u *uidTrackingExpectations) deleteExpectations(jobKey string) {
|
func (u *uidTrackingExpectations) deleteExpectations(jobKey string) {
|
||||||
if err := u.store.Delete(jobKey); err != nil {
|
set := u.getSet(jobKey)
|
||||||
klog.ErrorS(err, "deleting tracking annotation UID expectations", "job", jobKey)
|
if set != nil {
|
||||||
|
if err := u.store.Delete(set); err != nil {
|
||||||
|
klog.ErrorS(err, "Could not delete tracking annotation UID expectations", "job", jobKey)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,4 +108,11 @@ func TestUIDTrackingExpectations(t *testing.T) {
|
|||||||
t.Errorf("Unexpected keys for job %s (-want,+got):\n%s", track.job, diff)
|
t.Errorf("Unexpected keys for job %s (-want,+got):\n%s", track.job, diff)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for _, track := range tracks {
|
||||||
|
expectations.deleteExpectations(track.job)
|
||||||
|
uids := expectations.getSet(track.job)
|
||||||
|
if uids != nil {
|
||||||
|
t.Errorf("Wanted expectations for job %s to be cleared, but they were not", track.job)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user