chainguard-dev / chainguard-dev/tw

tw/commands: add a new functionality or tool to expect a particular Pods to spin up in a certain period

Open
#30 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2
Forks
36
Avg merge
4h 36m
Merged PRs (30d)
6

Description

Some Kubernetes Operators spins up Pods after we apply Custom Resource. But it usually took a while during reconciliation and get healthy status. So the Pods don’t exist yet for a certain period.

Example:

wait_for_existence -n foo 'app.kubernetes.io/name=bar' --timeout=5m

This command would execute the followings in order:

  1. Set timeout to N seconds and interval to M seconds
  2. Loop until timeout is reached
  3. Brute-force get pod status with kubectl get pods with selection filter
  4. If no pods exist yet, print waiting message
  5. If pods exist (on matching), check for Running status with kubectl wait
  6. If a match is found, and healthy, print success message and exit
  7. Otherwise, print waiting message
  8. Sleep for the interval and increment elapsed time
  9. timeout is reached, print failure message and exit

cc @joshrwolf

Fun fact: This is the FIRST ISSUE!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the tw/commands entry points and existing command patterns. Implement the described polling flow for a namespace, label selector, interval, and timeout, then verify that it waits for matching Pods to become Running and reports success or failure as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cli, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.