Skip to content

Commit

Permalink
PR Feedback - adding the duplicate name found to the check failures f…
Browse files Browse the repository at this point in the history
…or duplicate ingress or terminating gateway names
  • Loading branch information
jmurret committed Mar 29, 2022
1 parent aa9293c commit 2b9b9ac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/consul/templates/ingress-gateways-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

{{- range $innerIngressIndex, $innerIngressVal := $gateways }}
{{- if (and (ne $outerIngressIndex $innerIngressIndex) (eq $outerIngressVal.name $innerIngressVal.name)) }}
{{ fail "ingress gateways must have unique names" }}
{{ fail (cat "ingress gateways must have unique names but found duplicate name" $innerIngressVal.name) }}
{{ end -}}
{{ end -}}
{{ end -}}
Expand Down
4 changes: 2 additions & 2 deletions charts/consul/templates/terminating-gateways-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

{{- range $innerTerminatingIndex, $innerTerminatingVal := $gateways }}
{{- if (and (ne $outerTerminatingIndex $innerTerminatingIndex) (eq $outerTerminatingVal.name $innerTerminatingVal.name)) }}
{{ fail "terminating gateways must have unique names" }}
{{ fail (cat "terminating gateways must have unique names but found duplicate name" $innerTerminatingVal.name) }}
{{ end -}}
{{ end -}}

{{- range $outerIngressIndex, $outerIngressVal := $root.Values.ingressGateways.gateways }}
{{- if (eq $outerTerminatingVal.name $outerIngressVal.name) }}
{{ fail "terminating gateways cannot have duplicate names of any ingress gateways" }}
{{ fail (cat "terminating gateways cannot have duplicate names of any ingress gateways but found duplicate name" $outerTerminatingVal.name) }}
{{ end -}}
{{ end -}}
{{ end -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/consul/test/unit/ingress-gateways-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ load _helpers
--set 'client.enabled=true' .
echo "status: $output"
[ "$status" -eq 1 ]
[[ "$output" =~ "ingress gateways must have unique names" ]]
[[ "$output" =~ "ingress gateways must have unique names but found duplicate name foo" ]]
}

@test "ingressGateways/Deployment: fails if a terminating gateway has the same name as an ingress gateway" {
Expand Down
4 changes: 2 additions & 2 deletions charts/consul/test/unit/terminating-gateways-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ load _helpers
--set 'client.enabled=true' .
echo "status: $output"
[ "$status" -eq 1 ]
[[ "$output" =~ "terminating gateways must have unique names" ]]
[[ "$output" =~ "terminating gateways must have unique names but found duplicate name foo" ]]
}

@test "terminatingGateways/Deployment: fails if a terminating gateway has the same name as an ingress gateway" {
Expand All @@ -123,7 +123,7 @@ load _helpers
--set 'client.enabled=true' .
echo "status: $output"
[ "$status" -eq 1 ]
[[ "$output" =~ "terminating gateways cannot have duplicate names of any ingress gateways" ]]
[[ "$output" =~ "terminating gateways cannot have duplicate names of any ingress gateways but found duplicate name foo" ]]
}

#--------------------------------------------------------------------
Expand Down

0 comments on commit 2b9b9ac

Please sign in to comment.