-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dagOnlyDeployment feature flag in astronomer helm chart (#2096)
* add dagonlydeployment feature in astronomer * add houston config flag for dagDeployment * update test case for dag only deploy feature * fix wrong config location * fix indent * fix comments * Use reusable data. Use obvious test data. --------- Co-authored-by: Daniel Hoherd <daniel.hoherd@gmail.com>
- Loading branch information
1 parent
a458ec6
commit f1ce304
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import pytest | ||
import yaml | ||
from tests import supported_k8s_versions | ||
from tests.chart_tests.helm_template_generator import render_chart | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"kube_version", | ||
supported_k8s_versions, | ||
) | ||
class TestDagOnlyDeploy: | ||
def test_dagonlydeploy_with_defaults(self, kube_version): | ||
"""Test dagonlydeploy Service defaults.""" | ||
docs = render_chart( | ||
kube_version=kube_version, | ||
values={}, | ||
show_only=["charts/astronomer/templates/houston/houston-configmap.yaml"], | ||
) | ||
|
||
prod = yaml.safe_load(docs[0]["data"]["production.yaml"]) | ||
assert prod["deployments"]["dagOnlyDeployment"] is False | ||
|
||
def test_dagonlydeploy_config_enabled(self, kube_version): | ||
"""Test dagonlydeploy Service defaults.""" | ||
resources = { | ||
"requests": {"memory": "888Mi", "cpu": "666m"}, | ||
"limits": {"memory": "999Mi", "cpu": "777m"}, | ||
} | ||
docs = render_chart( | ||
kube_version=kube_version, | ||
values={ | ||
"global": { | ||
"dagOnlyDeployment": { | ||
"enabled": True, | ||
"image": "someregistry.io/my-custom-image:my-custom-tag", | ||
"securityContext": {"fsGroup": 55555}, | ||
"resources": resources, | ||
} | ||
} | ||
}, | ||
show_only=["charts/astronomer/templates/houston/houston-configmap.yaml"], | ||
) | ||
|
||
doc = docs[0] | ||
prod = yaml.safe_load(doc["data"]["production.yaml"]) | ||
assert prod["deployments"]["dagOnlyDeployment"] is True | ||
assert prod["deployments"]["dagDeploy"] == { | ||
"enabled": True, | ||
"images": { | ||
"dagServer": { | ||
"repository": "someregistry.io/my-custom-image", | ||
"tag": "my-custom-tag", | ||
} | ||
}, | ||
"securityContext": {"fsGroup": 55555}, | ||
"resources": resources, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters