Add new waiter (#306)

Add new waiter

SUMMARY

This refactors the waiter logic from common.py into a separate module.

ISSUE TYPE

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
This commit is contained in:
Mike Graves
2021-12-13 11:06:13 -05:00
parent 7fb89a7b6f
commit f168a3f67f
6 changed files with 463 additions and 11 deletions

View File

@@ -1,11 +1,34 @@
---
kind: Namespace
apiVersion: v1
metadata:
name: test-1
---
kind: Pod
apiVersion: v1
metadata:
name: foo
namespace: bar
name: pod-1
namespace: test-1
spec:
containers:
- image: busybox
name: busybox
---
kind: ConfigMap
kind: PodList
apiVersion: v1
metadata:
name: foo
namespace: bar
metadata: {}
items:
- kind: Pod
apiVersion: v1
metadata:
name: pod-1
namespace: test-1
spec:
containers:
- image: busybox
name: busybox
---
kind: ConfigMapList
apiVersion: v1
metadata: {}
items: []

View File

@@ -0,0 +1,48 @@
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: deploy-1
namespace: test-1
generation: 1
spec:
replicas: 2
selector:
matchLabels:
app: foo
template:
metadata:
labels:
app: foo
spec:
containers:
- image: busybox
name: busybox
status:
availableReplicas: 2
replicas: 2
observedGeneration: 1
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: deploy-2
namespace: test-1
generation: 1
spec:
replicas: 2
selector:
matchLabels:
app: foo
template:
metadata:
labels:
app: foo
spec:
containers:
- image: busybox
name: busybox
status:
availableReplicas: 1
replicas: 2
observedGeneration: 1

View File

@@ -0,0 +1,63 @@
---
kind: Pod
apiVersion: v1
metadata:
namespace: test-1
name: pod-1
spec:
containers:
- image: busybox
name: busybox
status:
containerStatuses:
- name: busybox
ready: true
conditions:
- type: "www.example.com/gate"
status: "True"
---
kind: Pod
apiVersion: v1
metadata:
namespace: test-1
name: pod-2
spec:
containers:
- image: busybox
name: busybox
---
kind: Pod
apiVersion: v1
metadata:
namespace: test-1
name: pod-3
spec:
containers:
- image: busybox
name: busybox
status:
phase: Pending
conditions:
- type: "www.example.com/gate"
status: "Unknown"
containerStatuses:
- name: busybox
ready: true
---
kind: Pod
apiVersion: v1
metadata:
namespace: test-1
name: pod-4
spec:
containers:
- image: busybox
name: busybox
status:
phase: Pending
conditions:
- type: "www.example.com/other"
status: "Unknown"
containerStatuses:
- name: busybox
ready: true