Skip to content

Commit

Permalink
dont check validity if theres already an edge (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsinger-klotho authored Dec 12, 2023
1 parent dbc2f00 commit 1c0d9a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
16 changes: 12 additions & 4 deletions pkg/engine2/path_selection/path_expansion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 0 additions & 1 deletion pkg/engine2/testdata/k8s_api.expect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ resources:
Enabled: true
HealthyThreshold: 5
Interval: 30
Matcher: 200-299
Protocol: TCP
Timeout: 5
UnhealthyThreshold: 2
Expand Down
1 change: 0 additions & 1 deletion pkg/templates/aws/resources/target_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ properties:
default_value: 2
Matcher:
type: string
default_value: 200-299
Arn:
type: string
configuration_disabled: true
Expand Down

0 comments on commit 1c0d9a1

Please sign in to comment.