Skip to content

Commit

Permalink
Merge pull request #1226 from zregvart/issue/EC-1015
Browse files Browse the repository at this point in the history
Remove the unique items constraint
  • Loading branch information
lcarva authored Nov 20, 2024
2 parents 041d89a + c320aca commit 7d0b6f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion policy/lib/tekton/trusted.rego
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ data_errors contains error if {
"required": ["effective_on", "ref"],
"additionalProperties": false,
},
"uniqueItems": true,
"minItems": 1,
}},
},
Expand Down
5 changes: 1 addition & 4 deletions policy/lib/tekton/trusted_test.rego
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ test_data_errors if {
{"ref": "bad-effective-on", "effective_on": "not-a-date"},
{"ref": "bad-effective-on", "effective_on": "2024-01-01T00:00:00Z", "expires_on": "not-a-date"},
],
# this is allowed
"duplicated-entries": [
{"ref": "sha256:digest", "effective_on": "2099-01-01T00:00:00Z"},
{"ref": "sha256:digest", "effective_on": "2099-01-01T00:00:00Z"},
Expand Down Expand Up @@ -122,10 +123,6 @@ test_data_errors if {
"message": `trusted_tasks.bad-dates[1].expires_on is not valid RFC3339 format: "not-a-date"`,
"severity": "failure",
},
{
"message": "trusted_tasks data has unexpected format: duplicated-entries: array items[0,1] must be unique",
"severity": "warning",
},
}

lib.assert_equal(tekton.data_errors, expected) with data.trusted_tasks as tasks
Expand Down

0 comments on commit 7d0b6f1

Please sign in to comment.