Commit Graph
773 Commits
Author SHA1 Message Date
d7b53d0464 :fix(helm_repository): normalize both sides of the repo URL comparison (#1236) (#1259)
helm stores repository URLs verbatim, so a repository registered with a
trailing slash keeps it in repositories.yaml. Only the URL coming from the
task was normalized, so a repository that already matched was reported as a
name conflict.

Fixes #1235

(cherry picked from commit 094240ab77)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
2026-09-15 11:03:54 -07:00
14712d57a7 [PR #1253/c46180bb backport][stable-5] Add ansible-core version check to k8s lookup turbo mode (#1255)
* Add ansible-core version check to k8s lookup turbo mode (#1253)

* feat(lookup): add ansible-core version check for turbo mode in k8s lookup

Add ansible-core version checking to the k8s lookup plugin to match the
behavior already implemented in module_utils/ansiblemodule.py.

When ENABLE_TURBO_MODE is set and ansible-core >= 2.19.0:
- Emit deprecation warning for ENABLE_TURBO_MODE
- Emit version warning explaining turbo mode is unsupported
- Disable turbo mode and fall back to standard LookupBase

This prevents confusing tracebacks when cloud.common (which declares
requires_ansible '>=2.15.0,<2.19') is used on newer ansible-core versions
where it is not fully compatible.

Changes:
- Import ansible_version and LooseVersion
- Add TURBO_UNSUPPORTED_CORE = "2.19.0" constant
- Check version before enabling turbo mode
- Disable turbo mode and warn if version >= 2.19.0

Addresses reviewer feedback on PR #1251 to add version testing to the
lookup plugin matching the module implementation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* test(lookup): add unit tests for k8s turbo mode version check

Add comprehensive unit tests for the ansible-core version checking logic
in the k8s lookup plugin's turbo mode handling.

Tests validate that when ENABLE_TURBO_MODE is set:
- Turbo mode is disabled on ansible-core >= 2.19.0 (tests 2.19.0 and 2.21.4)
- Turbo mode is enabled on ansible-core < 2.19.0 (tests 2.18.0)
- Appropriate deprecation and version warnings are shown
- Standard LookupBase is used when turbo mode is disabled

Tests also verify that when ENABLE_TURBO_MODE is not set:
- No deprecation or warning messages are shown
- Turbo mode remains disabled
- Standard LookupBase is used

Implementation follows pytest best practices:
- Autouse fixture for module cleanup between tests
- Parametrized tests to avoid duplication (2.19.0 and 2.21.4 share logic)
- Mock assertion methods (assert_called, assert_not_called)
- Module-level import of StandardLookupBase to avoid repetition

Simplified and maintainable: 71 lines vs initial 139-line implementation
(49% reduction through deduplication and better abstractions).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* style: format with black

* fixup! test(lookup): add unit tests for k8s turbo mode version check

* docs: add changelog fragment for k8s lookup turbo version check

Add changelog entry documenting that the k8s lookup plugin now ignores
ENABLE_TURBO_MODE on ansible-core >= 2.19.0 and falls back to standard
LookupBase instead of failing with a traceback.

This complements the existing deprecate-enable-turbo-mode.yml fragment
which covers the module implementation, by documenting the lookup plugin
fix specifically.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fixup! fixup! test(lookup): add unit tests for k8s turbo mode version check

* fixup! fixup! fixup! test(lookup): add unit tests for k8s turbo mode version check

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
(cherry picked from commit c46180bb6f)

* fix: make the linter happy

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-09-15 17:21:16 +01:00
51f0386633 Add deprecation warnings for the status.values return value (#1241) (#1257)
* chore: add deprecation warning for status.values

* docs: add changelog entries for status.values deprecation

(cherry picked from commit f42c78ce83)

Co-authored-by: Don Naro <dnaro@redhat.com>
2026-09-15 08:52:06 -07:00
8c0de50fb8 **This is a manual backport of PR #1242 as merged into main ([031bc47](https://github.com/ansible-collections/kubernetes.core/commit/031bc475fadd0fcf8152d3c9083e22a77e3d870d)).** (#1251)
Emit an explicit deprecation warning when users enable Ansible Turbo mode via `ENABLE_TURBO_MODE`, and stop turbo mode from being used on ansible-core versions where `cloud.common` is not supported.

Turbo mode depends on `cloud.common`, which is being retired. PR #1120 already deprecated the `cloud.common` dependency; without this change, removing that dependency later would cause `ENABLE_TURBO_MODE` to stop working silently. This PR warns users at runtime so they can migrate before support is removed in `kubernetes.core` 8.0.0.

Changes:

* Modules: emit the deprecation at import time via the module-level `deprecate()` in `plugins/module_utils/ansiblemodule.py`. `AnsibleTurboModule.__init__()` ends in `run_on_daemon()`, which calls `exit_json()` and exits the process, so a `deprecate()` call tied to instance construction is never reached.
* Modules: skip turbo mode on ansible-core >= 2.19.0 and fall back to the standard `AnsibleModule`, emitting a warning. `cloud.common` declares `requires_ansible '>=2.15.0,<2.19'`, but that is only enforced at collection load time and the turbo import itself still succeeds on newer cores, so turbo mode would otherwise fail later with `byte indices must be integers or slices, not str`.
* Modules and lookup: warn instead of silently falling back when `ENABLE_TURBO_MODE` is set but `cloud.common` is not installed.
* Lookup: call `Display.deprecated()` in the `k8s` lookup when turbo mode is enabled. The lookup path still works on >= 2.19, so it keeps using turbo and is not version-gated.
* Docs: add deprecation notices to `README.md` and `docs/ansible_turbo_mode.rst`.
* Changelog: add `deprecated_features`, `bugfixes`, and `minor_changes` fragment entries.

On ansible-core < 2.19 with `cloud.common` installed, turbo mode continues to work exactly as before and only gains a deprecation warning. On ansible-core >= 2.19 turbo mode is now deliberately bypassed, which replaces a confusing traceback with a clear warning.

* Bugfix Pull Request
* Docs Pull Request

`ENABLE_TURBO_MODE` / Ansible Turbo mode

On a supported ansible-core (< 2.19) with `cloud.common` installed, turbo mode stays active and users see:

```
[DEPRECATION WARNING]: ENABLE_TURBO_MODE is deprecated, as it relies on the cloud.common collection which is being retired. Setting this environment variable will have no effect once support is removed. This feature will be removed from kubernetes.core in version 8.0.0.
```

On ansible-core >= 2.19.0, turbo mode is bypassed and an additional warning is emitted:

```
[WARNING]: ENABLE_TURBO_MODE is ignored on ansible-core 2.21.4: Ansible Turbo mode requires the cloud.common collection, which supports ansible-core < 2.19.0 only. Continuing without Turbo mode.
```

Warnings are emitted from:

* `plugins/module_utils/ansiblemodule.py` for collection modules
* `plugins/lookup/k8s.py` for the `k8s` lookup plugin

To verify locally:

```shell
export ENABLE_TURBO_MODE=1
ansible localhost -m kubernetes.core.k8s_info -a "kind=Namespace" 2>&1 | grep -iE "deprecat|warning"
```

Integration tests that run with `ENABLE_TURBO_MODE=true` use ansible-core 2.18, where turbo mode remains enabled, so turbo behaviour there is unchanged.

Thanks to @yurnov for diagnosing the unreachable deprecation and for the suggested fix in [mandar242#1](https://github.com/mandar242/kubernetes.core/pull/1).

(cherry picked from commit 031bc475fa)

Co-authored-by: Mandar Kulkarni <mandkulk@redhat.com>
2026-09-15 15:31:27 +01:00
8ec2912419 ci: add the PE certification checker workflow (#1231) (#1248)
* ci: add the PE certification checker workflow

* ci: add stable branches to certification workflow

(cherry picked from commit 732925b986)

Co-authored-by: Don Naro <dnaro@redhat.com>
2026-09-15 14:25:59 +01:00
c35fc5e10e Remove remaining ansible.module_utils.six import from kubectl connection plugin (#1197) (#1199)
* Replace ansible.module_utils.six with Python stdlib equivalents

ansible.module_utils.six is deprecated in ansible-core 2.21 and is
scheduled for removal in 2.24. Every use of it in this collection has a
direct Python 3 standard library equivalent, so switch to those.

* Update changelogs/fragments/20260723-remove-module-utils-six.yaml



---------


(cherry picked from commit dd4ca7a8b0)

Co-authored-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
2026-09-14 15:09:04 +01:00
66ec4758f0 [PR #1240/cb00cf3c backport][stable-5] Address stale deprecations (#1246)
* Address stale deprecations (#1240)

* chore: update deprecation for wait_timeout

* chore: update deprecation for return_code

* docs(changelogs): add stale deprecations to changelogs

* docs: ignore pylint deprecation warnings

* chore: update deprecation for merge_type

* docs: update changelogs for merge_type

* docs: ignore more pylint deprecation warnings

(cherry picked from commit cb00cf3c9e)

* fix: remove unnecessary ignore statements

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
2026-09-14 14:37:21 +01:00
feb44ae16a chore(test): add ansible 2.21 to integration tests matrix (#1234) (#1244)
* chore(test): add ansible 2.21 to integration tests matrix

current version of Ansible (as the time of this commit) is
2.21 that is included in the Ansible 14 release.

To ensure testing coverage for actual version if ansible,
version 2.21 should be included in the integration tests matrix.

Updated matrix includes:
- stable-2.18 as the latest version support turbo mode
- stable-2.21 as the actual version
- milestone as the development version

* chore(test): exclude 2.18/turbo off from integration tests matrix

stable-2.18 is used mostly as the last version with turbo mode,
so no reason to test it with turbo mode disabled as it tested with
the later version of ansible.

Excluding to decrease CI time/cost

(cherry picked from commit 7df5e01974)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
2026-09-14 13:21:34 +01:00
00dab977a5 test(sanity): align python_requires with documented 3.9+ support (#1226) (#1228)
tests/config.yml declared ">=3.6", so ansible-test ran the module import
test on target Python versions this collection never supported, while
README states 3.9+. Narrow the declaration and add ignore entries for the
supported target versions that were missing.

(cherry picked from commit d9e0218dba)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
2026-09-10 17:27:16 +01:00
983851296a Fix ansible-lint no-changed-when and execution-environment schema warnings (#1196) (#1238)
* Fix ansible-lint no-changed-when and execution-environment schema warnings

Add `changed_when: false` to example command tasks in the kubectl
connection plugin to resolve no-changed-when warnings from ansible-lint.

Add `version: 3` to meta/execution-environment.yml to satisfy the
schema[execution-environment] rule requiring the version property.



* Add changelog fragment for ansible-lint warning fixes



* Fix changelog fragment YAML formatting

Quote strings to avoid YAML parsing ambiguity in the trivial section.



---------


(cherry picked from commit a7922e498c)

Co-authored-by: Daniel Brennand <52419383+dbrennand@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-09-10 16:20:19 +01:00
Yuriy NovostavskiyandGitHub d3e177d62c Use the pinned helm binary in helm_registry_auth and helm_diff tests (#1219)
SUMMARY
Fixes #1218.
helm_registry_auth and helm_diff resolved helm from PATH instead of the binary installed by the install_helm role. The runner image now ships helm v3.21.3, which returns 401 Unauthorized when pushing to the plain-HTTP test registry, while install_helm pins v3.16.4.

helm_registry_auth — added helm_binary to the target defaults and used it in the shell tasks and as binary_path for the module calls. The target already depended on install_helm, it just never used the result.
helm_diff — pass helm_binary_path: "{{ helm_binary }}" when including push_to_helm_registry. Without it the role used its own default of helm, so the target was mixing two helm binaries: the pinned one for Log into Helm registry and the one from PATH for the push.

This is the stable-5 counterpart of what #1090 did on main, limited to the test files. main and stable-6 additionally rewrote helm_registry_auth to run against several pinned helm versions with --plain-http, which depends on the plain_http module option that does not exist on stable-5. Pinning the binary keeps this to a test-only change, so stable-5 continues to be tested against helm 3.16.4 while newer helm coverage stays on main/stable-6.
No changelog fragment: tests/ only.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
tests/integration/targets/helm_registry_auth, tests/integration/targets/helm_diff
ADDITIONAL INFORMATION
Before, on #1199 (all four matrix combinations of shards 4 and 8):
TASK [helm_registry_auth : Test module helm_registry_auth with correct credentials] ***
changed: [localhost] => {"command": "/usr/local/bin/helm registry login localhost:5000 --username=testuser --password-stdin", "stderr": "Login Succeeded\n", ...}

TASK [helm_registry_auth : Ensure that push to the registry is working] ********
fatal: [localhost]: FAILED! => {
    "cmd": "helm push \"/tmp/ansible.poej0iam.helm/k8s-monitoring-1.6.8.tgz\"  oci://localhost:5000/test/",
    "rc": 1,
    "stderr": "Error: failed to perform \"Exists\" on destination: HEAD \"http://localhost:5000/v2/test/k8s-monitoring/manifests/sha256:fea90b12...\": response status code 401: Unauthorized"
}

FATAL: The 1 integration test(s) listed below (out of 3) failed. See error output above for details:
helm_registry_auth

TASK [push_to_helm_registry : Helm push chart to the registry] *****************
fatal: [localhost]: FAILED! => {
    "cmd": ["helm", "push", "/tmp/ansible._h27f4p0.chart/test-chart-deployment-time-0.1.0.tgz", "oci://localhost:6035/testing"],
    "rc": 1,
    "stderr": "Error: failed to perform \"Exists\" on destination: HEAD \"http://localhost:6035/v2/testing/test-chart-deployment-time/manifests/sha256:1de6f019...\": response status code 401: Unauthorized"
}

FATAL: The 1 integration test(s) listed below (out of 9) failed. See error output above for details:
helm_diff

Note that with the pinned 3.16.4 the Test idempotency of logout with helm < 3.18.0 block in helm_registry_auth runs again; it was being skipped while the newer binary from PATH was in use.

Reviewed-by: Alina Buzachis
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Don Naro <dnaro@redhat.com>
Reviewed-by: Bikouo Aubin
2026-09-08 13:39:08 +00:00
b5d5fa4d65 ci: exclude test code from SonarCloud duplication detection (#1207) (#1212)
Duplication is scored on new code only, so a PR adding cases to an already
repetitive test module inherits debt accrued across earlier PRs rather than
introducing it; tests/unit/modules/test_module_helm.py sits at 47.9% on main
before any change.

sonar.exclusions filters the source set, not the copy/paste detector, so test
code needs its own exclusion. Production code stays covered.

(cherry picked from commit f31ecce59c)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
2026-08-10 12:01:15 -04:00
dad9a8457e Handle empty template output gracefully (#1044) (#1204)
* Handle empty template output gracefully

* Add changelog fragment for empty template output fix

* refactor: reduce cognitive complexity of ActionModule.run

Extract compound boolean condition to a variable to reduce the
cognitive complexity from 16 to the allowed maximum of 15.



* refactor: extract duplicated error handling into _fail_with_error

Replace two identical error-handling blocks in ActionModule.run() with
a shared _fail_with_error static method to address SonarQube code
duplication finding.



* refactor: reduce code duplication in action plugin and tests

Revert _fail_with_error extraction that increased duplication on new
code. Consolidate duplicate integration test tasks for conditional
template into a single looped task.



---------



(cherry picked from commit ec8942dd90)

Co-authored-by: W. H. Wang <mattwang44@gmail.com>
Co-authored-by: aubin bikouo <abikouo@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-08-10 11:30:33 +02:00
Bianca HendersonandGitHub 1a0914352a Prep 5.4.4 release (#1193)
* Fix ansible version for 5.4.3 release

* Prep release 5.4.4

(cherry picked from commit 44fbb83be4b2ea9d3ee4479f7aa131cf72b3b0e3)
5.4.4
2026-07-09 17:04:18 -04:00
Bianca HendersonandGitHub efe2d1aa69 Prep release 5.4.3 (#1187)
* Prep k8s collection release 5.4.3

* Update release date for 5.4.3

* Update changelog.yaml and changelog.rst mismatches
5.4.3
2026-07-08 11:04:38 -04:00
0cd0f3df9e Add meta/execution-environment.yml to fix EE builds on UBI images (#1142) (#1182)
ansible-builder builds fail with "No package matches 'openshift-clients'"
on UBI images because the openshift-clients RPM in bindep.txt requires
repos not available in standard UBI. This adds collection-level EE
metadata pointing to a minimal bindep file without openshift-clients,
while preserving the original bindep.txt for direct bindep usage.

Fixes #1141


(cherry picked from commit a80e2d067c)

Co-authored-by: Christopher Brown <snecklifter@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-07 09:48:42 -04:00
d0daf56ea7 Add lint ignore entry (#1184) (#1185)
(cherry picked from commit 75a5560aec)

Co-authored-by: Bianca Henderson <bianca@redhat.com>
2026-07-07 09:42:59 -04:00
3967f5e2ca feat(ci): add security check to block .claude/ and .vscode/ directories (#1173) (#1180)
* feat(ci): add security check to block .claude/ and .vscode/ directories

Add workflow that calls the security_check_directories action from
cloud-content-ci-automation to fail PRs containing files under .claude/
or .vscode/ directories.

Integrates with all_green_check.yaml as a required job for PRs.

Ref: ACA-6411



* fix(ci): suppress SonarCloud S7637 for reusable actions using @main

Internal reusable actions from ansible-network/github_actions and
ansible-collections/cloud-content-ci-automation use @main refs for
simpler maintenance. Suppress the 'use full commit SHA' rule for
workflow files.



* fix(ci): use correct org and pin action to commit SHA

Address review feedback:
- Change org from ansible-collections to ansible
- Pin to commit SHA 74b5fe87 instead of @main



* docs: add changelog fragment for security check workflow



* Update changelogs/fragments/1173-security-check-workflow.yml

---------



(cherry picked from commit 6bb9cce51b)

Co-authored-by: GomathiselviS <gomathiselvi@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Bianca Henderson <beeankha@gmail.com>
2026-07-03 08:39:56 -04:00
7150d04f01 Point to Python 3.13 for ansible-core devel (#1174) (#1175)
(cherry picked from commit ceeafa8c6d)

Co-authored-by: Bianca Henderson <bianca@redhat.com>
2026-07-01 12:19:02 -04:00
Bianca HendersonandGitHub 00f3d12a1d [manual backport stable-5] Fix CI Test Collision (#1162) (#1166)
* Fix CI Test Collision (#1162)

* Fix CI concurrency issue

* More CI fixes

* Fix coverage job install

* Install correct test dependencies

(cherry picked from commit d211f316ad)

* Restore cancel-in-progress: true
2026-06-30 12:01:44 -04:00
33bb3b81ba ci: suppress SonarCloud python:S5443 for test code (#1165) (#1168)
Unit tests pass hardcoded '/tmp/...' strings as fake module arguments (for
example chart_ref) into fully mocked helm commands, so no file is ever
created and there is no real exposure. SonarCloud's python:S5443 still
raises a security hotspot on each literal and, because it only scores new
code, drops a PR's security rating even though the same pattern already
pervades the existing test suite.

Scope the suppression to tests/** only. Production code creates temporary
files via tempfile.mkstemp / NamedTemporaryFile and remains covered by the
rule, where it carries real value.

AI-assisted commit with Claude Opus

(cherry picked from commit 0836e96c2d)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
2026-06-30 11:48:42 -04:00
e4b748a791 CI - configure precommit hook to block commit when files from .claude… (#1149) (#1170)
* CI - configure precommit hook to block commit when files from .claude/ and/or .vscode/ directories are staged

* fix sanity issue - shebang

* Remove local hook and update documentation

(cherry picked from commit a4fc40732a)

Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
2026-06-30 10:57:50 +02:00
c76cc63a75 Fix workflow concurrency issue (#1159) (#1160)
(cherry picked from commit bb80dde66d)

Co-authored-by: Bianca Henderson <bianca@redhat.com>
2026-06-26 12:03:21 -04:00
c9b918a453 Fix all-green CI workflow (#1153) (#1157)
(cherry picked from commit 8bf31513f5)

Co-authored-by: Bianca Henderson <bianca@redhat.com>
2026-06-26 10:53:45 -04:00
d3e408556b ci: suppress SonarCloud python:S7498 for argument_spec dict() convention (#1152) (#1154)
Ansible module argument_spec is conventionally defined with the dict(...)
constructor rather than {...} literals, for readability and consistency
across the collection. SonarCloud's python:S7498 ("Literal syntax should
be preferred...") flags this as a false positive and re-fires on every
new module argument. Ignore the rule project-wide via sonar-project.properties.

Fixes #1151

(cherry picked from commit 1c20b53bdc)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
2026-06-25 14:07:10 -04:00
Bianca HendersonandGitHub 16f4b49c43 Manual backport of SonarQube configuration to stable-5 branch (#1137) 2026-05-29 17:31:39 -04:00
178611ef5d Fix unit test failures in CI (#1133) (#1134)
(cherry picked from commit f69761f37c)

Co-authored-by: Bianca Henderson <bianca@redhat.com>
2026-05-25 11:00:48 -04:00
2b52790a01 Update pod deletion conditions for local storage used in a daemon set pod (#1095) (#1127)
* Update pod deletion conditions for local storage used in a daemon set pod

Refactor pod deletion logic to handle local storage in daemon set pods correctly.

* Add bugfix for k8s_drain handling local storage pods

Fix logic for handling pods with local storage in k8s_drain.

* Refactor filter_pods function for clarity and efficiency

* Fix sanity and linter errors

---------


(cherry picked from commit b58b2ca70e)

Co-authored-by: Juan Morete <morete@gmail.com>
Co-authored-by: Bianca Henderson <bianca@redhat.com>
2026-05-15 15:16:07 -04:00
84cf83fe0f fix(helm_repository): strip trailing slashes from repo_url (#1121) (#1125)
Helm normalizes repository URLs internally, so a URL supplied with a
trailing slash and the same URL without one are treated as different
entries. This causes the module to fail every run when the user
provides a trailing slash, even though the repository is already
correctly registered.

Strip the trailing slash from repo_url before comparing against the
existing repository list so repeated runs with the same input are
idempotent.

Fixes #480

(cherry picked from commit 8a58d3b6de)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kiev.ua>
2026-05-14 10:56:35 -04:00
a2aa079829 docs: add until example to k8s_info (#885) (#1118)
I would liked to have an example like this when I was using the
documentation.

(cherry picked from commit 4d7dc2a7d1)

Co-authored-by: Birger Johan Nordølum <33870508+MindTooth@users.noreply.github.com>
2026-05-06 10:16:35 -04:00
ca050aa3f6 Update URL reference in integration-test CI file (#1112) (#1113)
(cherry picked from commit 210467b26d)

Co-authored-by: Bianca Henderson <bianca@redhat.com>
2026-04-22 14:15:08 -04:00
84249fc4f1 ci: conditionally test turbo mode and cloud.common (#1109) (#1110)
The cloud.common collection is incompatible with ansible-core >= 2.19.0.
With the current testing matrix using Python 3.12 and the ansible
milestone (currently 2.22), this incompatibility causes integration
tests to fail.

Instead of completely removing turbo mode from the testing matrix, this
commit adds ansible-core 2.18 to the matrix and excludes the combination
of the ansible milestone and turbo mode. The checkout and installation
of the cloud.common collection are now conditionally executed only when
turbo mode is enabled.

(cherry picked from commit 11f619b69e)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kiev.ua>
2026-04-21 14:51:49 -04:00
229575fe8f Add sanity test ignores for ansible-core 2.22 (#1102) (#1105)
The `devel` and `milestone` branches for ansible-core have been bumped to
`2.22.0.dev0` as the `stable-2.21` branch was created. Testing against `devel`
and `milestone` now uses 2.22, which requires creation of the
`tests/sanity/ignore-2.22.txt` file in all maintained collection branches.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch ignore-2.22
# Changes to be committed:
#	new file:   tests/sanity/ignore-2.22.txt
#

(cherry picked from commit 58f8f2e6e9)

Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kiev.ua>
2026-04-20 18:34:47 -04:00
Bianca HendersonandGitHub 386f601ae0 Prep 5.4.2 release (#1083)
SUMMARY

Prep kubernetes.core 5.4.2 release

COMPONENT NAME

Multiple

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Bikouo Aubin
Reviewed-by: Alina Buzachis
Reviewed-by: Mike Graves <mgraves@redhat.com>
5.4.2
2026-02-03 16:14:10 +00:00
Bianca HendersonandGitHub 3f2841be95 Remove references to non-existent test files from helm integration test target (#1085)
SUMMARY

While preparing the 5.4.2 release, an integration test failure indicated that there are references to non-existent test files in the helm integration test target in the stable-5 branch. This is because the changes from #955 were merged into main and stable-6 but not into stable-5 (which is correct, since it's a minor change) but there are references to those helm test targets in #1039, which got backported to both branches as a bugfix.

Reviewed-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
Reviewed-by: Mike Graves <mgraves@redhat.com>
2026-01-30 19:29:16 +00:00
patchback[bot]andGitHub 91f6827e23 Add idempotency to helm_pull module (#1055) (#1081)
This is a backport of PR #1055 as merged into main (34beacf).
SUMMARY
This PR implements idempotency for the helm_pull module, addressing issue #889.

New force parameter with defaults to False.
implemented chart_exists() function
checks chart existence before downloading, returns changed=False when chart exists

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
helm_pull
ADDITIONAL INFORMATION
Force parameter added for backward compatibility and edge cases.
Implemented with the partial support of GitHub Copilot with Claude Sonnet 4.5 model

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2026-01-29 18:34:38 +00:00
patchback[bot]andGitHub 4136d6f606 Fix incorrect assertion in helm_pull integration test (#1077) (#1078)
This is a backport of PR #1077 as merged into main (23b6cec).
SUMMARY

The error message emitted for incorrect helm version has changed since the merge of #1039. This PR updates the related assertion in the helm_pull integration test

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2026-01-29 17:45:43 +00:00
Bianca HendersonandGitHub 12847a1555 Replace passing `warnings to exit_json with AnsibleModule.warn` for the few modules (#1033) (#1074)
This is a backport of PR #1033 as merged into main (3e32c12).
SUMMARY
Using exit_json or fail_json for warnings is deprecated in ansible-core>=2.19.0 and will be removed in ansible-core>=2.23.0
Tested with ansible-core 2.19.3 as the latest released version at the time of the start of this PR and with 2.16.0 as the lowest version supported by kubernetes.core 6.x
Resolves: #1031
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
k8s_drain
k8s_rollback
k8s_scale
ADDITIONAL INFORMATION
The initial version of this PR covers only the module k8s_drain, with the following commits extended to k8s_rollback
k8s_scale

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Mike Graves <mgraves@redhat.com>
2026-01-26 22:43:02 +00:00
GomathiselviS 8ddb19aade Fix cherry-pick spillover
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
2026-01-26 11:22:13 -08:00
Yuriy NovostavskiyandGomathiselviS 0f6b4c873a Limit compatibility to Helm =>v3.0.0,<4.0.0 (#1039)
SUMMARY
Helm v4 is a major version with backward-incompatible changes, including to the flags and output of the Helm CLI and to the SDK. This version is currently not supported in the kubernetes.core. This PR is related to #1038 and is a short-term solution to mark compatibility explicitly
ISSUE TYPE

Bugfix Pull Request
Docs Pull Request

COMPONENT NAME

helm
helm_template
helm_info
helm_repository
helm_pull
helm_registry_auth
helm_plugin
helm_plugin_info

ADDITIONAL INFORMATION
Added `validate_helm_version()`` method to AnsibleHelmModule that enforces version constraint >=3.0.0,<4.0.0.
Fails fast with clear error message: "Helm version must be >=3.0.0,<4.0.0, current version is {version}"
Some modules (i.e. helm_registry_auth) technically is compatible with Helm v4, but validation was added to all helm modules.
Partially coauthored by GitHub Copilot with Claude Sonnet 4 model.
Addresses issue #1038

Reviewed-by: GomathiselviS <gomathiselvi@gmail.com>
Reviewed-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: Alina Buzachis
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
(cherry picked from commit 13791ec7bf)

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
2026-01-26 11:03:26 -08:00
patchback[bot]andGitHub acc168e61f Fix K8S_AUTH_VERIFY_SSL environment value handling in kubectl connection plugin (#1049) (#1068)
This is a backport of PR #1049 as merged into main (12abc9b).
SUMMARY
Fixed a bug where setting K8S_AUTH_VERIFY_SSL=true (or any string value) caused the value to be treated as a separate kubectl command argument instead of being properly converted to a boolean.
The option key name is validate_certs, which does NOT end with "verify_ssl", so the original condition key.endswith("verify_ssl") at line 327 failed. This caused the code to fall through to the else block which added the value as separate
arguments: ["--insecure-skip-tls-verify", "true"], making "true" appear as a kubectl command.
Fixes #1021
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
kubernetes.core.kubectl
ADDITIONAL INFORMATION
Changes Made

Changed condition from key.endswith("verify_ssl") to key == "validate_certs"
Added import of boolean function from ansible.module_utils.parsing.convert_bool
Added proper boolean conversion using boolean(self.get_option(key), strict=False)

Partially used LLM (GitHub Copilot with Claude Sonnet 4).
Before Fix
K8S_AUTH_VERIFY_SSL=true
Command: ['/usr/bin/kubectl', '--insecure-skip-tls-verify', 'true', 'exec', ...]

                                                            ^^^^^ treated as kubectl command (BUG!)

After Fix
K8S_AUTH_VERIFY_SSL=true
Command: ['/usr/bin/kubectl', '--insecure-skip-tls-verify=false', 'exec', ...]
                                                           ^^^^^ properly converted (FIXED!)

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2026-01-23 20:24:33 +00:00
patchback[bot]andGitHub 49f54edad2 chore(CI): prevent patchback bot from labeling new PRs (#1062) (#1066)
This is a backport of PR #1062 as merged into main (987c029).
SUMMARY
Currently, the patchback bot creates PRs with cherry-picks of PRs that are labeled with stable-* label, and this PR (as any new PR) gets labeled as needs_triage. This is unnecessary as it intentional PR created by the CI job.
This pull request introduces a small update to ensure that the workflow only runs if the pull request is not created by the patchback[bot] user to avoid unnecessary labels.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
.github/workflows/label-new-prs.yaml
ADDITIONAL INFORMATION
No changelog is required 

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2026-01-22 20:51:52 +00:00
patchback[bot]andGitHub c6519926a6 chore(doc): update typos (#1059) (#1067)
This is a backport of PR #1059 as merged into main (6c00f7c).
SUMMARY
This trivial documentation-only pull request correcting a few errors in README.md.

Documentation corrections:

Fixed a broken Markdown link for the GitHub repository in the support request section.
Corrected the reference from LICENCE to LICENSE to match the actual file name.



ISSUE TYPE

Docs Pull Request

COMPONENT NAME
README.md
ADDITIONAL INFORMATION
Trivial documentation-only change, no changelog is required.

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2026-01-22 20:51:27 +00:00
patchback[bot]andGitHub 0ff5c952b8 address sanity issues (#1056) (#1065)
This is a backport of PR #1056 as merged into main (bd1cacc).
SUMMARY


helm/helm_info - Deprecate some parameters and add new ones to resolve sanity issues.
k8s - the return block doc is not aligned with what the module returns


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

helm, helm_info, k8s
Fixes: #1046

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2026-01-22 13:25:20 +00:00
patchback[bot]andGitHub 477a9b0b9e Add new workflow to label prs with needs_triage (#1045) (#1047)
This is a backport of PR #1045 as merged into main (9cfa903).
SUMMARY
This pr adds a new workflow for labeling new and reopened prs that are not marked as draft. The needs_triage label will be removed if the pr is marked as draft during development and re-added once the pr is marked as ready for review.
After consulting with the team, we decided to label prs in a new workflow to allow for the prs and issues to have different labels in the future.
ACA-2362
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
github workflow
Reported CI Issues
Sanity tests: #1046

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2025-12-18 14:27:25 +00:00
patchback[bot]andGitHub eac3c0a88b Add 2.21 ignore file for sanity tests (#1032) (#1035)
This is a backport of PR #1032 as merged into main (1c16a2d).
SUMMARY

Resolves #1027

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2025-10-23 20:08:41 +00:00
patchback[bot]andGitHub e00d4fc9d7 Extend k8s action group (#992) (#1025)
This is a backport of PR #992 as merged into main (798f549).
SUMMARY


Add all k8s_* modules to the action group in order to esaily set kubeconfig parameter
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

meta
ADDITIONAL INFORMATION

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2025-10-14 20:46:30 +00:00
patchback[bot]andGitHub 623b8b2716 Selectively redact sensitive kubeconfig data from logs (#1014) (#1023)
This is a backport of PR #1014 as merged into main (4fa3648).
SUMMARY

Resolves #782

ISSUE TYPE


Bugfix Pull Request

ADDITIONAL INFORMATION


The proper redaction of kubeconfig data can be seen by running this example playbook with verbosity of -vvv against the code in this PR.
Prior to these changes, all info was redacted (as shown in the example below):
ok: [local] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "api_key": null,
            "binary_path": null,
            "ca_cert": null,
            "context": null,
            "get_all_values": false,
            "host": null,
            "kubeconfig": {
                "apiVersion": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                "clusters": [
                    {
                        "cluster": {
                            "insecure-skip-tls-verify": true,
                            "server": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                        },
                        "name": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                    },
                    {
                        "cluster": {
                            "certificate-authority-data": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                            "server": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                        },
                        "name": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                    },
                    {
                        "cluster": {
                            "certificate-authority": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                            "extensions": [
                                {
                                    "extension": {
                                        "last-update": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                                        "provider": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                                        "version": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                                    },
                                    "name": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                                }
                            ],
                            "server": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                        },
                        "name": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                    }
                ],
                "contexts": [
                    {
                        "context": {
                            "cluster": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                        },
                        "name": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                    },
                    {
                        "context": {
                            "cluster": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                        },
                        "name": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                    },
[output shortened]

With the changes in this PR, only sensitive data is redacted:
ok: [local] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "api_key": null,
            "binary_path": null,
            "ca_cert": null,
            "context": null,
            "get_all_values": false,
            "host": null,
            "kubeconfig": {
                "apiVersion": "v1",
                "clusters": [
                    {
                        "cluster": {
                            "insecure-skip-tls-verify": true,
                            "server": "<server address>"
                        },
                        "name": "exercise"
                    },
                    {
                        "cluster": {
                            "certificate-authority-data": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                            "server": "<server address>"
                        },
                        "name": "kind-drain-test"
                    },
                    {
                        "cluster": {
                            "certificate-authority": "<path to .crt>",
                            "extensions": [
                                {
                                    "extension": {
                                        "last-update": "Tue, 07 Oct 2025 11:25:54 EDT",
                                        "provider": "minikube.sigs.k8s.io",
                                        "version": "v1.35.0"
                                    },
                                    "name": "cluster_info"
                                }
                            ],
                            "server": "<server address>"
                        },
                        "name": "minikube"
                    }
                ],
                "contexts": [
                    {
                        "context": {
                            "cluster": "exercise-pod",
                            "user": "bianca"
                        },
                        "name": "exercise"
                    },
                    {
                        "context": {
                            "cluster": "kind-drain-test",
                            "user": "kind-drain-test"
                        },
                        "name": "kind-drain-test"
                    },
[output shortened]

Reviewed-by: GomathiselviS <gomathiselvi@gmail.com>
2025-10-14 19:16:18 +00:00
patchback[bot]andGitHub 906c50f2c6 775 document proxy configurations (#1018) (#1019)
This is a backport of PR #1018 as merged into main (ae624cf).
SUMMARY
Added documentation for no_proxy, proxy, and proxy_headers parameters that were missing from the k8s lookup plugin. These parameters are already implemented in the codebase but were not documented.
no_proxy: Comma separated list of hosts that shouldn't use proxy
proxy: HTTP proxy URL for connections
proxy_headers: Dictionary of proxy headers with suboptions for proxy_basic_auth, basic_auth, and user_agent
Fixes #775
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
k8s lookup
Additional comment
This is a reissue of #993, which was lost during the latest release due to me PR incorrectly from my fork's main branch. Linter errors on the previous PR should already be resolved.
This had the backport-5, backport-6 and skip-changelog labels.

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2025-10-10 17:30:27 +00:00
Mandar KulkarniandGitHub b16bb15d34 prepare release 5.4.1 (#1009)
SUMMARY


ISSUE TYPE


Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
5.4.1
2025-10-07 13:07:26 +00:00