Skip to content

Commit

Permalink
enable nginx allow snippet annotation by default (#2019)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgvishnuram committed Oct 18, 2023
1 parent 37daeb9 commit e1e01ec
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ enableAnnotationValidations: false
# their own *-snippet annotations, otherwise this is forbidden / dropped
# when users add those annotations.
# Global snippets in ConfigMap are still respected
allowSnippetAnnotations: false
allowSnippetAnnotations: true

defaultBackend:
resources: {}
27 changes: 27 additions & 0 deletions tests/chart_tests/test_nginx_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,30 @@ def test_nginx_externalTrafficPolicy_overrides(self):
show_only=["charts/nginx/templates/nginx-service.yaml"],
)[0]
assert "Local" == doc["spec"]["externalTrafficPolicy"]

def test_nginx_allowSnippetAnnotations_defaults(self):
doc = render_chart(
show_only=["charts/nginx/templates/nginx-configmap.yaml"],
)[0]
assert doc["data"]["allow-snippet-annotations"] == "true"

def test_nginx_enableAnnotationValidations_defaults(self):
doc = render_chart(
show_only=["charts/nginx/templates/nginx-deployment.yaml"],
)[0]
annotationValidation = "--enable-annotation-validation"
assert (
annotationValidation
not in doc["spec"]["template"]["spec"]["containers"][0]["args"]
)

def test_nginx_enableAnnotationValidations_overrides(self):
doc = render_chart(
values={"nginx": {"enableAnnotationValidations": True}},
show_only=["charts/nginx/templates/nginx-deployment.yaml"],
)[0]
annotationValidation = "--enable-annotation-validation=true"
assert (
annotationValidation
in doc["spec"]["template"]["spec"]["containers"][0]["args"]
)

0 comments on commit e1e01ec

Please sign in to comment.