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

Moves airflow import in deprecated pod_generator to local #39062

Merged
merged 1 commit into from
Apr 16, 2024
Merged
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
4 changes: 2 additions & 2 deletions airflow/providers/cncf/kubernetes/pod_generator_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import re2
from kubernetes.client import models as k8s

from airflow.utils.hashlib_wrapper import md5

MAX_POD_ID_LEN = 253

MAX_LABEL_LEN = 63
Expand Down Expand Up @@ -71,6 +69,8 @@ def make_safe_label_value(string):
way from the original value sent to this function, then we need to truncate to
53 chars, and append it with a unique hash.
"""
from airflow.utils.hashlib_wrapper import md5

safe_label = re2.sub(r"^[^a-z0-9A-Z]*|[^a-zA-Z0-9_\-\.]|[^a-z0-9A-Z]*$", "", string)

if len(safe_label) > MAX_LABEL_LEN or string != safe_label:
Expand Down