apache-airflow-providers-cncf-kubernetes 10.1.0rc2__tar.gz → 10.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of apache-airflow-providers-cncf-kubernetes might be problematic. Click here for more details.

Files changed (59) hide show
  1. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0}/PKG-INFO +10 -27
  2. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0}/README.rst +4 -22
  3. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0}/pyproject.toml +26 -9
  4. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/LICENSE +0 -52
  5. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/__init__.py +1 -1
  6. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py +2 -3
  7. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/callbacks.py +90 -8
  8. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/cli/kubernetes_command.py +3 -4
  9. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/decorators/kubernetes.py +10 -5
  10. apache_airflow_providers_cncf_kubernetes-10.3.0/src/airflow/providers/cncf/kubernetes/exceptions.py +29 -0
  11. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py +36 -113
  12. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py +27 -15
  13. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/get_provider_info.py +14 -21
  14. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/hooks/kubernetes.py +20 -10
  15. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/kube_config.py +0 -4
  16. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/operators/custom_object_launcher.py +3 -3
  17. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/operators/job.py +4 -4
  18. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/operators/kueue.py +2 -2
  19. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/operators/pod.py +102 -44
  20. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py +23 -19
  21. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/pod_generator.py +51 -21
  22. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/resource_convert/env_variable.py +1 -2
  23. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/secret.py +1 -2
  24. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/sensors/spark_kubernetes.py +1 -2
  25. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/template_rendering.py +10 -2
  26. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/utils/k8s_resource_iterator.py +1 -2
  27. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/utils/pod_manager.py +12 -11
  28. apache_airflow_providers_cncf_kubernetes-10.1.0rc2/airflow/providers/cncf/kubernetes/pod_generator_deprecated.py +0 -309
  29. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/backcompat/__init__.py +0 -0
  30. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/cli/__init__.py +0 -0
  31. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/decorators/__init__.py +0 -0
  32. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/executors/__init__.py +0 -0
  33. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_types.py +0 -0
  34. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/executors/local_kubernetes_executor.py +0 -0
  35. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/hooks/__init__.py +0 -0
  36. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/k8s_model.py +0 -0
  37. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/kube_client.py +0 -0
  38. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/kubernetes_executor_templates/__init__.py +0 -0
  39. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/kubernetes_executor_templates/basic_template.yaml +0 -0
  40. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/kubernetes_helper_functions.py +1 -1
  41. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/operators/__init__.py +0 -0
  42. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/operators/resource.py +1 -1
  43. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/pod_template_file_examples/__init__.py +0 -0
  44. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/pod_template_file_examples/dags_in_image_template.yaml +0 -0
  45. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/pod_template_file_examples/dags_in_volume_template.yaml +0 -0
  46. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/pod_template_file_examples/git_sync_template.yaml +0 -0
  47. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/python_kubernetes_script.jinja2 +0 -0
  48. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/python_kubernetes_script.py +0 -0
  49. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/resource_convert/__init__.py +0 -0
  50. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/resource_convert/configmap.py +0 -0
  51. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/resource_convert/secret.py +0 -0
  52. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/sensors/__init__.py +0 -0
  53. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/triggers/__init__.py +0 -0
  54. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/triggers/job.py +0 -0
  55. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/triggers/pod.py +0 -0
  56. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/utils/__init__.py +0 -0
  57. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/utils/delete_from.py +0 -0
  58. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py +0 -0
  59. {apache_airflow_providers_cncf_kubernetes-10.1.0rc2 → apache_airflow_providers_cncf_kubernetes-10.3.0/src}/airflow/providers/cncf/kubernetes/version_compat.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: apache-airflow-providers-cncf-kubernetes
3
- Version: 10.1.0rc2
3
+ Version: 10.3.0
4
4
  Summary: Provider package apache-airflow-providers-cncf-kubernetes for Apache Airflow
5
5
  Keywords: airflow-provider,cncf.kubernetes,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
