-
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.
make cli-install feature optional (#2072)
- Loading branch information
1 parent
0ea0eb3
commit 3e1468b
Showing
7 changed files
with
65 additions
and
1 deletion.
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
2 changes: 1 addition & 1 deletion
2
charts/astronomer/templates/cli-install/cli-install-networkpolicy.yaml
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
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 |
---|---|---|
|
@@ -423,6 +423,7 @@ registry: | |
logLevel: info | ||
|
||
install: | ||
cliEnabled: true | ||
resources: {} | ||
cliVersion: 0.29 | ||
# limits: | ||
|
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,55 @@ | ||
from tests.chart_tests.helm_template_generator import render_chart | ||
import pytest | ||
from tests import supported_k8s_versions | ||
import jmespath | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"kube_version", | ||
supported_k8s_versions, | ||
) | ||
class TestAstronomerCliInstall: | ||
def test_astronomer_cli_install_default(self, kube_version): | ||
"""Test that helm renders a good deployment template for | ||
astronomer/cli-install.""" | ||
docs = render_chart( | ||
kube_version=kube_version, | ||
show_only=[ | ||
"charts/astronomer/templates/cli-install/cli-install-configmap.yaml", | ||
"charts/astronomer/templates/cli-install/cli-install-deployment.yaml", | ||
"charts/astronomer/templates/cli-install/cli-install-networkpolicy.yaml", | ||
"charts/astronomer/templates/cli-install/cli-install-service.yaml", | ||
"charts/astronomer/templates/ingress.yaml", | ||
], | ||
) | ||
|
||
assert len(docs) == 5 | ||
assert "install.example.com" in jmespath.search("spec.rules[*].host", docs[4]) | ||
|
||
def test_astronomer_cli_install_disabled(self, kube_version): | ||
"""Test that cli install service is disabled.""" | ||
docs = render_chart( | ||
kube_version=kube_version, | ||
values={"astronomer": {"install": {"cliEnabled": False}}}, | ||
show_only=[ | ||
"charts/astronomer/templates/cli-install/cli-install-configmap.yaml", | ||
"charts/astronomer/templates/cli-install/cli-install-deployment.yaml", | ||
"charts/astronomer/templates/cli-install/cli-install-networkpolicy.yaml", | ||
"charts/astronomer/templates/cli-install/cli-install-service.yaml", | ||
], | ||
) | ||
|
||
assert len(docs) == 0 | ||
|
||
def test_astronomer_cli_install_ingress_disabled(self, kube_version): | ||
"""Test that cli install service ingress is disabled.""" | ||
docs = render_chart( | ||
kube_version=kube_version, | ||
values={"astronomer": {"install": {"cliEnabled": False}}}, | ||
show_only=["charts/astronomer/templates/ingress.yaml"], | ||
) | ||
|
||
assert len(docs) == 1 | ||
assert "install.example.com" not in jmespath.search( | ||
"spec.rules[*].host", docs[0] | ||
) |