forked from ansible-collections/community.kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SelfSubjectAccessReviews now work with the k8s module (ansible-collec…
…tions#237) * SelfSubjectAccessReviews now work with the k8s module
- Loading branch information
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters