Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions antora/docs/modules/ROOT/pages/task_policy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Confirm that each step in the Task uses a container image that is accessible.
* Rule type: [rule-type-indicator failure]#FAILURE#
* FAILURE message: `Step %d uses inaccessible image ref '%s'`
* Code: `step_images.step_images_accessible`
* Effective from: `2025-01-10T00:00:00Z`
* https://github.com/enterprise-contract/ec-policies/blob/{page-origin-refhash}/policy/task/step_images/step_images.rego#L14[Source, window="_blank"]

[#step_image_registries_package]
Expand Down
3 changes: 2 additions & 1 deletion policy/task/step_images/step_images.rego
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import data.lib
# solution: >-
# Make sure the container image used in each step of the Task is pushed to the
# registry and that it can be fetched.
# effective_on: 2025-01-10T00:00:00Z
#
deny contains result if {
input.kind == "Task"

some step_index, step in input.spec.steps
image_ref := step.image
is_null(ec.oci.image_manifest(image_ref))
not ec.oci.image_manifest(image_ref)

result := lib.result_helper_with_term(
rego.metadata.chain(),
Expand Down
2 changes: 1 addition & 1 deletion policy/task/step_images/step_images_test.rego
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ test_task_with_invalid_steps if {
mock_image_manifest(ref) := m if {
startswith(ref, "registry.io/repository/ok")
m := {}
} else := null
}
Loading