diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 03b89acd..be1cc93a 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -131,7 +131,7 @@ jobs: source_path: ${{ env.ansible_posix }} - name: create kubernetes cluster - uses: helm/kind-action@v1.4.0 + uses: helm/kind-action@v1.8.0 - name: Run integration tests uses: ansible-network/github_actions/.github/actions/ansible_test_integration@main diff --git a/README.md b/README.md index 490ee6dd..c02ffd43 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ PEP440 is the schema used to describe the versions of Ansible. ## Python Support -* Collection supports 3.6+ +* Collection supports 3.9+ Note: Python2 is deprecated from [1st January 2020](https://www.python.org/doc/sunset-python-2/). Please switch to Python3. ## Kubernetes Version Support -This collection supports Kubernetes versions >=1.19. +This collection supports Kubernetes versions >= 1.24. ## Included content diff --git a/plugins/inventory/k8s.py b/plugins/inventory/k8s.py index 277b464a..1a6c5bfc 100644 --- a/plugins/inventory/k8s.py +++ b/plugins/inventory/k8s.py @@ -93,8 +93,8 @@ DOCUMENTATION = """ to access. requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" """ diff --git a/plugins/lookup/k8s.py b/plugins/lookup/k8s.py index 3211fbb7..a8d2c79c 100644 --- a/plugins/lookup/k8s.py +++ b/plugins/lookup/k8s.py @@ -114,8 +114,8 @@ DOCUMENTATION = """ aliases: [ verify_ssl ] requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" """ diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index e2971972..9c98b9da 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -796,8 +796,8 @@ class K8sAnsibleMixin(object): self.resource_definitions = [implicit_definition] def check_library_version(self): - if LooseVersion(self.kubernetes_version) < LooseVersion("12.0.0"): - self.fail_json(msg="kubernetes >= 12.0.0 is required") + if LooseVersion(self.kubernetes_version) < LooseVersion("24.2.0"): + self.fail_json(msg="kubernetes >= 24.2.0 is required") def flatten_list_kind(self, list_resource, definitions): flattened = [] diff --git a/plugins/module_utils/k8s/core.py b/plugins/module_utils/k8s/core.py index 1ecc182e..7d8c3167 100644 --- a/plugins/module_utils/k8s/core.py +++ b/plugins/module_utils/k8s/core.py @@ -35,7 +35,7 @@ class AnsibleK8SModule: if self.settings["check_k8s"]: self.requires("kubernetes") - self.has_at_least("kubernetes", "12.0.0", warn=True) + self.has_at_least("kubernetes", "24.2.0", warn=True) if self.settings["check_pyyaml"]: self.requires("pyyaml") diff --git a/plugins/modules/k8s.py b/plugins/modules/k8s.py index fb8e6800..dbb14760 100644 --- a/plugins/modules/k8s.py +++ b/plugins/modules/k8s.py @@ -195,8 +195,8 @@ options: version_added: 2.5.0 requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" - "jsonpatch" """ diff --git a/plugins/modules/k8s_cluster_info.py b/plugins/modules/k8s_cluster_info.py index 916c3059..9d52ccec 100644 --- a/plugins/modules/k8s_cluster_info.py +++ b/plugins/modules/k8s_cluster_info.py @@ -34,8 +34,8 @@ extends_documentation_fragment: - kubernetes.core.k8s_auth_options requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" """ diff --git a/plugins/modules/k8s_cp.py b/plugins/modules/k8s_cp.py index 185c8e06..d9adf407 100644 --- a/plugins/modules/k8s_cp.py +++ b/plugins/modules/k8s_cp.py @@ -26,8 +26,8 @@ extends_documentation_fragment: - kubernetes.core.k8s_auth_options requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" options: namespace: diff --git a/plugins/modules/k8s_drain.py b/plugins/modules/k8s_drain.py index 6b6e9648..8cf127fa 100644 --- a/plugins/modules/k8s_drain.py +++ b/plugins/modules/k8s_drain.py @@ -97,8 +97,8 @@ options: type: int requirements: - - python >= 3.6 - - kubernetes >= 12.0.0 + - python >= 3.9 + - kubernetes >= 24.2.0 """ EXAMPLES = r""" diff --git a/plugins/modules/k8s_exec.py b/plugins/modules/k8s_exec.py index 17affe81..e9cfc5cb 100644 --- a/plugins/modules/k8s_exec.py +++ b/plugins/modules/k8s_exec.py @@ -26,8 +26,8 @@ extends_documentation_fragment: - kubernetes.core.k8s_auth_options requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" notes: diff --git a/plugins/modules/k8s_info.py b/plugins/modules/k8s_info.py index e750d4cc..db85d625 100644 --- a/plugins/modules/k8s_info.py +++ b/plugins/modules/k8s_info.py @@ -59,8 +59,8 @@ extends_documentation_fragment: - kubernetes.core.k8s_wait_options requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" """ diff --git a/plugins/modules/k8s_json_patch.py b/plugins/modules/k8s_json_patch.py index efa62f48..92b652ca 100644 --- a/plugins/modules/k8s_json_patch.py +++ b/plugins/modules/k8s_json_patch.py @@ -62,8 +62,8 @@ extends_documentation_fragment: - kubernetes.core.k8s_wait_options requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" - "jsonpatch" """ diff --git a/plugins/modules/k8s_log.py b/plugins/modules/k8s_log.py index 48537e4a..6bed4caf 100644 --- a/plugins/modules/k8s_log.py +++ b/plugins/modules/k8s_log.py @@ -83,8 +83,8 @@ options: version_added: '2.4.0' requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" """ diff --git a/plugins/modules/k8s_rollback.py b/plugins/modules/k8s_rollback.py index 8dd68629..db7aca1e 100644 --- a/plugins/modules/k8s_rollback.py +++ b/plugins/modules/k8s_rollback.py @@ -34,8 +34,8 @@ extends_documentation_fragment: - kubernetes.core.k8s_auth_options - kubernetes.core.k8s_name_options requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" """ diff --git a/plugins/modules/k8s_scale.py b/plugins/modules/k8s_scale.py index cccd3527..6e7d8c44 100644 --- a/plugins/modules/k8s_scale.py +++ b/plugins/modules/k8s_scale.py @@ -45,8 +45,8 @@ options: version_added: 2.0.0 requirements: - - "python >= 3.6" - - "kubernetes >= 12.0.0" + - "python >= 3.9" + - "kubernetes >= 24.2.0" - "PyYAML >= 3.11" """ diff --git a/plugins/modules/k8s_service.py b/plugins/modules/k8s_service.py index 745520d9..b3cb7444 100644 --- a/plugins/modules/k8s_service.py +++ b/plugins/modules/k8s_service.py @@ -83,8 +83,8 @@ options: type: bool requirements: - - python >= 3.6 - - kubernetes >= 12.0.0 + - python >= 3.9 + - kubernetes >= 24.2.0 """ EXAMPLES = r""" diff --git a/plugins/modules/k8s_taint.py b/plugins/modules/k8s_taint.py index 5f0355ca..a430aa69 100644 --- a/plugins/modules/k8s_taint.py +++ b/plugins/modules/k8s_taint.py @@ -60,8 +60,8 @@ options: default: false type: bool requirements: - - python >= 3.6 - - kubernetes >= 12.0.0 + - python >= 3.9 + - kubernetes >= 24.2.0 """ EXAMPLES = r""" diff --git a/requirements.txt b/requirements.txt index cea80595..320e4eb7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -kubernetes>=12.0.0 +kubernetes>=24.2.0 requests-oauthlib jsonpatch diff --git a/tests/unit/module_utils/test_core.py b/tests/unit/module_utils/test_core.py index a50833d6..c8e5d07b 100644 --- a/tests/unit/module_utils/test_core.py +++ b/tests/unit/module_utils/test_core.py @@ -10,7 +10,7 @@ from ansible_collections.kubernetes.core.plugins.module_utils.k8s.core import ( AnsibleK8SModule, ) -MINIMAL_K8S_VERSION = "12.0.0" +MINIMAL_K8S_VERSION = "24.2.0" UNSUPPORTED_K8S_VERSION = "11.0.0" @@ -79,7 +79,7 @@ dependencies = [ def test_requires_fails_with_message( monkeypatch, stdin, dependency, version, msg, capfd ): - monkeypatch.setattr(kubernetes, "__version__", "12.0.0") + monkeypatch.setattr(kubernetes, "__version__", "24.2.0") module = AnsibleK8SModule(argument_spec={}) with pytest.raises(SystemExit): module.requires(dependency, version)