Skip to content

Commit

Permalink
Delete all the resources of openshift-marketplace
Browse files Browse the repository at this point in the history
ansible-collections/kubernetes.core#517 added
delete_all: true to delete all the resources.

It needs to be added in fix openshift-marketplace task files
to make sure all pods are deleted otherwise
fix_openshift_marketplace.yml taskfile does not work as expected.

Note: It moves to oc commands to be make sure all the pods are in
Running state.

Signed-off-by: Chandan Kumar <raukadah@gmail.com>
  • Loading branch information
raukadah committed Apr 19, 2024
1 parent c4a895d commit cdfd18d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions roles/openshift_setup/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
OPERATOR_NAMESPACE: openstack-operators
cifmw_openshift_kubeconfig: "{{ ansible_user_dir }}/.crc/machines/crc/kubeconfig"
cifmw_openshift_setup_ca_registry_to_add: test.registry.com
cifmw_path: "{{ ansible_user_dir }}/.crc/bin:{{ ansible_user_dir }}/.crc/bin/oc:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}"
roles:
- role: "openshift_setup"
tasks:
Expand Down
21 changes: 12 additions & 9 deletions roles/openshift_setup/tasks/fix_openshift_marketplace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
kubernetes.core.k8s:
kind: Pod
state: absent
delete_all: true
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
namespace: openshift-marketplace

- name: Wait for openshift-marketplace pods to be running
kubernetes.core.k8s_info:
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
kind: Pod
namespace: openshift-marketplace
wait: true
wait_condition:
type: Ready
status: "True"
wait_timeout: 300
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.command:
cmd: >-
oc wait pod --all --for=condition=Ready
-n openshift-marketplace --timeout=1m
register: _pod_status
retries: 4
delay: 10
until: _pod_status.rc == 0

0 comments on commit cdfd18d

Please sign in to comment.