Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s: update pod status logic to support native sidecars #3169

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

scarlettperry
Copy link
Contributor

@scarlettperry scarlettperry commented Nov 5, 2024

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

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 command.

Testing Performed

Existing unit tests
Manual

@scarlettperry scarlettperry marked this pull request as ready for review November 5, 2024 19:47
@scarlettperry scarlettperry requested a review from a team as a code owner November 5, 2024 19:47
@scarlettperry scarlettperry merged commit 8471558 into main Nov 5, 2024
7 checks passed
@scarlettperry scarlettperry deleted the sperry-native-sidecars branch November 5, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants