Skip to content
Open
Show file tree
Hide file tree
Changes from 8 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**kubeconfig**
**pycache**
*.egg-info/
*.swp
*.tgz
.DS_Store
Expand All @@ -10,9 +11,11 @@
/secrets
/test-results
backup
build/
certs
charts
dev-account.json
dist/
Comment thread
stefan-raducan marked this conversation as resolved.
Outdated
kubeconfig
letsencrypt*
repo_state.log
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14.2
9 changes: 9 additions & 0 deletions bin/install-ci-tools
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -e

KIND_VERSION="0.31.0" # https://github.com/kubernetes-sigs/kind/releases
HELM_VERSION="3.20.0" # https://github.com/helm/helm/releases
UV_VERSION="0.10.7" # https://github.com/astral-sh/uv/releases

# Determine the platform we are running on
OS=$(uname | tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -46,4 +47,12 @@ else
chmod +x ./kubectl
fi

echo "Installing uv version ${UV_VERSION}..."
if [[ -f /tmp/bin/uv ]]; then
echo "Already installed in /tmp/bin. Skipping!"
else
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-installer.sh | sh
mv "$HOME/.local/bin/uv" /tmp/bin/
fi

Comment on lines +50 to +57

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? Was there a problem in CI without this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this change is strictly related to failing tests (which were failing before this PR, e.g. this run. 'uvis used in allairflow-test` jobs in CircleCI here:

bin/run-ci: line 140: uv: command not found

cd "$CURRENT_DIR"
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# https://www.python.org/dev/peps/pep-0518/#file-format
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? We do not build a python package in this repo.

@danielhoherd danielhoherd Mar 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW the way we use uv with this repo is just to manage the venv, which means build related properties are not needed. EG:

$ uv init
Initialized project `py-example`
$ uv add pytest
Using CPython 3.14.3
Creating virtual environment at: .venv
Resolved 7 packages in 122ms
Installed 5 packages in 17ms
 + iniconfig==2.3.0
 + packaging==26.0
 + pluggy==1.6.0
 + pygments==2.19.2
 + pytest==9.0.2
$ cat pyproject.toml
[project]
name = "py-example"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
    "pytest>=9.0.2",
]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, I didn't use uv locally which caused some issues. with uv everything works as is. I've reverted changes and updated README.md

[project]
name = "airflow-chart-dev-env"
description = "astronomer airflow-chart development environment"
Expand Down Expand Up @@ -26,6 +30,9 @@ dependencies = [
"yamllint>=1.37.1",
]

[tool.setuptools]
packages = []

Comment thread
stefan-raducan marked this conversation as resolved.
Outdated
# https://docs.astral.sh/ruff/settings/
[tool.ruff]
line-length = 132
Expand Down
9 changes: 9 additions & 0 deletions templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ metadata:
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
tls:
- secretName: {{ .Values.ingress.tlsSecretName | default "~" }}
hosts:
Expand Down Expand Up @@ -117,6 +120,9 @@ metadata:
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
tls:
- secretName: {{ .Values.ingress.tlsSecretName | default "~" }}
hosts:
Expand Down Expand Up @@ -189,6 +195,9 @@ metadata:
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
tls:
- secretName: {{ .Values.ingress.tlsSecretName | default "~" }}
hosts:
Expand Down
77 changes: 77 additions & 0 deletions tests/chart/test_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,80 @@ def test_airflow_ingress_with_dag_server_ingress_annotation_and_tls_secret(self,

assert ingressAnnotations == docs[1]["metadata"]["annotations"]
assert docs[1]["spec"]["tls"][0]["secretName"] == tls_secret_name

def test_airflow_ingress_class_name(self, kube_version):
"""Test airflow ingress with ingressClassName."""
docs = render_chart(
kube_version=kube_version,
show_only="templates/ingress.yaml",
values={
"ingress": {
"enabled": True,
"baseDomain": "example.com",
"ingressClassName": "nginx",
}
},
)
assert len(docs) == 1
doc = docs[0]
assert "Ingress" == doc["kind"]
assert "nginx" == doc["spec"]["ingressClassName"]

def test_airflow_ingress_class_name_with_celery_executor(self, kube_version):
"""Test airflow and flower ingress with ingressClassName and CeleryExecutor."""
docs = render_chart(
kube_version=kube_version,
show_only="templates/ingress.yaml",
values={
"airflow": {"executor": "CeleryExecutor"},
"ingress": {
"enabled": True,
"baseDomain": "example.com",
"ingressClassName": "nginx-internal",
},
},
)
assert len(docs) == 2

# Airflow ingress
assert "Ingress" == docs[0]["kind"]
assert "nginx-internal" == docs[0]["spec"]["ingressClassName"]

# Flower ingress
assert "Ingress" == docs[1]["kind"]
assert "nginx-internal" == docs[1]["spec"]["ingressClassName"]

def test_airflow_ingress_class_name_with_dag_server(self, kube_version):
"""Test dag server ingress with ingressClassName."""
docs = render_chart(
kube_version=kube_version,
show_only="templates/ingress.yaml",
values={
"ingress": {
"baseDomain": "example.com",
"ingressClassName": "custom-ingress",
},
"dagDeploy": {"enabled": True},
},
)

assert len(docs) == 1
assert docs[0]["metadata"]["name"] == "release-name-dag-server-ingress"
assert "custom-ingress" == docs[0]["spec"]["ingressClassName"]

def test_airflow_ingress_class_name_not_set(self, kube_version):
"""Test airflow ingress without ingressClassName (default behavior)."""
docs = render_chart(
kube_version=kube_version,
show_only="templates/ingress.yaml",
values={
"ingress": {
"enabled": True,
"baseDomain": "example.com",
}
},
)
assert len(docs) == 1
doc = docs[0]
assert "Ingress" == doc["kind"]
assert "ingressClassName" not in doc["spec"]
3 changes: 3 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ ingress:
# Enable ingress resource
enabled: false

# Enables using a specific ingress class for the deployment. If not set, will default to the cluster default.
ingressClassName: ~

# Enable for cert-manager or kube-lego
acme: false

Expand Down