I've not been able to trigger the flake, but it could happen:
- time.Sleep unblocks some background goroutines inside the synctest bubble.
- Those goroutines do not actually run yet.
- The main test checks for the result of those goroutines.
Adding a `synctest.Wait` ensures that all background processing is complete
because it waits for all goroutines to be durably blocked.
If the goroutine happens to log after the test has already terminated,
testing.T.Log panics. We must ensure that the goroutine has stopped before
allowing the test to terminate.
The validation code generator was failing to propagate the
StabilityLevel from the parent context when evaluating composite tags
like `+k8s:item`, `+k8s:each`, and `+k8s:subfield`. As a result, inner
validations like `+k8s:zeroOrOneOfMember` combined with `+k8s:alpha`
were not emitting `.MarkAlpha()` in the generated code.
This fix ensures the `StabilityLevel` is copied to the `subContext`
during evaluation, and adds a test case for list items using
`+k8s:alpha=+k8s:item(...)=+k8s:zeroOrOneOfMember`.
Generated code is updated accordingly.
Added podToVolumes reverse index to optimize DeletePod.
Currently we simply iterate through all the volumes and remove the pod
being deleted from there. This is inefficient and takes longer the
longer the volume list becomes.
Keeping a map pod -> volumes makes removing a pod fast. We can just jump
to the relevant volumes directly and remove the pod from there.
http.Transport to configure CAData. The `Insecure` field is now
conditionally set using apiService spec.
2. Invalidate Bad Connections: when the availability check receives an
unexpected response from the configured endpoints, a timeout, or network
dial/reachability error, the controller now forces the cached
connections inside the HTTP transport to be dropped. This avoids
scenarios where a connection is reused when moving or recreating pods
behind a node but without reaching kube-proxy properly.
3. Tests Added: Added tests to assert the overall flow behaves normally
and expectedly for such situations as we now close connections.
It was using a hardcoded timeout of 1 minute, as opposed to
framework.PodStartTimeout, which is 5 minutes, which is likely the
cause of some recent flakes.
Also, use a helper function.
This commit promotes the following validation-gen tags from alpha to beta:
- customUnique
- eachKey
- ifDisabled
- ifEnabled
- immutable
- unique
- update