@@ -21,38 +21,21 @@ Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Topic :: System :: Monitoring
23
23
  Requires-Dist: aiofiles>=23.2.0
24
- Requires-Dist: apache-airflow>=2.9.0rc0
24
+ Requires-Dist: apache-airflow>=2.9.0
25
25
  Requires-Dist: asgiref>=3.5.2
26
26
  Requires-Dist: cryptography>=41.0.0
27
- Requires-Dist: google-re2>=1.0
28
27
  Requires-Dist: kubernetes>=29.0.0,<=31.0.0
29
28
  Requires-Dist: kubernetes_asyncio>=29.0.0,<=31.0.0
29
+ Requires-Dist: google-re2>=1.0
30
30
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
31
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.1.0/changelog.html
32
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.1.0
31
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.3.0/changelog.html
32
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.3.0
33
33
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
34
34
  Project-URL: Source Code, https://github.com/apache/airflow
35
35
  Project-URL: Twitter, https://x.com/ApacheAirflow
36
36
  Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
37
37
 
38
38
 
39
- .. Licensed to the Apache Software Foundation (ASF) under one
40
- or more contributor license agreements. See the NOTICE file
41
- distributed with this work for additional information
42
- regarding copyright ownership. The ASF licenses this file
43
- to you under the Apache License, Version 2.0 (the
44
- "License"); you may not use this file except in compliance
45
- with the License. You may obtain a copy of the License at
46
-
47
- .. http://www.apache.org/licenses/LICENSE-2.0
48
-
49
- .. Unless required by applicable law or agreed to in writing,
50
- software distributed under the License is distributed on an
51
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
52
- KIND, either express or implied. See the License for the
53
- specific language governing permissions and limitations
54
- under the License.
55
-
56
39
  .. Licensed to the Apache Software Foundation (ASF) under one
57
40
  or more contributor license agreements. See the NOTICE file
58
41
  distributed with this work for additional information
@@ -70,8 +53,7 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
70
53
  specific language governing permissions and limitations
71
54
  under the License.
72
55
 
73
- .. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
74
- OVERWRITTEN WHEN PREPARING PACKAGES.
56
+ .. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!
75
57
 
76
58
  .. IF YOU WANT TO MODIFY TEMPLATE FOR THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
77
59
  `PROVIDER_README_TEMPLATE.rst.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
@@ -79,7 +61,7 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
79
61
 
80
62
  Package ``apache-airflow-providers-cncf-kubernetes``
81
63
 
82
- Release: ``10.1.0.rc2``
64
+ Release: ``10.3.0``
83
65
 
84
66
 
85
67
  `Kubernetes <https://kubernetes.io/>`__
@@ -92,7 +74,7 @@ This is a provider package for ``cncf.kubernetes`` provider. All classes for thi
92
74
  are in ``airflow.providers.cncf.kubernetes`` python package.
93
75
 
94
76
  You can find package information and changelog for the provider
95
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.1.0/>`_.
77
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.3.0/>`_.
96
78
 
97
79
  Installation
98
80
  ------------
@@ -119,4 +101,5 @@ PIP package Version required
119
101
  ====================== =====================
120
102
 
121
103
  The changelog for the provider package can be found in the
122
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.1.0/changelog.html>`_.
104
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.3.0/changelog.html>`_.
105
+
@@ -1,21 +1,4 @@
1
1
 
2
- .. Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements. See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership. The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License. You may obtain a copy of the License at
9
-
10
- .. http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- .. Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied. See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
-
19
2
  .. Licensed to the Apache Software Foundation (ASF) under one
20
3
  or more contributor license agreements. See the NOTICE file
21
4
  distributed with this work for additional information
@@ -33,8 +16,7 @@
33
16
  specific language governing permissions and limitations
34
17
  under the License.
35
18
 
36
- .. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
37
- OVERWRITTEN WHEN PREPARING PACKAGES.
19
+ .. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!
38
20
 
