mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-07 13:32:37 +00:00
k8s_info now outputs whether the api was found (#308)
This commit is contained in:
committed by
GitHub
parent
8f14bf6c46
commit
2474ef1b2c
@@ -159,6 +159,29 @@
|
||||
- multi_pod_two_remove is successful
|
||||
- multi_pod_two_remove.changed
|
||||
|
||||
- name: "Look for existing API"
|
||||
k8s_info:
|
||||
api_version: apps/v1
|
||||
kind: Deployment
|
||||
register: existing_api
|
||||
|
||||
- name: Check if we informed the user the api does exist
|
||||
assert:
|
||||
that:
|
||||
- existing_api.api_found
|
||||
|
||||
- name: "Look for non-existent API"
|
||||
k8s_info:
|
||||
api_version: pleasedonotcreatethisresource.example.com/v7
|
||||
kind: DoesNotExist
|
||||
register: dne_api
|
||||
|
||||
- name: Check if we informed the user the api does not exist
|
||||
assert:
|
||||
that:
|
||||
- not dne_api.resources
|
||||
- not dne_api.api_found
|
||||
|
||||
always:
|
||||
- name: Remove namespace
|
||||
k8s:
|
||||
|
||||
Reference in New Issue
Block a user