From 104a9bb4da418dff0db144a2be675b982ff602c5 Mon Sep 17 00:00:00 2001 From: DavidSeptimus-Klotho Date: Mon, 4 Mar 2024 20:11:58 -0700 Subject: [PATCH] Fixes cloudfront distribution pulling allowed methods from the same lister rule condition as the path the correct behavior is to pull from the same rule since you can only have one condition type per condition. --- .../edges/cloudfront_distribution-load_balancer.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/templates/aws/edges/cloudfront_distribution-load_balancer.yaml b/pkg/templates/aws/edges/cloudfront_distribution-load_balancer.yaml index ef1ef7752..5a000273d 100644 --- a/pkg/templates/aws/edges/cloudfront_distribution-load_balancer.yaml +++ b/pkg/templates/aws/edges/cloudfront_distribution-load_balancer.yaml @@ -37,12 +37,10 @@ operational_rules: {{ end }} {{ range $i, $route := $routes }} {{ $methods := makeSlice }} - {{ range $i, $rule := $rules }} - {{ range $j, $condition := (fieldValue "Conditions" $rule) }} - {{- if (sliceContains $condition.PathPattern.Values $route) }} - {{ range $j, $method := $condition.HttpRequestMethod.Values }} - {{ $methods = appendSlice $methods $method }} - {{- end }} + {{ range $j, $rule := $rules }} + {{ range $k, $condition := (fieldValue "Conditions" $rule) }} + {{ range $l, $method := $condition.HttpRequestMethod.Values }} + {{ $methods = appendSlice $methods $method }} {{- end }} {{- end }} {{ end }}