39
21
  .. IF YOU WANT TO MODIFY TEMPLATE FOR THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
40
22
  `PROVIDER_README_TEMPLATE.rst.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
@@ -42,7 +24,7 @@
42
24
 
43
25
  Package ``apache-airflow-providers-cncf-kubernetes``
44
26
 
45
- Release: ``10.1.0.rc2``
27
+ Release: ``10.3.0``
46
28
 
47
29
 
48
30
  `Kubernetes <https://kubernetes.io/>`__
@@ -55,7 +37,7 @@ This is a provider package for ``cncf.kubernetes`` provider. All classes for thi
55
37
  are in ``airflow.providers.cncf.kubernetes`` python package.
56
38
 
57
39
  You can find package information and changelog for the provider
58
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.1.0/>`_.
40
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.3.0/>`_.
59
41
 
60
42
  Installation
61
43
  ------------
@@ -82,4 +64,4 @@ PIP package Version required
82
64
  ====================== =====================
83
65
 
84
66
  The changelog for the provider package can be found in the
85
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.1.0/changelog.html>`_.
67
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.3.0/changelog.html>`_.
@@ -1,4 +1,3 @@
1
-
2
1
  # Licensed to the Apache Software Foundation (ASF) under one
3
2
  # or more contributor license agreements. See the NOTICE file
4
3
  # distributed with this work for additional information
@@ -16,10 +15,9 @@
16
15
  # specific language governing permissions and limitations
17
16
  # under the License.
18
17
 
19
- # NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
20
- # OVERWRITTEN WHEN PREPARING PACKAGES.
18
+ # NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!
21
19
 
22
- # IF YOU WANT TO MODIFY THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
20
+ # IF YOU WANT TO MODIFY THIS FILE EXCEPT DEPENDENCIES, YOU SHOULD MODIFY THE TEMPLATE
23
21
  # `pyproject_TEMPLATE.toml.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
24
22
  [build-system]
25
23
  requires = ["flit_core==3.10.1"]
@@ -27,7 +25,7 @@ build-backend = "flit_core.buildapi"
27
25
 
28
26
  [project]
29
27
  name = "apache-airflow-providers-cncf-kubernetes"
30
- version = "10.1.0.rc2"
28
+ version = "10.3.0"
31
29
  description = "Provider package apache-airflow-providers-cncf-kubernetes for Apache Airflow"
32
30
  readme = "README.rst"
