Skip to content

Commit

Permalink
Fixes before releasing 0.4.2 (#743)
Browse files Browse the repository at this point in the history
* Wait for apiserver before verifying cluster version (#742)

* Parse output only when kubectl command succeeded (#741)
  • Loading branch information
to-bar committed Nov 20, 2019
1 parent d4a2069 commit 72dcf72
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
args:
warn: no
register: check_docker_update
failed_when: check_docker_update.rc not in [0, 100] # check-update returns code 100 if there are packages available for an update
failed_when: check_docker_update.rc not in [0, 100] # yum check-update returns code 100 if there are packages available for update
changed_when: false

- name: Set is_docker_updatable fact
set_fact:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
- name: Verify cluster version
block:
- name: verify-upgrade | Include wait-for-kube-apiserver.yml
include_tasks: wait-for-kube-apiserver.yml

- name: verify-upgrade | Include get-cluster-version.yml
include_tasks: get-cluster-version.yml # sets cluster_version

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
KUBECONFIG: /home/{{ admin_user.name }}/.kube/config
shell: kubectl cluster-info
register: output
until: output is succeeded and "running" in output.stdout
until:
- output is succeeded
- "'running' in output.stdout"
retries: 30 # 1min
delay: 2
changed_when: false
Expand All @@ -14,7 +16,9 @@
KUBECONFIG: /home/{{ admin_user.name }}/.kube/config
shell: kubectl get nodes -o json
register: output
until: output.stdout|from_json|json_query("items[*].status.conditions[?(@.type=='Ready')].status[]")|unique == ["True"]
until:
- output is succeeded
- output.stdout|from_json|json_query("items[*].status.conditions[?(@.type=='Ready')].status[]")|unique == ["True"]
retries: 600 # 20min
delay: 2
changed_when: false
Expand All @@ -24,7 +28,9 @@
KUBECONFIG: /home/{{ admin_user.name }}/.kube/config
shell: kubectl get pods --all-namespaces -o json
register: output
until: output.stdout|from_json|json_query('items[*].status.phase')|unique == ["Running"]
until:
- output is succeeded
- output.stdout|from_json|json_query('items[*].status.phase')|unique == ["Running"]
retries: 600 # 20min
delay: 2
changed_when: false
Expand All @@ -35,7 +41,9 @@
KUBECONFIG: /home/{{ admin_user.name }}/.kube/config
shell: kubectl get pods --all-namespaces -o json
register: output
until: output.stdout|from_json|json_query('items[*].status.conditions[].status')|unique == ["True"]
until:
- output is succeeded
- output.stdout|from_json|json_query('items[*].status.conditions[].status')|unique == ["True"]
retries: 600 # 20min
delay: 2
changed_when: false
Expand Down

0 comments on commit 72dcf72

Please sign in to comment.