Support for metadata-only fetches in k8s_info module (#1030)

* Support for metadata-only fetches in k8s_info module

* Fix integration test assert

* Add missing changelog fragment

* Fix linters and sanity checks

* Fix linters

* Apply suggestion from @abikouo

* fix: resolve linter errors after rebase

Fix import sorting and apply black formatting to k8s_info.py and
args_common.py to pass tox -e linters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
Co-authored-by: aubin bikouo <abikouo@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Federico Chiacchiaretta
2026-08-06 14:25:35 -04:00
committed by GitHub
co-authored by Bikouo Aubin aubin bikouo Claude Opus 4.6
parent dd4ca7a8b0
commit 08a761fc17
6 changed files with 81 additions and 10 deletions
@@ -4,3 +4,4 @@
- wait
- api-server-caching
- discovery
- metadata-only-fetches
@@ -0,0 +1,22 @@
---
- name: Retrieve Node list with metadata_only
kubernetes.core.k8s_info:
kind: Node
metadata_only: true
register: node_metadata_only_list
- name: Assert response has kind PartialObjectMetadata
assert:
that:
- node_metadata_only_list.resources[0].kind == "PartialObjectMetadata"
- name: Retrieve full Node list
kubernetes.core.k8s_info:
kind: Node
metadata_only: false
register: node_full_list
- name: Assert response has kind Node
assert:
that:
- node_full_list.resources[0].kind == "Node"