Skip to content

Commit f62bcc6

Browse files
authored
add the integration edge ref (#2462)
1 parent 72ce5a2 commit f62bcc6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/integrations/operations/ingest_internalpolicy_persist.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package operations
33

44
import (
55
"context"
6+
"slices"
67

78
ent "github.com/theopenlane/core/internal/ent/generated"
89
"github.com/theopenlane/core/internal/ent/generated/internalpolicy"
@@ -14,6 +15,10 @@ func persistInternalPolicyInput(ctx context.Context, db *ent.Client, integration
1415
return ErrIngestUpsertKeyMissing
1516
}
1617

18+
if integration.ID != "" && !slices.Contains(createInput.IntegrationIDs, integration.ID) {
19+
createInput.IntegrationIDs = append(createInput.IntegrationIDs, integration.ID)
20+
}
21+
1722
return persistRoundTripUpsert(
1823
ctx,
1924
createInput,

0 commit comments

Comments
 (0)