33
31
  authors = [
@@ -53,19 +51,35 @@ classifiers = [
53
51
  "Topic :: System :: Monitoring",
54
52
  ]
55
53
  requires-python = "~=3.9"
54
+
55
+ # The dependencies should be modified in place in the generated file
56
+ # Any change in the dependencies is preserved when the file is regenerated
56
57
  dependencies = [
57
58
  "aiofiles>=23.2.0",
58
- "apache-airflow>=2.9.0rc0",
59
+ "apache-airflow>=2.9.0",
59
60
  "asgiref>=3.5.2",
60
61
  "cryptography>=41.0.0",
61
- "google-re2>=1.0",
62
+ # The Kubernetes API is known to introduce problems when upgraded to a MAJOR version. Airflow Core
63
+ # Uses Kubernetes for Kubernetes executor, and we also know that Kubernetes Python client follows SemVer
64
+ # (https://github.com/kubernetes-client/python#compatibility). This is a crucial component of Airflow
65
+ # So we should limit it to the next MAJOR version and only deliberately bump the version when we
66
+ # tested it, and we know it can be bumped. Bumping this version should also be connected with
67
+ # limiting minimum airflow version supported in cncf.kubernetes provider, due to the
68
+ # potential breaking changes in Airflow Core as well (kubernetes is added as extra, so Airflow
69
+ # core is not hard-limited via install-requirements, only by extra).
62
70
  "kubernetes>=29.0.0,<=31.0.0",
71
+ # The Kubernetes_asyncio package is used for providing Asynchronous (AsyncIO) client library for
72
+ # standard Kubernetes API. The version is limited by minimum 18.20.1 because of introducing the ability to
73
+ # load kubernetes config file from dictionary in that release and is limited to the next MAJOR version
74
+ # (started from current 24.2.2 version) to prevent introducing some problems that could be due to some
75
+ # major changes in the package.
63
76
  "kubernetes_asyncio>=29.0.0,<=31.0.0",
77
+ "google-re2>=1.0",
64
78
  ]
65
79
 
66
80
  [project.urls]
67
- "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.1.0"
68
- "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.1.0/changelog.html"
81
+ "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.3.0"
82
+ "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/10.3.0/changelog.html"
69
83
  "Bug Tracker" = "https://github.com/apache/airflow/issues"
70
84
  "Source Code" = "https://github.com/apache/airflow"
71
85
  "Slack Chat" = "https://s.apache.org/airflow-slack"
@@ -77,3 +91,6 @@ provider_info = "airflow.providers.cncf.kubernetes.get_provider_info:get_provide
77
91
 
78
92
  [tool.flit.module]
79
93
  name = "airflow.providers.cncf.kubernetes"
94
+
95
+ [tool.pytest.ini_options]
96
+ ignore = "tests/system/"
@@ -199,55 +199,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
199
199
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
200
  See the License for the specific language governing permissions and
201
201
  limitations under the License.
202
-
203
- ============================================================================
204
- APACHE AIRFLOW SUBCOMPONENTS:
205
-
206
- The Apache Airflow project contains subcomponents with separate copyright
207
- notices and license terms. Your use of the source code for the these
208
- subcomponents is subject to the terms and conditions of the following
209
- licenses.
210
-
211
-
212
- ========================================================================
213
- Third party Apache 2.0 licenses
214
- ========================================================================
215
-
216
- The following components are provided under the Apache 2.0 License.
217
- See project link for details. The text of each license is also included
218
- at 3rd-party-licenses/LICENSE-[project].txt.
219
-
220
- (ALv2 License) hue v4.3.0 (https://github.com/cloudera/hue/)
221
- (ALv2 License) jqclock v2.3.0 (https://github.com/JohnRDOrazio/jQuery-Clock-Plugin)
222
- (ALv2 License) bootstrap3-typeahead v4.0.2 (https://github.com/bassjobsen/Bootstrap-3-Typeahead)
223
- (ALv2 License) connexion v2.7.0 (https://github.com/zalando/connexion)
224
-
225
- ========================================================================
226
- MIT licenses
227
- ========================================================================
228
-
229
- The following components are provided under the MIT License. See project link for details.
230
- The text of each license is also included at 3rd-party-licenses/LICENSE-[project].txt.
231
-
232
- (MIT License) jquery v3.5.1 (https://jquery.org/license/)
233
- (MIT License) dagre-d3 v0.6.4 (https://github.com/cpettitt/dagre-d3)
234
- (MIT License) bootstrap v3.4.1 (https://github.com/twbs/bootstrap/)
235
- (MIT License) d3-tip v0.9.1 (https://github.com/Caged/d3-tip)
236
- (MIT License) dataTables v1.10.25 (https://datatables.net)
237
- (MIT License) normalize.css v3.0.2 (http://necolas.github.io/normalize.css/)
238
- (MIT License) ElasticMock v1.3.2 (https://github.com/vrcmarcos/elasticmock)
239
- (MIT License) MomentJS v2.24.0 (http://momentjs.com/)
240
- (MIT License) eonasdan-bootstrap-datetimepicker v4.17.49 (https://github.com/eonasdan/bootstrap-datetimepicker/)
241
-
242
- ========================================================================
243
- BSD 3-Clause licenses
244
- ========================================================================
245
- The following components are provided under the BSD 3-Clause license. See project links for details.
246
- The text of each license is also included at 3rd-party-licenses/LICENSE-[project].txt.
247
-
248
- (BSD 3 License) d3 v5.16.0 (https://d3js.org)
249
- (BSD 3 License) d3-shape v2.1.0 (https://github.com/d3/d3-shape)
250
- (BSD 3 License) cgroupspy 0.2.1 (https://github.com/cloudsigma/cgroupspy)
251
-
252
- ========================================================================
253
- See 3rd-party-licenses/LICENSES-ui.txt for packages used in `/airflow/www`
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "10.1.0"
32
+ __version__ = "10.3.0"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.9.0"
@@ -18,9 +18,8 @@
18
18
 
19
19
  from __future__ import annotations
20
20
 
21
- from kubernetes.client import ApiClient, models as k8s
22
-
23
21
  from airflow.exceptions import AirflowException
22
+ from kubernetes.client import ApiClient, models as k8s
24
23
 
25
24
 
26
25
  def _convert_kube_model_object(obj, new_class):
@@ -74,7 +73,7 @@ def convert_env_vars(env_vars: list[k8s.V1EnvVar] | dict[str, str]) -> list[k8s.
74
73
  """
75
74
  Coerce env var collection for kubernetes.
76
75
 
77
- If the collection is a str-str dict, convert it into a list of ``V1EnvVar``s.
76
+ If the collection is a str-str dict, convert it into a list of ``V1EnvVar`` variables.
78
77
  """
79
78
  if isinstance(env_vars, dict):
80
79
  return [k8s.V1EnvVar(name=k, value=v) for k, v in env_vars.items()]
@@ -17,11 +17,16 @@
17
17
  from __future__ import annotations
18
18
 
19
19
  from enum import Enum
20
- from typing import Union
20
+ from typing import TYPE_CHECKING, Union
21
21
 
22
- import kubernetes.client as k8s
23
22
  import kubernetes_asyncio.client as async_k8s
24
23
 
24
+ import kubernetes.client as k8s
25
+
26
+ if TYPE_CHECKING:
27
+ from airflow.providers.cncf.kubernetes.operators.pod import KubernetesPodOperator
28
+ from airflow.utils.context import Context
29
+
25
30
  client_type = Union[k8s.CoreV1Api, async_k8s.CoreV1Api]
26
31
 
27
32
 
@@ -41,7 +46,7 @@ class KubernetesPodOperatorCallback:
41
46
  """
42
47
 
43
48
  @staticmethod
44
- def on_sync_client_creation(*, client: k8s.CoreV1Api, **kwargs) -> None:
49
+ def on_sync_client_creation(*, client: k8s.CoreV1Api, operator: KubernetesPodOperator, **kwargs) -> None:
45
50
  """
46
51
  Invoke this callback after creating the sync client.
47
52
 
@@ -50,7 +55,34 @@ class KubernetesPodOperatorCallback:
50
55
  pass
51
56
 
52
57
  @staticmethod
53
- def on_pod_creation(*, pod: k8s.V1Pod, client: client_type, mode: str, **kwargs) -> None:
58
+ def on_pod_manifest_created(
59
+ *,
60
+ pod_request: k8s.V1Pod,
61
+ client: client_type,
62
+ mode: str,
63
+ operator: KubernetesPodOperator,
64
+ context: Context,
65
+ **kwargs,
66
+ ) -> None:
67
+ """
68
+ Invoke this callback after KPO creates the V1Pod manifest but before the pod is created.
69
+
70
+ :param pod_request: the kubernetes pod manifest
71
+ :param client: the Kubernetes client that can be used in the callback.
72
+ :param mode: the current execution mode, it's one of (`sync`, `async`).
73
+ """
74
+ pass
75
+
76
+ @staticmethod
77
+ def on_pod_creation(
78
+ *,
79
+ pod: k8s.V1Pod,
80
+ client: client_type,
81
+ mode: str,
82
+ operator: KubernetesPodOperator,
83
+ context: Context,
84
+ **kwargs,
85
+ ) -> None:
54
86
  """
55
87
  Invoke this callback after creating the pod.
56
88
 
@@ -61,7 +93,15 @@ class KubernetesPodOperatorCallback:
61
93
  pass
62
94
 
63
95
  @staticmethod
64
- def on_pod_starting(*, pod: k8s.V1Pod, client: client_type, mode: str, **kwargs) -> None:
96
+ def on_pod_starting(
97
+ *,
98
+ pod: k8s.V1Pod,
99
+ client: client_type,
100
+ mode: str,
101
+ operator: KubernetesPodOperator,
102
+ context: Context,
103
+ **kwargs,
104
+ ) -> None:
65
105
  """
66
106
  Invoke this callback when the pod starts.
67
107
 
@@ -72,7 +112,15 @@ class KubernetesPodOperatorCallback:
72
112
  pass
73
113
 
74
114
  @staticmethod
75
- def on_pod_completion(*, pod: k8s.V1Pod, client: client_type, mode: str, **kwargs) -> None:
115
+ def on_pod_completion(
116
+ *,
117
+ pod: k8s.V1Pod,
118
+ client: client_type,
119
+ mode: str,
120
+ operator: KubernetesPodOperator,
121
+ context: Context,
122
+ **kwargs,
123
+ ) -> None:
76
124
  """
77
125
  Invoke this callback when the pod completes.
78
126
 
@@ -83,7 +131,34 @@ class KubernetesPodOperatorCallback:
83
131
  pass
84
132
 
85
133
  @staticmethod
86
- def on_pod_cleanup(*, pod: k8s.V1Pod, client: client_type, mode: str, **kwargs):
134
+ def on_pod_teardown(
135
+ *,
136
+ pod: k8s.V1Pod,
137
+ client: client_type,
138
+ mode: str,
139
+ operator: KubernetesPodOperator,
140
+ context: Context,
141
+ **kwargs,
142
+ ) -> None:
143
+ """
144
+ Invoke this callback after all pod completion callbacks but before the pod is deleted.
145
+
146
+ :param pod: the completed pod.
147
+ :param client: the Kubernetes client that can be used in the callback.
148
+ :param mode: the current execution mode, it's one of (`sync`, `async`).
149
+ """
150
+ pass
151
+
152
+ @staticmethod
153
+ def on_pod_cleanup(
154
+ *,
155
+ pod: k8s.V1Pod,
156
+ client: client_type,
157
+ mode: str,
158
+ operator: KubernetesPodOperator,
159
+ context: Context,
160
+ **kwargs,
161
+ ):
87
162
  """
88
163
  Invoke this callback after cleaning/deleting the pod.
89
164
 
@@ -95,7 +170,14 @@ class KubernetesPodOperatorCallback:
95
170
 
96
171
  @staticmethod
97
172
  def on_operator_resuming(
98
- *, pod: k8s.V1Pod, event: dict, client: client_type, mode: str, **kwargs
173
+ *,
174
+ pod: k8s.V1Pod,
175
+ event: dict,
176
+ client: client_type,
177
+ mode: str,
178
+ operator: KubernetesPodOperator,
179
+ context: Context,
180
+ **kwargs,
99
181
  ) -> None:
100
182
  """
101
183
  Invoke this callback when resuming the `KubernetesPodOperator` from deferred state.
@@ -22,10 +22,6 @@ import os
22
22
  import sys
23
23
  from datetime import datetime, timedelta
24
24
 
25
- from kubernetes import client
26
- from kubernetes.client.api_client import ApiClient
27
- from kubernetes.client.rest import ApiException
28
-
29
25
  from airflow.models import DagRun, TaskInstance
30
26
  from airflow.providers.cncf.kubernetes import pod_generator
31
27
  from airflow.providers.cncf.kubernetes.executors.kubernetes_executor import KubeConfig
@@ -36,6 +32,9 @@ from airflow.providers.cncf.kubernetes.version_compat import AIRFLOW_V_3_0_PLUS
36
32
  from airflow.utils import cli as cli_utils, yaml
37
33
  from airflow.utils.cli import get_dag
38
34
  from airflow.utils.providers_configuration_loader import providers_configuration_loaded
35
+ from kubernetes import client
36
+ from kubernetes.client.api_client import ApiClient
37
+ from kubernetes.client.rest import ApiException
39
38
 
40
39
 
41
40
  @cli_utils.action_cli
@@ -19,20 +19,19 @@ from __future__ import annotations
19
19
  import base64
20
20
  import os
21
21
  import pickle
22
- import uuid
23
22
  from collections.abc import Sequence
24
23
  from shlex import quote
25
24
  from tempfile import TemporaryDirectory
26
25
  from typing import TYPE_CHECKING, Callable
27
26
 
28
27
  import dill
29
- from kubernetes.client import models as k8s
30
28
 
31
29
  from airflow.decorators.base import DecoratedOperator, TaskDecorator, task_decorator_factory
32
30
  from airflow.providers.cncf.kubernetes.operators.pod import KubernetesPodOperator
33
31
  from airflow.providers.cncf.kubernetes.python_kubernetes_script import (
34
32
  write_python_script,
35
33
  )
34
+ from kubernetes.client import models as k8s
36
35
 
37
36
  if TYPE_CHECKING:
38
37
  from airflow.utils.context import Context
@@ -68,9 +67,15 @@ class _KubernetesDecoratedOperator(DecoratedOperator, KubernetesPodOperator):
68
67
 
69
68
  def __init__(self, namespace: str | None = None, use_dill: bool = False, **kwargs) -> None:
70
69
  self.use_dill = use_dill
70
+
71
+ # If the name was not provided, we generate operator name from the python_callable
72
+ # we also instruct operator to add a random suffix to avoid collisions by default
73
+ op_name = kwargs.pop("name", f"k8s-airflow-pod-{kwargs['python_callable'].__name__}")
74
+ random_name_suffix = kwargs.pop("random_name_suffix", True)
71
75
  super().__init__(
72
76
  namespace=namespace,
73
- name=kwargs.pop("name", f"k8s_airflow_pod_{uuid.uuid4().hex}"),
77
+ name=op_name,
78
+ random_name_suffix=random_name_suffix,
74
79
  cmds=["placeholder-command"],
75
80
  **kwargs,
76
81
  )
@@ -119,7 +124,7 @@ class _KubernetesDecoratedOperator(DecoratedOperator, KubernetesPodOperator):
119
124
  }
120
125
  write_python_script(jinja_context=jinja_context, filename=script_filename)
121
126
 
122
- self.env_vars = [
127
+ self.env_vars: list[k8s.V1EnvVar] = [
123
128
  *self.env_vars,
124
129
  k8s.V1EnvVar(name=_PYTHON_SCRIPT_ENV, value=_read_file_contents(script_filename)),
125
130
  k8s.V1EnvVar(name=_PYTHON_INPUT_ENV, value=_read_file_contents(input_filename)),
@@ -138,7 +143,7 @@ def kubernetes_task(
138
143
  Kubernetes operator decorator.
139
144
 
140
145
  This wraps a function to be executed in K8s using KubernetesPodOperator.
141
- Also accepts any argument that DockerOperator will via ``kwargs``. Can be
146
+ Also accepts any argument that KubernetesPodOperator will via ``kwargs``. Can be
142
147
  reused in a single DAG.
143
148
 
144
149
  :param python_callable: Function to decorate
@@ -0,0 +1,29 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The ASF licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ from __future__ import annotations
18
+
19
+ from airflow.exceptions import (
20
+ AirflowException,
21
+ )
22
+
23
+
24
+ class PodMutationHookException(AirflowException):
25
+ """Raised when exception happens during Pod Mutation Hook execution."""
26
+
27
+
28
+ class PodReconciliationError(AirflowException):
29
+ """Raised when an error is encountered while trying to merge pod configs."""