k8s_facts: fix handling of unknown resource types (#47857)

pull/48167/head
Mariusz Mazur 6 years ago committed by Martin Krizek
parent c5b303fa52
commit a5c8e952e8

@ -1,3 +1,4 @@
---
bugfixes:
- k8s_facts now returns a resources key in all situations
- "k8s_facts: fix handling of unknown resource types"

@ -183,6 +183,8 @@ class K8sAnsibleMixin(object):
def kubernetes_facts(self, kind, api_version, name=None, namespace=None, label_selectors=None, field_selectors=None):
resource = self.find_resource(kind, api_version)
if not resource:
return dict(resources=[])
try:
result = resource.get(name=name,
namespace=namespace,

Loading…
Cancel
Save