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
12 changes: 12 additions & 0 deletions test/e2e_test_cluster_image_policy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ echo '::group:: Deploy ClusterImagePolicy With Key Signing'
yq '. | .spec.authorities[0].key.data |= load_str("cosign-colocated-signing.pub")' \
./test/testdata/policy-controller/e2e/cip-key-and-keyless.yaml | \
kubectl apply -f -

# Give the policy controller a moment to update the configmap
# and pick up the change in the admission controller.
sleep 5
echo '::endgroup::'

echo '::group:: test with key and keyless, authorities OR'
Expand Down Expand Up @@ -302,6 +306,10 @@ yq '. | .metadata.name = "image-policy-remote-source"
| .spec.authorities[0].key.data |= load_str("cosign-remote-signing.pub")' \
./test/testdata/policy-controller/e2e/cip-key.yaml | \
kubectl apply -f -

# Give the policy controller a moment to update the configmap
# and pick up the change in the admission controller.
sleep 5
echo '::endgroup::'

echo '::group:: Sign demoimage with cosign remote key'
Expand Down Expand Up @@ -338,6 +346,10 @@ yq '. | .metadata.name = "image-policy-remote-source"
| .spec.authorities[0] += {"source": [{"oci": env(KO_DOCKER_REPO)+"/remote-signature"}]}' \
./test/testdata/policy-controller/e2e/cip-key.yaml | \
kubectl apply -f -

# Give the policy controller a moment to update the configmap
# and pick up the change in the admission controller.
sleep 5
echo '::endgroup::'

echo '::group:: Verify with three CIP, one with correct Source set'
Expand Down
12 changes: 9 additions & 3 deletions test/e2e_test_cluster_image_policy_with_attestations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ echo '::endgroup::'
# custom attestation. Let's now do it for 'keyful' one.
echo '::group:: Create CIP that requires a keyful signature'
yq '. | .spec.authorities[0].key.data |= load_str("cosign.pub")' ./test/testdata/policy-controller/e2e/cip-key.yaml | kubectl apply -f -
# allow things to propagate

# Give the policy controller a moment to update the configmap
# and pick up the change in the admission controller.
sleep 5
echo '::endgroup::'

Expand All @@ -184,7 +186,9 @@ echo '::endgroup::'
# keyful attestation, so let's add that requirement.
echo '::group:: Create CIP that requires a keyful attestation'
yq '. | .spec.authorities[0].key.data |= load_str("cosign.pub")' ./test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml | kubectl apply -f -
# allow things to propagate

# Give the policy controller a moment to update the configmap
# and pick up the change in the admission controller.
sleep 5
echo '::endgroup::'

Expand Down Expand Up @@ -223,7 +227,9 @@ echo '::endgroup::'
# Note we have to bake in the inline data from the keys above
echo '::group:: Add cip for two signatures and two attestations'
yq '. | .spec.authorities[1].key.data |= load_str("cosign.pub") | .spec.authorities[3].key.data |= load_str("cosign.pub")' ./test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml | kubectl apply -f -
# allow things to propagate

# Give the policy controller a moment to update the configmap
# and pick up the change in the admission controller.
sleep 5
echo '::endgroup::'

Expand Down