Skip to content

Commit

Permalink
Revert hanging task to shell
Browse files Browse the repository at this point in the history
  • Loading branch information
mboukhalfa committed Jul 21, 2021
1 parent 1ec1878 commit 03ea597
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions vm-setup/roles/v1aX_integration_test/tasks/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -469,21 +469,31 @@
# (bmh.resources | length > 0) and
# (bmh.resources | json_query(query) | length == 0)

# - name: Get control plane machines
# kubernetes.core.k8s_info:
# api_version: cluster.x-k8s.io/v1alpha3
# kind: Machine
# namespace: "{{ NAMESPACE }}"
# kubeconfig: "/tmp/kubeconfig-{{ CLUSTER_NAME }}.yaml"
# label_selectors:
# - cluster.x-k8s.io/control-plane=
# register: control_plane_machines
#
- name: Get control plane machines
kubernetes.core.k8s_info:
api_version: cluster.x-k8s.io/v1alpha3
kind: Machine
namespace: "{{ NAMESPACE }}"
kubeconfig: "/tmp/kubeconfig-{{ CLUSTER_NAME }}.yaml"
label_selectors:
- cluster.x-k8s.io/control-plane=
register: control_plane_machines
shell: |
kubectl get machines -n "{{ NAMESPACE }}" -l cluster.x-k8s.io/control-plane -o json | jq -r '[ .items[] | select(.spec.version == "{{ UPGRADED_K8S_VERSION }}") | .status.nodeRef.name ]'
environment:
KUBECONFIG: "/tmp/kubeconfig-{{ CLUSTER_NAME }}.yaml"
register: new_control_plane_nodes

# - name: Create list of new node names
# set_fact:
# new_control_plane_nodes: "{{ control_plane_machines.resources | selectattr('spec.version', 'match', UPGRADED_K8S_VERSION) | map(attribute='status.nodeRef.name') }}"

- name: Create list of new node names
set_fact:
new_control_plane_nodes: "{{ control_plane_machines.resources
| selectattr('spec.version', 'match', UPGRADED_K8S_VERSION)
| map(attribute='status.nodeRef.name') }}"
new_control_plane_nodes: new_control_plane_nodes.stdout | from_json


- name: Wait for old etcd instance to leave the etcd-cluster
kubernetes.core.k8s_exec:
Expand Down

0 comments on commit 03ea597

Please sign in to comment.