From 644855cde318d613bd43bec71160a9b9be01ab1e Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Fri, 24 May 2024 23:22:57 +0800 Subject: [PATCH] Add test for general pod pending --- .../general/testdata/pod-pending.input.yaml | 15 ++++++ .../general/testdata/pod-pending.output.yaml | 50 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 kustomize/stage/pod/general/testdata/pod-pending.input.yaml create mode 100644 kustomize/stage/pod/general/testdata/pod-pending.output.yaml diff --git a/kustomize/stage/pod/general/testdata/pod-pending.input.yaml b/kustomize/stage/pod/general/testdata/pod-pending.input.yaml new file mode 100644 index 000000000..dc515fcfe --- /dev/null +++ b/kustomize/stage/pod/general/testdata/pod-pending.input.yaml @@ -0,0 +1,15 @@ +# @Stage: ../pod-create.yaml +# @Stage: ../pod-init-container-running.yaml +# @Stage: ../pod-init-container-completed.yaml +# @Stage: ../pod-ready.yaml +# @Stage: ../pod-complete.yaml +# @Stage: ../pod-remove-finalizer.yaml +# @Stage: ../pod-delete.yaml +apiVersion: v1 +kind: Pod +metadata: + name: example-pod +spec: + containers: + - name: container + image: image diff --git a/kustomize/stage/pod/general/testdata/pod-pending.output.yaml b/kustomize/stage/pod/general/testdata/pod-pending.output.yaml new file mode 100644 index 000000000..759d5575e --- /dev/null +++ b/kustomize/stage/pod/general/testdata/pod-pending.output.yaml @@ -0,0 +1,50 @@ +apiGroup: v1 +kind: Pod +name: example-pod +stages: +- delay: + max: 5s + min: 1s + next: + - data: + - op: add + path: /metadata/finalizers + value: + - kwok.x-k8s.io/fake + kind: patch + type: application/json-patch+json + - data: + status: + conditions: + - lastProbeTime: null + lastTransitionTime: + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: + message: 'containers with unready status: [ container ]' + reason: ContainersNotReady + status: "False" + type: Ready + - lastProbeTime: null + lastTransitionTime: + message: 'containers with unready status: [ container ]' + reason: ContainersNotReady + status: "False" + type: ContainersReady + containerStatuses: + - image: image + name: container + ready: false + restartCount: 0 + started: false + state: + waiting: + reason: ContainerCreating + hostIP: )> + phase: Pending + podIP: , false, "", "example-pod", "")> + kind: patch + subresource: status + type: application/merge-patch+json + stage: pod-create