This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new bb75d2a0803 Fix hardcoded OS path in K8s provider (#67040)
bb75d2a0803 is described below

commit bb75d2a080389417d88c7e2013887321c6cdbaa8
Author: Jens Scheffler <[email protected]>
AuthorDate: Sat May 16 19:42:45 2026 +0200

    Fix hardcoded OS path in K8s provider (#67040)
---
 .../providers/cncf/kubernetes/cli/kubernetes_command.py        | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/cli/kubernetes_command.py
 
b/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/cli/kubernetes_command.py
index bc3389c0990..ea59ae7755b 100644
--- 
a/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/cli/kubernetes_command.py
+++ 
b/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/cli/kubernetes_command.py
@@ -18,9 +18,9 @@
 
 from __future__ import annotations
 
-import os
 import sys
 from datetime import datetime, timedelta
+from pathlib import Path
 
 from kubernetes import client
 from kubernetes.client.api_client import ApiClient
@@ -61,7 +61,7 @@ def generate_pod_yaml(args):
         dag = get_bagged_dag(bundle_names=args.bundle_name, dag_id=args.dag_id)
     else:
         dag = get_bagged_dag(subdir=args.subdir, dag_id=args.dag_id)
-    yaml_output_path = args.output_path
+    yaml_output_path = Path(args.output_path) / "airflow_yaml_output"
 
     dm = DagModel(dag_id=dag.dag_id)
 
@@ -112,11 +112,11 @@ def generate_pod_yaml(args):
         api_client = ApiClient()
         date_string = 
pod_generator.datetime_to_label_safe_datestring(logical_date)
         yaml_file_name = f"{args.dag_id}_{ti.task_id}_{date_string}.yml"
-        os.makedirs(os.path.dirname(yaml_output_path + 
"/airflow_yaml_output/"), exist_ok=True)
-        with open(yaml_output_path + "/airflow_yaml_output/" + yaml_file_name, 
"w") as output:
+        yaml_output_path.mkdir(parents=True, exist_ok=True)
+        with open(yaml_output_path / yaml_file_name, "w") as output:
             sanitized_pod = api_client.sanitize_for_serialization(pod)
             output.write(yaml.dump(sanitized_pod))
-    print(f"YAML output can be found at 
{yaml_output_path}/airflow_yaml_output/")
+    print(f"YAML output can be found at {yaml_output_path}")
 
 
 @cli_utils.action_cli(check_db=False)

Reply via email to