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 30, 2022
1 parent e384982 commit a7a26fe
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 @@ -154,7 +154,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 a7a26fe

Please sign in to comment.