mirror of
https://github.com/openshift/community.okd.git
synced 2026-03-31 21:33:07 +00:00
* Initial port to molecule * Get molecule tests to run * Draw the rest of the owl * use local dir for storing collection during CI run * Add dockerfile, install community.kubernetes collection before sanity check * Add clean step to Makefile * Get sanity tests working * Update sanity test to use makefile * Add ignores for 2.11 so devel passes * Update description * Code review * Add OWNERS file for prow
124 lines
3.2 KiB
YAML
124 lines
3.2 KiB
YAML
---
|
|
- block:
|
|
- name: Create a project
|
|
community.okd.k8s:
|
|
name: "{{ playbook_namespace }}"
|
|
kind: Project
|
|
api_version: project.openshift.io/v1
|
|
|
|
- name: incredibly simple ConfigMap
|
|
community.okd.k8s:
|
|
definition:
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: hello
|
|
namespace: "{{ playbook_namespace }}"
|
|
validate:
|
|
fail_on_error: yes
|
|
register: k8s_with_validate
|
|
|
|
- name: assert that k8s_with_validate succeeds
|
|
assert:
|
|
that:
|
|
- k8s_with_validate is successful
|
|
|
|
- name: extra property does not fail without strict
|
|
community.okd.k8s:
|
|
src: "files/kuard-extra-property.yml"
|
|
namespace: "{{ playbook_namespace }}"
|
|
validate:
|
|
fail_on_error: yes
|
|
strict: no
|
|
|
|
- name: extra property fails with strict
|
|
community.okd.k8s:
|
|
src: "files/kuard-extra-property.yml"
|
|
namespace: "{{ playbook_namespace }}"
|
|
validate:
|
|
fail_on_error: yes
|
|
strict: yes
|
|
ignore_errors: yes
|
|
register: extra_property
|
|
|
|
- name: check that extra property fails with strict
|
|
assert:
|
|
that:
|
|
- extra_property is failed
|
|
|
|
- name: invalid type fails at validation stage
|
|
community.okd.k8s:
|
|
src: "files/kuard-invalid-type.yml"
|
|
namespace: "{{ playbook_namespace }}"
|
|
validate:
|
|
fail_on_error: yes
|
|
strict: no
|
|
ignore_errors: yes
|
|
register: invalid_type
|
|
|
|
- name: check that invalid type fails
|
|
assert:
|
|
that:
|
|
- invalid_type is failed
|
|
|
|
- name: invalid type fails with warnings when fail_on_error is False
|
|
community.okd.k8s:
|
|
src: "files/kuard-invalid-type.yml"
|
|
namespace: "{{ playbook_namespace }}"
|
|
validate:
|
|
fail_on_error: no
|
|
strict: no
|
|
ignore_errors: yes
|
|
register: invalid_type_no_fail
|
|
|
|
- name: check that invalid type fails
|
|
assert:
|
|
that:
|
|
- invalid_type_no_fail is failed
|
|
|
|
- name: setup custom resource definition
|
|
community.okd.k8s:
|
|
src: "files/setup-crd.yml"
|
|
|
|
- name: wait a few seconds
|
|
pause:
|
|
seconds: 5
|
|
|
|
- name: add custom resource definition
|
|
community.okd.k8s:
|
|
src: "files/crd-resource.yml"
|
|
namespace: "{{ playbook_namespace }}"
|
|
validate:
|
|
fail_on_error: yes
|
|
strict: yes
|
|
register: unknown_kind
|
|
|
|
- name: check that unknown kind warns
|
|
assert:
|
|
that:
|
|
- unknown_kind is successful
|
|
- "'warnings' in unknown_kind"
|
|
|
|
always:
|
|
- name: remove custom resource
|
|
community.okd.k8s:
|
|
definition: "{{ lookup('file', 'files/crd-resource.yml') }}"
|
|
namespace: "{{ playbook_namespace }}"
|
|
state: absent
|
|
ignore_errors: yes
|
|
|
|
- name: remove custom resource definitions
|
|
community.okd.k8s:
|
|
definition: "{{ lookup('file', 'files/setup-crd.yml') }}"
|
|
state: absent
|
|
|
|
- name: Delete namespace
|
|
community.okd.k8s:
|
|
state: absent
|
|
definition:
|
|
- kind: Project
|
|
apiVersion: project.openshift.io/v1
|
|
metadata:
|
|
name: "{{ playbook_namespace }}"
|
|
ignore_errors: yes
|