k8s_info now outputs whether the api was found (#308)

This commit is contained in:
Fabian von Feilitzsch
2020-11-29 23:56:54 -05:00
committed by GitHub
parent 8f14bf6c46
commit 2474ef1b2c
3 changed files with 35 additions and 6 deletions

View File

@@ -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: