Skip to content

Commit a14e679

Browse files
authored
Merge pull request #1468 from simonbaird/handle-acceptable-bundle-dupes
Workaround dupe entries in trusted task list
2 parents 557eea2 + 31877e3 commit a14e679

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

policy/lib/tekton/trusted.rego

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,14 @@ _task_expires_on(task) := expires if {
9696
ref := task_ref(task)
9797
records := _trusted_tasks[ref.key]
9898

99-
some record in records
100-
record.ref == ref.pinned_ref
99+
matching_records := [r |
100+
some r in records
101+
r.ref == ref.pinned_ref
102+
]
103+
104+
# Avoid an "eval_conflict_error: functions must not produce multiple
105+
# outputs..." error if the data has duplicate records for this ref
106+
record := matching_records[0]
101107

102108
expires = time.parse_rfc3339_ns(record.expires_on)
103109
}

0 commit comments

Comments
 (0)