From 1c0d9a19aaea48435fca39d595737050df749e35 Mon Sep 17 00:00:00 2001 From: jhsinger-klotho <111291520+jhsinger-klotho@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:03:39 -0500 Subject: [PATCH] dont check validity if theres already an edge (#822) --- pkg/engine2/path_selection/path_expansion.go | 16 ++++++++++++---- pkg/engine2/testdata/k8s_api.expect.yaml | 1 - pkg/templates/aws/resources/target_group.yaml | 1 - 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pkg/engine2/path_selection/path_expansion.go b/pkg/engine2/path_selection/path_expansion.go index 941a59467..f20cbda85 100644 --- a/pkg/engine2/path_selection/path_expansion.go +++ b/pkg/engine2/path_selection/path_expansion.go @@ -437,11 +437,19 @@ func expandPath( return } - valid, err := checkUniquenessValidity(ctx, source.id, target.id) - if err != nil { + // if the edge doesnt exist in the actual graph we need to check uniqueness validity + _, err := ctx.RawView().Edge(source.id, target.id) + if errors.Is(err, graph.ErrEdgeNotFound) { + valid, err := checkUniquenessValidity(ctx, source.id, target.id) + if err != nil { + errs = errors.Join(errs, err) + return + } + if !valid { + return + } + } else if err != nil { errs = errors.Join(errs, err) - } - if !valid { return } diff --git a/pkg/engine2/testdata/k8s_api.expect.yaml b/pkg/engine2/testdata/k8s_api.expect.yaml index 1c2ec5fb9..e4e53ed88 100755 --- a/pkg/engine2/testdata/k8s_api.expect.yaml +++ b/pkg/engine2/testdata/k8s_api.expect.yaml @@ -135,7 +135,6 @@ resources: Enabled: true HealthyThreshold: 5 Interval: 30 - Matcher: 200-299 Protocol: TCP Timeout: 5 UnhealthyThreshold: 2 diff --git a/pkg/templates/aws/resources/target_group.yaml b/pkg/templates/aws/resources/target_group.yaml index b152b6ee3..2c8ef474a 100644 --- a/pkg/templates/aws/resources/target_group.yaml +++ b/pkg/templates/aws/resources/target_group.yaml @@ -59,7 +59,6 @@ properties: default_value: 2 Matcher: type: string - default_value: 200-299 Arn: type: string configuration_disabled: true