Skip to content

Commit

Permalink
backport of commit 2264c14
Browse files Browse the repository at this point in the history
  • Loading branch information
missylbytes committed Feb 6, 2024
1 parent 833dab1 commit 9391c18
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions charts/consul/test/unit/mesh-gateway-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1783,4 +1783,21 @@ key2: value2' \
local actual=$(echo "$cmd" |
yq 'any(contains("-log-level=warn"))' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

#--------------------------------------------------------------------
# security context

@test "meshGateway/Deployment: security context is set on Consul Dataplane" {
cd `chart_dir`
local actual=$(helm template \
-s templates/mesh-gateway-deployment.yaml \
--set 'meshGateway.enabled=true' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.containers[0].securityContext' | tee /dev/stderr)

[ $(echo "${actual}" | yq -r '.capabilities.drop[0]') = "ALL" ]
[ $(echo "${actual}" | yq -r '.capabilities.add[0]') = "NET_BIND_SERVICE" ]

}

0 comments on commit 9391c18

Please sign in to comment.