* add matrix to test run helm tests with multiple version
* fix(ci): resolve SonarCloud security findings in helm integration workflow
Enforce HTTPS/TLS for the ansible-core download and pin and wheel-lock the
selinux_please_lie_to_me install. Suppress the two remaining findings
(ansible-core source install and shared test-requirements.txt pins) that
cannot be fixed here without breaking CI, following the existing
sonar.issue.ignore.multicriteria pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): fix remaining sanity and SonarCloud quality gate failures
Remove stale import-3.9!skip entries from tests/sanity/ignore-2.23.txt;
ansible-core devel dropped the import-3.9 sanity test target entirely, so
referencing it now fails the "ignores" sanity test itself.
Switch the e4/e5 sonar.issue.ignore.multicriteria resourceKey patterns in
sonar-project.properties from a bare literal filename to a **/ glob, matching
the working e1-e3 patterns. The literal path was not matching during
analysis, so the two intended suppressions (githubactions:S8541/S8544 on
integration-tests-helm.yaml) never took effect and kept failing the new
code security rating gate.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(helm): add regression coverage for plain_http/helm-diff fix, enable helm_uninstall target
helm_diff: replace the unreachable "< 3.13.0" OCI-chart block (plain_http is
only ever true for >= 3.13.0, so the two conditions could never both hold)
with a ">= 3.13.0" case that installs helm-diff and runs a plain_http diff
upgrade, exercising the exact path the plain_http/--plain-http fix touches.
helm_plain_http: replace the HTTPS Bitnami-backed test with one that pushes
a local chart to the plain-HTTP registry from setup_helm_registry and
exercises helm/helm_pull/helm_template against it, so success assertions
verify plain HTTP actually works rather than only that the flag was passed.
Also drop the now-stale redis* .gitignore entry.
helm_uninstall: add the missing aliases file (every sibling helm target has
one; without it the target is not picked up by CI target selection) and
replace a dead assertion gated on helm < 3.7.0 with one that matches the
versions this target actually runs against (>= 3.8.0).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): make the S8541/S8544 SonarCloud suppressions actually take effect
The three flagged lines (ansible-core source install, shared
requirements.txt install) have been open since before the suppression
rules were added, and two prior attempts at the e4/e5 resourceKey pattern
(literal filename, then a **/filename glob) left them unresolved across
multiple fresh analyses - already-raised issues on unchanged lines do not
appear to get re-evaluated against newly added ignore rules.
Broaden e4/e5 to the same .github/workflows/**/*.yaml pattern already
proven to work for e3 (confirmed: githubactions:S7637 has 20 open issues
org-wide but 0 here, despite this repo having @main references e3 is meant
to suppress). This is also a more honest scope: all_green_check.yaml has
the identical ansible-core-from-source and shared-requirements.txt
patterns, not just integration-tests-helm.yaml.
Also make a no-op edit to the two flagged lines (reorder the pip flag and
the two -r files; verified zero package overlap between requirements.txt
and test-requirements.txt) so SonarCloud treats them as changed and
re-evaluates them against the fixed suppression rule, rather than carrying
forward the stale pre-suppression issue state.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* Fix tests and the possibility to run helm tests locally
Fix linters errors
---------
Co-authored-by: GomathiS <gosriniv@redhat.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
ansible-core devel dropped Python 3.9 support (ansible/ansible#87582),
which removed the import-3.9 sanity test. The ignores sanity test now
fails on entries for a test that does not exist.
Fixes#1275
* Prep `5.5.0` release (#1260)
* Prep `5.5.0` release
Bump galaxy.yml to 5.5.0, generate the changelog from the eight pending
fragments, and regenerate module documentation.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Bump Makefile VERSION to 5.5.0
The Makefile pins VERSION independently of galaxy.yml and feeds the
clean, release and install targets. Left at 5.4.4 it would publish
kubernetes-core-5.4.4.tar.gz for a 5.5.0 build.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Bump README requirements.yml example to 5.5.0
The install example pins the collection version and is updated at every
release; it sits outside the collection_prep managed block, so
`tox -e add_docs` does not refresh it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 747964cefe)
* docs: restore changelog fragments
---------
Co-authored-by: Mandar Kulkarni <mandkulk@redhat.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(helm): validate reuse_values against reset_values and replace
reset_values defaults to true and helm ignores --reuse-values whenever
--reset-values is passed, so the documented reuse_values example was a
no-op. Warn rather than flip the default, which would silently change
what existing playbooks deploy.
helm install accepts neither --reuse-values nor --reset-then-reuse-values,
so pairing either with replace could only ever make helm report an unknown
flag. Fail up front instead, and keep both flags inside the upgrade branch.
Fixes#1229
* fix(docstring): neither nor replacing
Co-authored-by: Don Naro <dnaro@redhat.com>
* fix(helm): warn instead of failing on replace + reuse_values
reuse_values has been accepted since 3.0.0, and a converged release never
reaches deploy(), so these combinations pass in playbooks today. Failing
in main() would turn them red on upgrade. The flags are already dropped
from the install path, so warning leaves a valid command behind.
Splits the changelog fragment per user-visible change, and covers the
helm diff path, whose 'not replace' guards the hard failure had made
unreachable.
Changes based on the @abikouo's feedback
---------
Co-authored-by: Don Naro <dnaro@redhat.com>
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
* 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>
* fix(k8s_cp): wait for remote tar to finish before closing the stream
The module closed the exec connection right after writing the last chunk,
killing tar mid-extract, and never checked its exit status, so a partial
or failed copy was reported as success (#776).
The v4 exec protocol cannot half-close stdin, and busybox tar blocks for
EOF rather than stopping at the end-of-archive marker, so bound the stream
with `head -c N | tar ...`. tar then gets a clean EOF, exits on its own,
and its status is read from the error channel. Containers without /bin/sh
and head keep the previous behaviour and get a warning.
Also add copy_timeout (default 300s, #621) and stream the archive from the
temp file instead of buffering every chunk in memory.
* test(k8s_cp): split combined assert into separate statements
Addresses review feedback on #1217.
* chore(changelog): link the PR and use single-line fragment entries
* fix(linter): reformat with black
* fix(linter): sort imports in test_copy.py
isort --profile black puts ansible_collections in the same third-party
section as pytest, so the blank line between them is a failure.
* fix(k8s_cp): report what tar said when the copy fails early
An early close or a stall is the symptom; tar has usually already
written the cause (a read-only mount, a missing directory) to stderr,
and drain() has it. Discarding it left only the generic truncation or
timeout message.
* refactor(k8s_cp): move the stderr suffix into _fail
The nested fail() helper added a branch inside a closure, which counts
double for nesting and took _stream_tar_to_pod over Sonar's cognitive
complexity limit (14 -> 16). _fail already had the response; give it
the stderr too.
* test(k8s_cp): tempfile for the repeated-copy test directory
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
---------
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
* Add a deprecation notice for ENABLE_TURBO_MODE
* minor fix
* fix(turbo): ensure deprecation warning reaches user and skip turbo on unsupported ansible-core
Move the ENABLE_TURBO_MODE deprecation warning to module import time,
since AnsibleTurboModule.__init__() exits the process before returning,
making the previous per-instance deprecate() call unreachable. Also
skip turbo mode on ansible-core >= 2.19.0, where cloud.common is not
supported and the import succeeding could otherwise fail later with
an unrelated traceback, and warn instead of silently falling back
when cloud.common is not installed.
Assisted-by: Claude Sonnet 5
* docs(turbo): clarify that turbo mode is ignored on ansible-core 2.19+
Turbo mode is now bypassed with a warning rather than failing on
unsupported ansible-core, so drop the "may lead to fails" wording from
the README note and the matching statement in the turbo mode guide.
Assisted-by: Claude Opus 5
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix(helm): skip OCI registry progress messages on stdout
Helm 4.2.1 moved the registry client's progress messages from stderr to
stdout (helm/helm#32056), so on an OCI reference they now precede the real
output. helm parses the stdout of `helm show chart` and helm_template
returns the stdout of `helm template`, and neither can detect this from the
return code because both commands exit 0.
Helm rewrites '+' to '_' in OCI tags, which makes it also print a free-text
explanation. That is not valid YAML, so a chart version carrying semver
build metadata failed outright. Without the '+' the messages parse as a
mapping instead, silently adding Pulled/Digest keys to the chart info.
Match helm's message verbatim rather than seeking the start of the real
output: the payload has three shapes and can be empty, whereas the messages
are always at the front and byte-identical. A reworded message then fails
loudly instead of consuming a line of real output.
Fixes: #1222
* test(helm): cover OCI charts whose version has build metadata
Pushes a chart versioned 1.0.0+build.1 to the local registry and asserts
that helm installs it idempotently with the version reported verbatim, and
that helm_template returns only rendered manifests. A second version without
build metadata covers the case where the registry messages parse as YAML.
Pinned to Helm 4.2.4: the target is only meaningful on >= 4.2.1, which is
where the messages moved to stdout. The rest of the helm matrix tops out at
v4.0.0, which is why this went unnoticed.
Verified to fail on the parent commit and pass on the fix.
* test(helm): drop Go template from chart fixture
The yamllint sanity test parses chart templates with libyaml, where
`{{ default "test" .Values.myValue }}` is an unhashable mapping key. The
existing chart fixtures carry a yamllint!skip entry in every
tests/sanity/ignore-*.txt for exactly this, but the target never renders
the chart with values, so the template served no purpose. Making the
fixture plain YAML keeps the ignore lists from growing.
* test(ci): empty commit to re-trigger CI
* 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
* 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.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add changelog fragment for ansible-lint warning fixes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix changelog fragment YAML formatting
Quote strings to avoid YAML parsing ambiguity in the trivial section.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
* fix(meta): add missing modules to helm and k8s action groups
`helm_plugin` and `helm_plugin_info` both build their argument spec from
`HELM_AUTH_ARG_SPEC`, and `k8s_taint` builds its own from `AUTH_ARG_SPEC`,
but none of the three were listed in the action groups. Anyone setting
`module_defaults` on `group/kubernetes.core.helm` or
`group/kubernetes.core.k8s` silently got no defaults for them.
Deliberately left out of the groups, since they do not accept the shared
authentication options and would make `module_defaults` fail for every
user of the group:
- `helm_pull` and `helm_template` take only `binary_path`
- `helm_registry_auth` takes `binary_path` plus its own required `host`,
which is an OCI registry URL rather than a Kubernetes API server
- `kubeconfig` writes a kubeconfig file locally and takes no cluster
connection options
Also documents both action groups in the scenario guide, including the
exclusions above and the distinction from the legacy `k8s` group that
ansible-core defines, which is a different group and does not cover this
collection's modules.
Closes#577
* test(meta): guard action group membership against argspec drift
The action groups in `meta/runtime.yml` were maintained by hand, so
`helm_plugin`, `helm_plugin_info` and `k8s_taint` were able to inherit the
shared authentication arg specs without anyone adding them to a group.
Nothing failed, users just silently got no `module_defaults`.
Asserts the invariant in both directions: a module belongs to a group if
and only if it builds its argument spec from that group's shared constant.
The reverse direction matters too, since a member that does not accept the
shared options makes `module_defaults` fail with "Unsupported parameters"
for every user of the group.
Membership is read statically with `ast`, so the test needs no imports and
runs without a cluster or the `kubernetes` package.
The four modules that are deliberately excluded are listed with their
reasons, so restoring one has to be a decision rather than an oversight.
* fix(tests): satisfy pylint disallowed-name and set an explicit license
ansible-test's pylint profile rejects `_` as a name, which the sanity job
flagged three times. Rather than renaming the throwaways, give the entries
in SHARED_ARG_SPECS named keys so there is nothing to discard when reading
them back.
The header was copied from a sibling test that carries Apache-2.0 because
it derives from kubernetes/kubernetes, so it named the wrong copyright
holder. It now names the author, and keeps Apache-2.0 deliberately: the
collection requirements allow code outside plugins/ that imports no
GPL-3.0-or-later code to use any GPL-3.0-compatible license, and this file
imports only ast, os, pytest and yaml, since it reads group membership
statically rather than importing the modules. A comment records that
reasoning so the constraint is visible if an import is ever added.
* fix(doc): update changelog fragment with the manintainer suggestion
* fix(doc): show helm group defaults in the action group example
abikouo asked for the module_defaults example to cover the helm action
group as well, with tasks that actually consume those defaults. Set
binary_path, kubeconfig and context on group/kubernetes.core.helm and
add helm_repository, helm and helm_info tasks that rely on them; the
namespace in the k8s tasks now matches the release namespace so the
playbook reads as one flow.
Co-Authored-By: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
---------
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
* Support wait_for_jobs flag for helm release upgrade/install
* Update plugins/modules/helm.py
Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
* Apply suggestion from @abikouo
* fix(helm): correct wait_for_jobs implementation and add changelog
- Fix double-append of --wait-for-jobs flag
- Fix version check to run before appending the flag
- Fetch helm_version before use to avoid undefined variable
- Fix YAML indentation for version_added in docs
- Add changelog fragment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add integration tests for wait_for_jobs
- Test that --wait-for-jobs is appended when wait=true and wait_for_jobs=true
- Test that wait_for_jobs fails with appropriate message on helm < 3.5.0
- Test that wait_for_jobs is ignored when wait is not set
- Add test-chart-job helm chart containing a simple Job resource
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: harden test Job pod spec
Disable service account token automounting and add memory limit to
the test Job container.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add resource requests and pin image version in test Job
Add CPU, memory, and ephemeral-storage requests. Pin busybox image
to version 1.37.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* style: apply linter formatting to helm argument_spec
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Update sanity ignore file
* fix: quote Helm template expression to pass yamllint sanity
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix linters errors
---------
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
Co-authored-by: aubin bikouo <abikouo@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Add a `job_complete` predicate that waits for Job resources to reach
either `Complete` or `Failed` condition, removing the need for custom
wait_condition workarounds.
Also rename shadowed `match` variable to `match_condition` in
`custom_condition` to avoid masking the Python built-in.
Fixesansible-collections/kubernetes.core#1201
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat(helm): add cleanup_on_fail option
atomic rolls back to the last successful revision but can leave behind
resources the failed upgrade created; helm accepts both flags together so
the rollback also drops those orphans.
Rejected with replace=true, since that deploys via helm install, which has
no --cleanup-on-fail. No version gate: the flag exists in helm 3.0.0, the
module's minimum, and was not renamed in v4.
* refactor(tests): share helm command-building test helpers
The new cleanup_on_fail tests copied setUp and _run_with_version verbatim
from the atomic tests, which SonarQube flagged as duplication on new code.
Extract both to module level so the two classes share them.
Scoped to the classes involved in that duplication; the other test classes
in this file keep their own fixtures.
* test(helm): align cleanup_on_fail assertions with review feedback
Adjust the Helm unit tests to assert the expected flags for
cleanup_on_fail on Helm v3 and v4, matching the behavior clarified
in review feedback.
Co-authored-by: abikouo <abikouo@users.noreply.github.com>
---------
Co-authored-by: abikouo <abikouo@users.noreply.github.com>
* 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.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* 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.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* 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.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: aubin bikouo <abikouo@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* 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>
* 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
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
---------
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
* Prepare k8s collection release 6.5.0
* update release date for the version 6.5.0
* Update changelog.yaml and changelog.rst mismatch
---------
(cherry picked from commit 0f472b53e2)
Co-authored-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
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
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* 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
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* 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.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* 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
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add changelog fragment for security check workflow
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Update changelogs/fragments/1173-security-check-workflow.yml
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Bianca Henderson <beeankha@gmail.com>
* helm: use --rollback-on-failure for atomic on Helm v4
Helm v4 renamed the `--atomic` flag to `--rollback-on-failure`. The old
flag is deprecated on `helm upgrade` and removed entirely from `helm
install`, so `atomic: true` failed against Helm v4 (issue #1143).
Emit the version-appropriate flag from deploy() using the existing
is_helm_v4() helper, covering both the upgrade and the replace/install
code paths. The public `atomic` option is unchanged.
Fixes: https://github.com/ansible-collections/kubernetes.core/issues/1143
Co-Authored-By: Claude Opus 4.8
* fix wrong link in the changelog fragment
Signed-off-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
---------
Signed-off-by: Yuriy Novostavskiy <yuriy@novostavskiy.kyiv.ua>
* fix(helm): support Helm v4 force/server-side apply flags
Helm v4 deprecated --force and enables server-side apply by default, so
playbooks relying on force=true broke with "Flag --force has been
deprecated" and "cannot use server-side apply and force replace together".
Because force always meant a client-side delete/recreate replacement, the
module now reproduces that behaviour on v4 (--server-side=false
--force-replace) so existing playbooks keep working unchanged across both
Helm versions.
To let users opt into Helm v4's server-side world explicitly, add
server_side and force_conflicts options. These are mutually exclusive with
force (a client-side replacement cannot coexist with a server-side mode),
keeping the surface unambiguous and surfacing bad combinations up front
instead of as cryptic Helm errors.
AI-assisted commit with Claude Opus
* fix(linter) reformat tests/unit/modules/test_module_helm.py with black
* 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
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
* helm: document/test stdout for registry success messages (Helm 4.2.1)
Helm < 4.2.1 prints registry success messages (Login Succeeded, Pushed,
Pulled, Digest) to stderr (helm/helm#13464); Helm >= 4.2.1 moves them to
stdout (helm/helm#32056). The modules key on the return code, so logic is
unaffected, but the RETURN docs and integration assertions assumed stderr.
- helm_registry_auth: note the version-dependent output stream in
the RETURN documentation.
- helm_registry_auth integration tests: assert success messages against the
stdout+stderr union so they pass on both old and new Helm.
Fixes: #1146
Co-Authored-By: Claude Opus 4.8
* ci: empty commit to re-trigger ci
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
The docs/ansible_turbo_mode.rst file was accidentally removed in PR#988,
breaking the link referenced in README.md. Restore it so users following
that link get the full Turbo mode documentation rather than a 404.
Additionally, document the ansible-core version compatibility issue for
cloud.common (see ansible-collections/cloud.common@5e3430d and
kubernetes.core PR #1109): Turbo mode is incompatible with ansible-core
>= 2.19 because cloud.common no longer supports it. Without this
clarification users on newer ansible-core versions encounter silent or
confusing failures when ENABLE_TURBO_MODE=1 is set.
Update README.md with the same warning so the incompatibility is visible
before users follow the link to the full docs.
Addresses: #927