The timed worker queue actually can have nil entries in its map if the work was
kicked off immediately. This looks like an unnecessary special case (it would
be fine to call AfterFunc with a duration <= 0 and it would do the right
thing), but to avoid more sweeping changes the fix consists of documenting this
special behavior and adding a nil check.
Normally the scheduler shouldn't schedule when there is a taint, but perhaps it
didn't know yet.
The TestEviction/update test covered this, but only failed under the right
timing conditions. The new event handler test case covers it reliably.
Events get recorded in the apiserver asynchronously, so even if the test knows
that the event has been evicted because the pod is deleted, it still has to
also check for the event to be recorded.
This caused a flake in the "Consistently" check of events.
There was one error path that led to a "controller has shut down" log
message. Other errors caused different log entries or are so unlikely (event
handler registration failure!) that they weren't checked at all.
It's clearer to let Run return an error in all cases and then log the
"controller has shut down" error at the call site. This also enables tests to
mark themselves as failed, should that ever happen.
Split out a helper to assert correct EndpointSlice hints (and extend
that helper to deal with node hints as well, including making sure
they *aren't* present when the traffic distribution mode doesn't call
for them).
Adding SharedCounters broke the test and wasn't detected in the presubmit
because the test is slow and didn't run.
We could add a "SharedCounters is empty" clause, but probably it is safer
to be less strict in the test and tolerate unknown fields. This will also
minimize the work which needs to be done in the v1beta2 PR.
"--format standard-quiet" shows log output on stderr (= klog logging) if it
occurs outside of a test (= test has leaked something). That is inconsistent
with "go test" without -v and a problem for pull-kubernetes-unit because many
tests do not clean up properly.
"pkgname-and-test-fails" hides the extra output and seems similar enough:
pkgname-and-test-fails print a line for each package and failed test output
$ gotestsum --format pkgname-and-test-fails ./test/internal/logging --count=1
✓ test/internal/logging (5.007s)
DONE 1 tests in 5.384s
This fixes the pod with restartable init containers to have a proper
phase after the pod sandbox re-creation.
Currently, the `runtime.PodStatus` cannot retrieve the active container
statuses, which are the container statuses associated with the current
pod sandbox. This adds the `ActiveContainerStatuses` to
`runtime.PodStatus`, allowing it to include the container statuses of
the current pod sandbox, and fixes the kubelet to correctly set the pod
Phase to `Pending` when no active regular containers are present.