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

fix(k8s): attempt execing on running pod #5782

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion core/src/plugins/kubernetes/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,14 @@ export async function execInWorkload({
const api = await KubeApi.factory(log, ctx, provider)
const pods = await getCurrentWorkloadPods(api, namespace, workload)

const pod = pods[0]
const runningPods = pods.filter((p) => checkPodStatus(p) === "ready")
if (runningPods.length === 0) {
throw new DeploymentError({
message: `No running pods found for ${getResourceKey(workload)}`,
})
}

const pod = sample(runningPods)

if (!pod) {
// This should not happen because of the prior status check, but checking to be sure
Expand Down