Skip to content

Enhance k8s.wait to support jsonpath conditions and delete waiting #9

Description

@Cali0707

Description

Enhance the existing k8s.wait operation to support additional wait conditions beyond the current condition: Ready support. Tasks like resize-pvc and statefulset-lifecycle require waiting for jsonpath-based conditions or waiting for resource deletion.

Current bash tasks use patterns like:

  • kubectl wait --for=jsonpath='{.spec.capacity.storage}'='15Gi' pv/$PV_NAME
  • kubectl wait pod/db-1 pod/db-2 -n namespace --for=delete

Requirements

  • Support jsonpath-based conditions (wait until a field equals a specific value)
  • Support waiting for resource deletion
  • Maintain backward compatibility with existing condition parameter
  • Support waiting on multiple resources simultaneously

Example Usage

Wait for jsonpath value:

- k8s.wait:
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv-001
    for:
      jsonpath: spec.capacity.storage
      equals: "15Gi"
    timeout: 120s

Wait for deletion:

- k8s.wait:
    apiVersion: v1
    kind: Pod
    metadata:
      name: db-1
      namespace: statefulset-test
    for: delete
    timeout: 120s

Acceptance Criteria

  • Can wait for a jsonpath expression to equal a specific value
  • Can wait for a resource to be deleted
  • Can wait on multiple resources in a single operation
  • Existing condition: Ready and similar conditions continue to work
  • Timeout parameter works with new condition types
  • Operation documentation is updated with new condition types

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions