mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-06 13:02:37 +00:00
test molecule zuul job (#180)
This commit is contained in:
@@ -6,10 +6,6 @@ driver:
|
||||
login_cmd_template: 'docker exec -ti {instance} bash'
|
||||
ansible_connection_options:
|
||||
ansible_connection: docker
|
||||
lint: |
|
||||
set -e
|
||||
yamllint .
|
||||
flake8
|
||||
platforms:
|
||||
- name: instance-kind
|
||||
provisioner:
|
||||
@@ -33,7 +29,6 @@ scenario:
|
||||
name: default
|
||||
test_sequence:
|
||||
- dependency
|
||||
- lint
|
||||
- syntax
|
||||
- prepare
|
||||
- converge
|
||||
|
||||
@@ -11,22 +11,35 @@
|
||||
- "node.kubernetes.io/not-ready"
|
||||
- "node.kubernetes.io/unreachable"
|
||||
- "node.kubernetes.io/unschedulable"
|
||||
kind_bin_path: "/usr/local/bin/kind"
|
||||
|
||||
tasks:
|
||||
# We are spawning k8s cluster using kind executable and we ensure that the cluster is up
|
||||
# and node is ready, if this is not validated we may face issue later on when running tests
|
||||
- name: Download kind
|
||||
- name: Check if kind binary is available or not
|
||||
stat:
|
||||
path: "{{ kind_bin_path }}"
|
||||
register: r
|
||||
|
||||
- name: Download kind if not available
|
||||
get_url:
|
||||
url: https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
|
||||
dest: /tmp/kind
|
||||
dest: "{{ kind_bin_path }}"
|
||||
when: not r.stat.exists
|
||||
|
||||
- name: make kind executable
|
||||
- name: Make kind executable
|
||||
file:
|
||||
path: /tmp/kind
|
||||
path: "{{ kind_bin_path }}"
|
||||
mode: '0755'
|
||||
|
||||
- name: Check if Kind cluster exists
|
||||
command: "{{ kind_bin_path }} get clusters"
|
||||
register: r
|
||||
ignore_errors: true
|
||||
|
||||
- name: Create cluster
|
||||
command: "kind create cluster"
|
||||
command: "{{ kind_bin_path }} create cluster"
|
||||
when: r.stdout == ''
|
||||
|
||||
- name: Assert that nodes are ready
|
||||
k8s_info:
|
||||
|
||||
Reference in New Issue
Block a user