mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-08 05:52:37 +00:00
Prep release 6.0.0 (#933)
SUMMARY Prep kubernetes.core 6.0.0 Prerequisite: Release of community.okd/redhat.openshift 4.0.2 needs to happen first ISSUE TYPE Feature Pull Request COMPONENT NAME Multiple Reviewed-by: Bikouo Aubin
This commit is contained in:
@@ -4,6 +4,20 @@ Kubernetes Collection Release Notes
|
|||||||
|
|
||||||
.. contents:: Topics
|
.. contents:: Topics
|
||||||
|
|
||||||
|
v6.0.0
|
||||||
|
======
|
||||||
|
|
||||||
|
Release Summary
|
||||||
|
---------------
|
||||||
|
|
||||||
|
This major release removes the deprecated ``k8s`` inventory plugin and also removes ``ansible-core<2.16`` support.
|
||||||
|
|
||||||
|
Breaking Changes / Porting Guide
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
- Remove deprecated ``k8s`` invetory plugin (https://github.com/ansible-collections/kubernetes.core/pull/867).
|
||||||
|
- Remove support for ``ansible-core<2.16`` (https://github.com/ansible-collections/kubernetes.core/pull/867).
|
||||||
|
|
||||||
v5.3.0
|
v5.3.0
|
||||||
======
|
======
|
||||||
|
|
||||||
@@ -124,7 +138,7 @@ Bugfixes
|
|||||||
- integrations test helm_kubeconfig - set helm version to v3.10.3 to avoid incompatability with new bitnami charts (https://github.com/ansible-collections/kubernetes.core/pull/670).
|
- integrations test helm_kubeconfig - set helm version to v3.10.3 to avoid incompatability with new bitnami charts (https://github.com/ansible-collections/kubernetes.core/pull/670).
|
||||||
|
|
||||||
v3.3.1
|
v3.3.1
|
||||||
=======
|
======
|
||||||
|
|
||||||
Release Summary
|
Release Summary
|
||||||
---------------
|
---------------
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -1,5 +1,5 @@
|
|||||||
# Also needs to be updated in galaxy.yml
|
# Also needs to be updated in galaxy.yml
|
||||||
VERSION = 6.0.0-dev0
|
VERSION = 6.0.0
|
||||||
|
|
||||||
TEST_ARGS ?= ""
|
TEST_ARGS ?= ""
|
||||||
PYTHON_VERSION ?= `python -c 'import platform; print(".".join(platform.python_version_tuple()[0:2]))'`
|
PYTHON_VERSION ?= `python -c 'import platform; print(".".join(platform.python_version_tuple()[0:2]))'`
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ You can also include it in a `requirements.yml` file and install it via `ansible
|
|||||||
---
|
---
|
||||||
collections:
|
collections:
|
||||||
- name: kubernetes.core
|
- name: kubernetes.core
|
||||||
version: 5.2.0
|
version: 6.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installing the Kubernetes Python Library
|
### Installing the Kubernetes Python Library
|
||||||
|
|||||||
@@ -1044,3 +1044,11 @@ releases:
|
|||||||
- 898-k8s-dont-delete-in-check-mode.yaml
|
- 898-k8s-dont-delete-in-check-mode.yaml
|
||||||
- 919-update-ansible-lint-version.yaml
|
- 919-update-ansible-lint-version.yaml
|
||||||
release_date: '2025-05-16'
|
release_date: '2025-05-16'
|
||||||
|
6.0.0:
|
||||||
|
changes:
|
||||||
|
breaking_changes:
|
||||||
|
- Remove deprecated ``k8s`` invetory plugin (https://github.com/ansible-collections/kubernetes.core/pull/867).
|
||||||
|
- Remove support for ``ansible-core<2.16`` (https://github.com/ansible-collections/kubernetes.core/pull/867).
|
||||||
|
fragments:
|
||||||
|
- 20250121-breaking-changes-6.0.0.yml
|
||||||
|
release_date: '2025-05-19'
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
breaking_changes:
|
|
||||||
- Remove support for ``ansible-core<2.16`` (https://github.com/ansible-collections/kubernetes.core/pull/867).
|
|
||||||
- Remove deprecated ``k8s`` invetory plugin (https://github.com/ansible-collections/kubernetes.core/pull/867).
|
|
||||||
@@ -289,6 +289,29 @@ Parameters
|
|||||||
<div>Provide a URL for accessing the API. Can also be specified via <code>K8S_AUTH_HOST</code> environment variable.</div>
|
<div>Provide a URL for accessing the API. Can also be specified via <code>K8S_AUTH_HOST</code> environment variable.</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
<b>insecure_skip_tls_verify</b>
|
||||||
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">boolean</span>
|
||||||
|
</div>
|
||||||
|
<div style="font-style: italic; font-size: small; color: darkgreen">added in 5.3.0</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul style="margin: 0; padding: 0"><b>Choices:</b>
|
||||||
|
<li><div style="color: blue"><b>no</b> ←</div></li>
|
||||||
|
<li>yes</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div>Skip tls certificate checks for the chart download.</div>
|
||||||
|
<div>Do not confuse with the <code>validate_certs</code> option.</div>
|
||||||
|
<div>This option is only available for helm >= 3.16.0.</div>
|
||||||
|
<div style="font-size: small; color: darkgreen"><br/>aliases: skip_tls_certs_check</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
|||||||
@@ -279,7 +279,8 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Whether or not to check tls certificate for the chart download.</div>
|
<div>Whether or not to check tls certificate for the chart download.</div>
|
||||||
<div>Requires helm >= 3.3.0.</div>
|
<div>Requires helm >= 3.3.0. Alias <code>insecure_skip_tls_verify</code> added in 5.3.0.</div>
|
||||||
|
<div style="font-size: small; color: darkgreen"><br/>aliases: insecure_skip_tls_verify</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -143,6 +143,27 @@ Parameters
|
|||||||
<div>Provide a URL for accessing the API. Can also be specified via <code>K8S_AUTH_HOST</code> environment variable.</div>
|
<div>Provide a URL for accessing the API. Can also be specified via <code>K8S_AUTH_HOST</code> environment variable.</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1">
|
||||||
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
<b>insecure_skip_tls_verify</b>
|
||||||
|
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||||
|
<div style="font-size: small">
|
||||||
|
<span style="color: purple">boolean</span>
|
||||||
|
</div>
|
||||||
|
<div style="font-style: italic; font-size: small; color: darkgreen">added in 5.3.0</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul style="margin: 0; padding: 0"><b>Choices:</b>
|
||||||
|
<li><div style="color: blue"><b>no</b> ←</div></li>
|
||||||
|
<li>yes</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div>Skip tls certificate checks for the repository url.</div>
|
||||||
|
<div style="font-size: small; color: darkgreen"><br/>aliases: skip_tls_certs_check</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1">
|
<td colspan="1">
|
||||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||||
|
|||||||
@@ -174,8 +174,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Hide fields matching any of the field definitions in the result</div>
|
<div>Hide fields matching any of the field definitions in the result</div>
|
||||||
<div>An example might be <code>hidden_fields=[metadata.managedFields]</code></div>
|
<div>An example might be <code>hidden_fields=[metadata.managedFields]</code> or V(hidden_fields=[spec.containers[0].env[3].value]) or V(hidden_fields=[metadata.annotations[kubectl.kubernetes.io/last-applied-configuration]])</div>
|
||||||
<div>Only field definitions that don't reference list items are supported (so V(spec.containers[0]) would not work)</div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -395,8 +395,7 @@ Parameters
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div>Hide fields matching this option in the result</div>
|
<div>Hide fields matching this option in the result</div>
|
||||||
<div>An example might be <code>hidden_fields=[metadata.managedFields]</code></div>
|
<div>An example might be <code>hidden_fields=[metadata.managedFields]</code> or V(hidden_fields=[spec.containers[0].env[3].value]) or V(hidden_fields=[metadata.annotations[kubectl.kubernetes.io/last-applied-configuration]])</div>
|
||||||
<div>Only field definitions that don't reference list items are supported (so V(spec.containers[0]) would not work)</div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ tags:
|
|||||||
- openshift
|
- openshift
|
||||||
- okd
|
- okd
|
||||||
- cluster
|
- cluster
|
||||||
version: 6.0.0-dev0
|
version: 6.0.0
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- .DS_Store
|
- .DS_Store
|
||||||
- "*.tar.gz"
|
- "*.tar.gz"
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ plugin_routing:
|
|||||||
redirect: community.okd.openshift
|
redirect: community.okd.openshift
|
||||||
k8s:
|
k8s:
|
||||||
tombstone:
|
tombstone:
|
||||||
# To be replaced with 6.0.0 in release 6.0.0 commit
|
removal_version: 6.0.0
|
||||||
removal_version: 6.0.0-dev0
|
|
||||||
warning_text: >-
|
warning_text: >-
|
||||||
The k8s inventory plugin was slated for deprecation in 3.3.0 and has been removed in release 6.0.0. Use kubernetes.core.k8s_info and ansible.builtin.add_host instead.
|
The k8s inventory plugin was slated for deprecation in 3.3.0 and has been removed in release 6.0.0. Use kubernetes.core.k8s_info and ansible.builtin.add_host instead.
|
||||||
modules:
|
modules:
|
||||||
|
|||||||
@@ -2,50 +2,57 @@ from __future__ import absolute_import, division, print_function
|
|||||||
|
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
import json
|
import re
|
||||||
|
|
||||||
import kubernetes
|
import kubernetes
|
||||||
import pytest
|
import pytest
|
||||||
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.core import (
|
from ansible_collections.kubernetes.core.plugins.module_utils.k8s.core import (
|
||||||
AnsibleK8SModule,
|
AnsibleK8SModule,
|
||||||
)
|
)
|
||||||
|
from mock import MagicMock, patch
|
||||||
|
|
||||||
MINIMAL_K8S_VERSION = "24.2.0"
|
MINIMAL_K8S_VERSION = "24.2.0"
|
||||||
UNSUPPORTED_K8S_VERSION = "11.0.0"
|
UNSUPPORTED_K8S_VERSION = "11.0.0"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("stdin", [{}], indirect=["stdin"])
|
class FakeAnsibleModule:
|
||||||
def test_no_warn(monkeypatch, stdin, capfd):
|
def __init__(self, **kwargs):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def exit_json(self):
|
||||||
|
raise SystemExit(0)
|
||||||
|
|
||||||
|
|
||||||
|
@patch.object(AnsibleK8SModule, "warn")
|
||||||
|
def test_no_warn(m_ansible_k8s_module_warn, monkeypatch, capfd):
|
||||||
monkeypatch.setattr(kubernetes, "__version__", MINIMAL_K8S_VERSION)
|
monkeypatch.setattr(kubernetes, "__version__", MINIMAL_K8S_VERSION)
|
||||||
|
|
||||||
module = AnsibleK8SModule(argument_spec={})
|
m_ansible_k8s_module_warn.side_effect = print
|
||||||
|
module = AnsibleK8SModule(argument_spec={}, module_class=FakeAnsibleModule)
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
module.exit_json()
|
module.exit_json()
|
||||||
out, err = capfd.readouterr()
|
out, err = capfd.readouterr()
|
||||||
|
m_ansible_k8s_module_warn.assert_not_called()
|
||||||
return_value = json.loads(out)
|
|
||||||
|
|
||||||
assert return_value.get("exception") is None
|
|
||||||
assert return_value.get("warnings") is None
|
|
||||||
assert return_value.get("failed") is None
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("stdin", [{}], indirect=["stdin"])
|
@patch.object(AnsibleK8SModule, "warn")
|
||||||
def test_warn_on_k8s_version(monkeypatch, stdin, capfd):
|
def test_warn_on_k8s_version(m_ansible_k8s_module_warn, monkeypatch, capfd):
|
||||||
monkeypatch.setattr(kubernetes, "__version__", UNSUPPORTED_K8S_VERSION)
|
monkeypatch.setattr(kubernetes, "__version__", UNSUPPORTED_K8S_VERSION)
|
||||||
|
|
||||||
module = AnsibleK8SModule(argument_spec={})
|
m_ansible_k8s_module_warn.side_effect = print
|
||||||
|
module = AnsibleK8SModule(argument_spec={}, module_class=FakeAnsibleModule)
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
module.exit_json()
|
module.exit_json()
|
||||||
|
|
||||||
|
m_ansible_k8s_module_warn.assert_called_once()
|
||||||
out, err = capfd.readouterr()
|
out, err = capfd.readouterr()
|
||||||
|
assert (
|
||||||
return_value = json.loads(out)
|
re.search(
|
||||||
|
r"kubernetes<([0-9]+\.[0-9]+\.[0-9]+) is not supported or tested. Some features may not work.",
|
||||||
assert return_value.get("warnings") is not None
|
out,
|
||||||
warnings = return_value["warnings"]
|
)
|
||||||
assert len(warnings) == 1
|
is not None
|
||||||
assert "kubernetes" in str(warnings[0])
|
)
|
||||||
assert MINIMAL_K8S_VERSION in str(warnings[0])
|
|
||||||
|
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
@@ -58,9 +65,17 @@ dependencies = [
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"stdin,desired,actual,result", [({}, *d) for d in dependencies], indirect=["stdin"]
|
"stdin,desired,actual,result", [({}, *d) for d in dependencies], indirect=["stdin"]
|
||||||
)
|
)
|
||||||
def test_has_at_least(monkeypatch, stdin, desired, actual, result, capfd):
|
@patch.object(AnsibleK8SModule, "warn")
|
||||||
|
def test_has_at_least(
|
||||||
|
m_ansible_k8s_module_warn, monkeypatch, stdin, desired, actual, result, capfd
|
||||||
|
):
|
||||||
monkeypatch.setattr(kubernetes, "__version__", actual)
|
monkeypatch.setattr(kubernetes, "__version__", actual)
|
||||||
|
|
||||||
|
def fake_warn(x):
|
||||||
|
print(x)
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
m_ansible_k8s_module_warn.side_effect = fake_warn
|
||||||
module = AnsibleK8SModule(argument_spec={})
|
module = AnsibleK8SModule(argument_spec={})
|
||||||
|
|
||||||
assert module.has_at_least("kubernetes", desired) is result
|
assert module.has_at_least("kubernetes", desired) is result
|
||||||
@@ -80,11 +95,18 @@ def test_requires_fails_with_message(
|
|||||||
monkeypatch, stdin, dependency, version, msg, capfd
|
monkeypatch, stdin, dependency, version, msg, capfd
|
||||||
):
|
):
|
||||||
monkeypatch.setattr(kubernetes, "__version__", "24.2.0")
|
monkeypatch.setattr(kubernetes, "__version__", "24.2.0")
|
||||||
module = AnsibleK8SModule(argument_spec={})
|
module = AnsibleK8SModule(argument_spec={}, module_class=FakeAnsibleModule)
|
||||||
|
|
||||||
|
def fake_fail_json(**kwargs):
|
||||||
|
print(f"Printing message => {kwargs}")
|
||||||
|
print(kwargs.get("msg"))
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
module.fail_json = MagicMock()
|
||||||
|
module.fail_json.side_effect = fake_fail_json
|
||||||
|
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
module.requires(dependency, version)
|
module.requires(dependency, version)
|
||||||
|
module.fail_json.assert_called_once()
|
||||||
out, err = capfd.readouterr()
|
out, err = capfd.readouterr()
|
||||||
return_value = json.loads(out)
|
assert msg in out
|
||||||
|
|
||||||
assert return_value.get("failed")
|
|
||||||
assert msg in return_value.get("msg")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user