Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assignment of template field in __init__ in KubernetesPodOperator #37010

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ repos:
^airflow\/providers\/amazon\/aws\/transfers\/redshift_to_s3\.py$|
^airflow\/providers\/google\/cloud\/operators\/compute\.py$|
^airflow\/providers\/google\/cloud\/operators\/vertex_ai\/custom_job\.py$|
^airflow\/providers\/cncf\/kubernetes\/operators\/pod\.py$|
^airflow\/providers\/amazon\/aws\/operators\/emr\.py$|
^airflow\/providers\/amazon\/aws\/operators\/eks\.py$
)$
Expand Down
9 changes: 6 additions & 3 deletions airflow/providers/cncf/kubernetes/operators/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,19 @@ def __init__(
self.labels = labels or {}
self.startup_timeout_seconds = startup_timeout_seconds
self.startup_check_interval_seconds = startup_check_interval_seconds
self.env_vars = convert_env_vars(env_vars) if env_vars else []
env_vars = convert_env_vars(env_vars) if env_vars else []
potiuk marked this conversation as resolved.
Show resolved Hide resolved
self.env_vars = env_vars
if pod_runtime_info_envs:
self.env_vars.extend([convert_pod_runtime_info_env(p) for p in pod_runtime_info_envs])
self.env_from = env_from or []
self.configmaps = configmaps
if self.configmaps:
self.env_from.extend([convert_configmap(c) for c in self.configmaps])
self.ports = [convert_port(p) for p in ports] if ports else []
self.volume_mounts = [convert_volume_mount(v) for v in volume_mounts] if volume_mounts else []
self.volumes = [convert_volume(volume) for volume in volumes] if volumes else []
volume_mounts = [convert_volume_mount(v) for v in volume_mounts] if volume_mounts else []
self.volume_mounts = volume_mounts
volumes = [convert_volume(volume) for volume in volumes] if volumes else []
self.volumes = volumes
self.secrets = secrets or []
self.in_cluster = in_cluster
self.cluster_context = cluster_context
Expand Down
Loading