Skip to content

Commit

Permalink
add resource section to default values (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgvishnuram committed May 27, 2024
1 parent 5a5cb0b commit 46c31e4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/chart/test_auth_sidecar.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_auth_sidecar_config_with_dag_server_enabled(self, kube_version):
assert nginx_conf in docs[2]["data"]["nginx.conf"]

def test_auth_sidecar_security_context_with_dag_server_enabled(self, kube_version):
"""Test logging sidecar config with defaults"""
"""Test auth sidecar security context overrides"""
securityContext = {
"allowPrivilegeEscalation": False,
"runAsNonRoot": True,
Expand All @@ -131,3 +131,25 @@ def test_auth_sidecar_security_context_with_dag_server_enabled(self, kube_versio
common_dagserver_sts_test_cases(docs, 1)
c_by_name = get_containers_by_name(docs[0])
assert c_by_name["auth-proxy"]["securityContext"] == securityContext

def test_auth_sidecar_resources_with_dag_server_enabled(self, kube_version):
"""Test auth sidecar resource overrides"""
resources = {
"requests": {"cpu": 99.9, "memory": "777Mi"},
"limits": {"cpu": 66.6, "memory": "888Mi"},
}

docs = render_chart(
kube_version=kube_version,
values={
"authSidecar": {"enabled": True, "resources": resources},
"dagDeploy": {"enabled": True},
},
show_only=[
"templates/dag-deploy/dag-server-statefulset.yaml",
],
)

common_dagserver_sts_test_cases(docs, 1)
c_by_name = get_containers_by_name(docs[0])
assert c_by_name["auth-proxy"]["resources"] == resources
1 change: 1 addition & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ authSidecar:
pullPolicy: IfNotPresent
port: 8084
securityContext: {}
resources: {}

loggingSidecar:
enabled: false
Expand Down

0 comments on commit 46c31e4

Please sign in to comment.