Fix integration tests for k8s 2.3 (#159)

* Fix integration tests for k8s 2.3

Previous to
https://github.com/ansible-collections/kubernetes.core/pull/408 an
attempt to list resources for which the user was not authorized resulted
in an unhandled exception. The task now does not fail, but instead
reports the error message.

* try to fix sanity

* Fix tests

* fix tests

* fix tests

* Revert change to downstream build
This commit is contained in:
Mike Graves
2022-05-05 14:11:35 -04:00
committed by GitHub
parent e69c88ae30
commit ab83a185f5
3 changed files with 14 additions and 25 deletions

View File

@@ -90,8 +90,7 @@
- assert:
that:
- error is failed
# - '"pods is forbidden: User" in error.module_stderr'
- '"pods is forbidden: User" in error.msg'
- name: Create a role to manage Pod from namespace "{{ test_ns }}"
kubernetes.core.k8s:
@@ -209,8 +208,7 @@
- name: assert pod deletion failed due to forbidden user
assert:
that:
- result is failed
# - '"forbidden: User" in error.module_stderr'
- '"forbidden: User" in error.msg'
- name: List Pod
kubernetes.core.k8s_info:
@@ -290,8 +288,7 @@
- name: assert user is not authorize to create pod anymore
assert:
that:
- result is failed
# - '"forbidden: User" in error.module_stderr'
- '"forbidden: User" in error.msg'
- name: List Pod
kubernetes.core.k8s_info:
@@ -332,8 +329,7 @@
- name: assert user is not authorize to list pod anymore
assert:
that:
- result is failed
# - '"forbidden: User" in error.module_stderr'
- '"forbidden: User" in error.msg'
always:
- name: Ensure namespace is deleted