diff --git a/airflow/config_templates/config.yml b/airflow/config_templates/config.yml index 2759eef2ff347..962de33d9dcc2 100644 --- a/airflow/config_templates/config.yml +++ b/airflow/config_templates/config.yml @@ -2368,6 +2368,9 @@ default: "True" - name: kubernetes_executor description: ~ + renamed: + previous_name: kubernetes + version: 2.5.0 options: - name: pod_template_file description: | diff --git a/dev/validate_version_added_fields_in_config.py b/dev/validate_version_added_fields_in_config.py index a43e1491750e5..e7920620d6f77 100755 --- a/dev/validate_version_added_fields_in_config.py +++ b/dev/validate_version_added_fields_in_config.py @@ -34,6 +34,9 @@ ("logging", "extra_logger_names", "2.2.0") } +# Renamed sections: (new_section, old_section, version_before_renaming) +RENAMED_SECTIONS = [("kubernetes_executor", "kubernetes", "2.4.3")] + def fetch_pypi_versions() -> list[str]: r = requests.get("https://pypi.org/pypi/apache-airflow/json") @@ -71,6 +74,14 @@ def read_local_config_options() -> set[tuple[str, str, str]]: return config_options +computed_option_new_section = set() +for new_section, old_section, version_before_renaming in RENAMED_SECTIONS: + options = fetch_config_options_for_version(version_before_renaming) + options = { + (new_section, option_name) for section_name, option_name in options if section_name == old_section + } + computed_option_new_section.update(options) + # 1. Prepare versions to checks airflow_version = fetch_pypi_versions() airflow_version = sorted(airflow_version, key=semver.VersionInfo.parse) @@ -83,6 +94,9 @@ def read_local_config_options() -> set[tuple[str, str, str]]: options_1 = fetch_config_options_for_version(prev_version) options_2 = fetch_config_options_for_version(curr_version) new_options = options_2 - options_1 + # Remove existing options in new section + new_options -= computed_option_new_section + # Update expected options with version added field expected_computed_options.update( {(section_name, option_name, curr_version) for section_name, option_name in new_options} ) diff --git a/docs/apache-airflow/configurations-ref.rst b/docs/apache-airflow/configurations-ref.rst index c77a33cd22eee..ab0ccd5f64a12 100644 --- a/docs/apache-airflow/configurations-ref.rst +++ b/docs/apache-airflow/configurations-ref.rst @@ -48,6 +48,10 @@ that you run airflow components on is synchronized (for example using ntpd) othe [{{ section["name"] }}] {{ "=" * (section["name"]|length + 2) }} + {% if 'renamed' in section %} + *Renamed in version {{ section['renamed']['version'] }}, previous name was {{ section['renamed']['previous_name'] }}* + {% endif %} + {% if section["description"] %} {{ section["description"] }} {% endif %}