Graduate the feature to beta, by:
- Allowing `subPath`/`subPathExpr` for image volumes
- Modifying the CRI to pass down the (resolved) sub path
- Adding metrics which are outlined in the KEP
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This adds LegacySidecarContainers feature gate that enables the legacy
code path that predates the SidecarContainers feature to safely remove
the code.
This temporary feature gate is disabled by default, only available in
v1.33, and will be removed in v1.34.
This fix makes doPodResizeAction() return the result instead of setting
an error to the `result` argument, which should have been passed as a
pointer, so that the error is propagated to the caller. This fix also
makes the usage of PodSyncResult more consistent with other operations
like starting and killing a container.
This fixes a regression in the SidecarContainers feature by minimizing
the impact of the new code path. Use the old code path for pods without
restartable init containers, and apply the new code path only to pods
with restartable init containers.
The main sync loop should have created and started the container in one
step. If the init container is in the 'created' state, it's likely that
the container runtime failed to start it. To prevent the container from
getting stuck in the 'created' state, restart it.
When evaluating whether a container ran to completion,
we only check whether the CRI container status `ExitCode` is 0.
But, the ExitCode is only meaningful if the container has actually
run and exited.
There are other states, eg: `Created` where the container runtime never
set an ExitCode - we shouldn't read it in that case.
- Implement `computeInitContainerActions` to sets the actions for the
init containers, including those with `RestartPolicyAlways`.
- Allow StartupProbe on the restartable init containers.
- Update PodPhase considering the restartable init containers.
- Update PodInitialized status and status manager considering the
restartable init containers.
Co-authored-by: Matthias Bertschy <matthias.bertschy@gmail.com>
InPlace Pod Vertical Scaling has been introduced as a feature recently,
and with it new unit tests. The feature does not have Windows support
yet, thus, the unit tests fail on Windows.
Fixes unit test which checks Linux-specific fields on Windows.