mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-06 13:02:37 +00:00
23 lines
652 B
YAML
23 lines
652 B
YAML
---
|
|
- name: Create a SelfSubjectAccessReview resource
|
|
register: can_i_create_namespaces
|
|
ignore_errors: yes
|
|
k8s:
|
|
state: present
|
|
definition:
|
|
apiVersion: authorization.k8s.io/v1
|
|
kind: SelfSubjectAccessReview
|
|
spec:
|
|
resourceAttributes:
|
|
group: v1
|
|
resource: Namespace
|
|
verb: create
|
|
|
|
- name: Assert that the SelfSubjectAccessReview request succeded
|
|
assert:
|
|
that:
|
|
- can_i_create_namespaces is successful
|
|
- can_i_create_namespaces.result.status is defined
|
|
- can_i_create_namespaces.result.status.allowed is defined
|
|
- can_i_create_namespaces.result.status.allowed
|