From 92a493a8c14fd610654bff81226603860b5af3f1 Mon Sep 17 00:00:00 2001 From: wcheng2 Date: Tue, 19 Nov 2024 12:39:02 -0500 Subject: [PATCH] k8s_cluster_info.py Add warn for resorce missing kind field --- plugins/modules/k8s_cluster_info.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/modules/k8s_cluster_info.py b/plugins/modules/k8s_cluster_info.py index 227d5ba25f..0d85baa284 100644 --- a/plugins/modules/k8s_cluster_info.py +++ b/plugins/modules/k8s_cluster_info.py @@ -178,6 +178,12 @@ def execute_module(module, client): if resource.group == "" else "/".join([resource.group, resource.group_version.split("/")[-1]]) ) + + kind = getattr(resource, "kind", None) + if not kind: + module.warn(f"Resource is missing 'kind': {resource}") + continue + results[key][resource.kind] = { "categories": resource.categories if resource.categories else [], "name": resource.name,