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

* 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.



---------




(cherry picked from commit 08a761fc17)

Co-authored-by: Federico Chiacchiaretta <federico.chia@gmail.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:
patchback[bot]
2026-08-07 11:03:57 +02:00
committed by GitHub
co-authored by Federico Chiacchiaretta Bikouo Aubin aubin bikouo Claude Opus 4.6
parent 0f472b53e2
commit b9749c94f9
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"