Skip to content
Snippets Groups Projects
Unverified Commit 275c54e8 authored by Kenichi Omichi's avatar Kenichi Omichi Committed by GitHub
Browse files

Wait for available API token in a new namespace (#7045)

Just after creating a namespace, the corresponding token could not be
created and sometimes the pod creation might be failed.
This adds check of the token in the new namespace to make this test
case stable.
parent 9a050373
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,16 @@
command: "{{ bin_dir }}/kubectl create namespace test"
changed_when: false
- name: Wait for API token of test namespace
shell: "set -o pipefail && {{ bin_dir }}/kubectl describe serviceaccounts default --namespace test | grep Tokens | awk '{print $2}'"
args:
executable: /bin/bash
changed_when: false
register: default_token
until: default_token.stdout.find('<none>') == -1
retries: 5
delay: 5
- name: Run 2 busybox pods in test ns
command: "{{ bin_dir }}/kubectl run {{ item }} --image={{ test_image_repo }}:{{ test_image_tag }} --namespace test --command -- tail -f /dev/null"
changed_when: false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment