Skip to content

Commit

Permalink
update helm docs and connect inject tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ndhanushkodi committed Jul 27, 2022
1 parent 20d2a03 commit c345dac
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
51 changes: 51 additions & 0 deletions charts/consul/test/unit/connect-inject-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,57 @@ EOF
[[ "$output" =~ "setting global.peering.enabled to true requires connectInject.enabled to be true" ]]
}

@test "connectInject/Deployment: -poll-server-expose-service=true is set when global.peering.enabled is true" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'connectInject.enabled=true' \
--set 'global.peering.enabled=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-poll-server-expose-service=true"))' | tee /dev/stderr)

[ "${actual}" = "true" ]
}

@test "connectInject/Deployment: -poll-server-expose-service=true is set when servers are enabled and peering is enabled" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'global.enabled=false' \
--set 'server.enabled=true' \
--set 'client.enabled=true' \
--set 'connectInject.enabled=true' \
--set 'global.peering.enabled=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-poll-server-expose-service=true"))' | tee /dev/stderr)

[ "${actual}" = "true" ]
}

@test "connectInject/Deployment: -poll-server-expose-service is not set when servers are disabled" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'server.enabled=false' \
--set 'connectInject.enabled=true' \
--set 'global.peering.enabled=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-poll-server-expose-service=true"))' | tee /dev/stderr)

[ "${actual}" = "false" ]
}

@test "connectInject/Deployment: -poll-server-expose-service is not set when peering is disabled" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'connectInject.enabled=true' \
--set 'global.peering.enabled=false' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-poll-server-expose-service=true"))' | tee /dev/stderr)

[ "${actual}" = "false" ]
}

#--------------------------------------------------------------------
# openshift
Expand Down
7 changes: 7 additions & 0 deletions charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1003,16 +1003,23 @@ server:
# @type: boolean
enabled: "-"
# Type of service, supports LoadBalancer or NodePort.
# @type: string
type: LoadBalancer
# If service is of type NodePort, configures the nodePorts.
nodePort:
# Configures the nodePort to expose the Consul server http port.
# @type: integer
http: null
# Configures the nodePort to expose the Consul server https port.
# @type: integer
https: null
# Configures the nodePort to expose the Consul server serf port.
# @type: integer
serf: null
# Configures the nodePort to expose the Consul server rpc port.
# @type: integer
rpc: null
# Configures the nodePort to expose the Consul server grpc port.
# @type: integer
grpc: null
# This value defines additional annotations for
Expand Down

0 comments on commit c345dac

Please sign in to comment.