Skip to content

Commit

Permalink
ensure-kubernetes: workaround slow account creation
Browse files Browse the repository at this point in the history
Per the referenced link, account creation can be slow and that's just
the way it is.  This should help tests that fail with

  Error from server (Forbidden): error when creating "test-pod.yaml":
  pods "test" is forbidden: error looking up service account
  default/default: serviceaccount "default" not found

Change-Id: I405aa7e58737c7061a471da2e2807c77756c76b8
  • Loading branch information
ianw committed Sep 17, 2020
1 parent ca4111a commit 4d2c441
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test-playbooks/ensure-kubernetes/crio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
become: yes
failed_when: false

# The default account is known to take a while to appear; see
# https://github.com/kubernetes/kubernetes/issues/66689
- name: Ensure default account created
command: kubectl -n default get serviceaccount default -o name
retries: 5
delay: 5
register: result
until: result.rc == 0

- name: Create a test pod definition
copy:
dest: test-pod.yaml
Expand Down

0 comments on commit 4d2c441

Please sign in to comment.