Skip to content

Commit

Permalink
k8s: Put --timeout after --for on kubectl wait calls
Browse files Browse the repository at this point in the history
This changed the calls to `kubectl wait` on the e2e tests so that --timeout=$timeout
is placed after the condition (--for) parameter.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
  • Loading branch information
wainersm committed May 11, 2021
1 parent eb84aae commit ff678a3
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-block-volume.bats
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ setup() {
tmp_pod_yaml=$(mktemp --tmpdir pod-pv.XXXXX.yaml)
sed -e "s|DEVICE_PATH|${ctr_dev_path}|" "${pod_config_dir}/${pod_name}.yaml" > "$tmp_pod_yaml"
kubectl create -f "$tmp_pod_yaml"
kubectl wait --timeout=$timeout --for condition=ready "pod/${pod_name}"
kubectl wait --for condition=ready --timeout=$timeout "pod/${pod_name}"

# Verify persistent volume claim is bound
kubectl get "pvc/${volume_claim}" | grep "Bound"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-configmap.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-configmap.yaml"

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Check env
cmd="env"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-env.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-env.yaml"

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Print environment variables
cmd="printenv"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-expose-ip.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ setup() {
kubectl create -f -

# Check deployment creation
cmd="kubectl wait --timeout=$timeout --for=condition=Available deployment/${deployment}"
cmd="kubectl wait --for=condition=Available --timeout=$timeout deployment/${deployment}"
waitForProcess "$wait_time" "$sleep_time" "$cmd"

# Check pods are running
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-footloose.bats
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-footloose.yaml"

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Get pod ip
pod_ip=$(kubectl get pod $pod_name --template={{.status.podIP}})
Expand Down
4 changes: 2 additions & 2 deletions integration/kubernetes/k8s-hugepages.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-env.yaml"

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Print environment variables
cmd="printenv"
Expand All @@ -43,7 +43,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-env.yaml"

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Print environment variables
cmd="printenv"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-limit-range.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-cpu-defaults.yaml" --namespace=${namespace_name}

# Get pod specification
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name" --namespace="$namespace_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" --namespace="$namespace_name"

# Check limits
# Find the 500 millicpus specified at the yaml
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-oom.bats
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-oom.yaml"

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Check if OOMKilled
cmd="kubectl get pods "$pod_name" -o yaml | yq r - 'status.containerStatuses[0].state.terminated.reason' | grep OOMKilled"
Expand Down
4 changes: 2 additions & 2 deletions integration/kubernetes/k8s-port-forward.bats
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ setup() {
kubectl apply -f "${pod_config_dir}/redis-master-deployment.yaml"

# Check deployment
kubectl wait --timeout=$timeout --for=condition=Available deployment/"$deployment_name"
kubectl wait --for=condition=Available --timeout=$timeout deployment/"$deployment_name"
kubectl expose deployment/"$deployment_name"

# Get pod name
pod_name=$(kubectl get pods --output=jsonpath={.items..metadata.name})
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# View replicaset
kubectl get rs
Expand Down
6 changes: 3 additions & 3 deletions integration/kubernetes/k8s-qos-pods.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-guaranteed.yaml"

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Check pod class
kubectl get pod "$pod_name" --output=yaml | grep "qosClass: Guaranteed"
Expand All @@ -41,7 +41,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-burstable.yam"l

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Check pod class
kubectl get pod "$pod_name" --output=yaml | grep "qosClass: Burstable"
Expand All @@ -55,7 +55,7 @@ setup() {
kubectl create -f "${pod_config_dir}/pod-besteffort.yam"l

# Check pod creation
kubectl wait --timeout=$timeout --for=condition=Ready pod "$pod_name"
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"

# Check pod class
kubectl get pod "$pod_name" --output=yaml | grep "qosClass: BestEffort"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-replication.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ setup() {

# Check pod creation
pod_name=$(kubectl get pods --output=jsonpath={.items..metadata.name})
cmd="kubectl wait --timeout=$timeout --for=condition=Ready pod $pod_name"
cmd="kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name"
waitForProcess "$wait_time" "$sleep_time" "$cmd"

# Check number of pods created for the
Expand Down

0 comments on commit ff678a3

Please sign in to comment.