feat: add kubernetes-test package with wait-for-pods functionality #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: add kubernetes-test package with wait-for-pods functionality
Summary
Adds a new
kubernetes-testpackage to the dev-utils monorepo that provides Kubernetes testing utilities. The initial implementation includes awaitForPodsfunction that polls the Kubernetes API until pods reach a ready state, with configurable timeout, polling interval, and label/field selectors.Key features:
waitForPods()- Wait for pods matching selectors to become readywaitForPodByName()- Convenience wrapper for waiting on a specific podwaitForPodsWithLabel()- Convenience wrapper for label-based selectionWaitForPodsTimeoutError,WaitForPodsError) with progress informationUses
kubernetesjsfor K8s API types and client interactions.Updates since last revision
@interweb/kubernetes-testtokubernetes-test(removed scope per user request)Review & Testing Checklist for Human
wait-for-pods.ts: Thewhile (true)loop with timeout check - verify edge cases are handled (e.g., what if pods never appear, what if namespace doesn't exist)listCoreV1NamespacedPodcall uses{ path: { namespace }, query: { labelSelector, fieldSelector } }structure - confirm this matches kubernetesjs expectationsRecommended Test Plan
kubectl proxylocallywaitForPods()with appropriate selectors and verify it returns when pods are readyNotes
Requested by: Dan Lynch (@pyramation)
Devin session: https://app.devin.ai/sessions/fb12157dbe184b43bb018c1aa54508a0