Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
k8s: update pod status logic to support native sidecars (#3169)
<!--- TITLE FORMAT: "component: short description", e.g. "k8s: add pod log reader" --> ### Description A k8s sidecar is an init container that starts before the main app container and **continues to run**. This is unlike a regular init container which always runs to completion before the app container starts. **Reading** * https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/753-sidecar-containers/README.md * https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ * https://github.com/kubernetes/kubernetes/blob/66e34012255abf1bbd0956a712817dad77c69c41/pkg/printers/internalversion/printers.go#L905-L908 **PR changes** we need to account for the difference between an init sidecar container and a regular init container. * to identify which is an init sidecar container, we check for where restart policy is not nil and set to restartalways * to identify if the init sidecar is ready, we check that it has a running state and the container started is set to true. This is the same pattern as upstream [kubectl get pods](https://github.com/kubernetes/kubernetes/blob/66e34012255abf1bbd0956a712817dad77c69c41/pkg/printers/internalversion/printers.go#L905-L908) command. ### Testing Performed Existing unit tests Manual
- Loading branch information