Skip to content

Commit fdfaeca

Browse files
committed
e2e test cosign v3 with fluxcd-testing artifacts
Signed-off-by: leigh capili <[email protected]>
1 parent c791341 commit fdfaeca

File tree

6 files changed

+70
-6
lines changed

6 files changed

+70
-6
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
apiVersion: source.toolkit.fluxcd.io/v1
3+
kind: HelmRepository
4+
metadata:
5+
name: podinfo-cosign-v3
6+
spec:
7+
url: oci://ghcr.io/fluxcd-testing/cosign-testing/v3/charts
8+
type: "oci"
9+
interval: 1m
10+
---
11+
apiVersion: source.toolkit.fluxcd.io/v1
12+
kind: HelmChart
13+
metadata:
14+
name: podinfo-cosign-v3-keyless
15+
spec:
16+
chart: podinfo
17+
sourceRef:
18+
kind: HelmRepository
19+
name: podinfo-cosign-v3
20+
version: '6.9.4'
21+
interval: 1m
22+
verify:
23+
provider: cosign
24+
matchOIDCIdentity:
25+
- issuer: ^https://token\.actions\.githubusercontent\.com$
26+
subject: ^https://github\.com/fluxcd-testing/cosign-testing/\.github/workflows/release\.yml@refs/tags/.*

config/testdata/ocirepository/signed-with-key.yaml renamed to config/testdata/ocirepository/signed-with-cosign-v2-key.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: source.toolkit.fluxcd.io/v1
33
kind: OCIRepository
44
metadata:
5-
name: podinfo-deploy-signed-with-key
5+
name: podinfo-deploy-signed-with-v2-key
66
spec:
77
interval: 5m
88
url: oci://ghcr.io/stefanprodan/podinfo-deploy

config/testdata/ocirepository/signed-with-keyless.yaml renamed to config/testdata/ocirepository/signed-with-cosign-v2-keyless.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: source.toolkit.fluxcd.io/v1
33
kind: OCIRepository
44
metadata:
5-
name: podinfo-deploy-signed-with-keyless
5+
name: podinfo-deploy-signed-with-v2-keyless
66
spec:
77
interval: 5m
88
url: oci://ghcr.io/stefanprodan/manifests/podinfo
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: source.toolkit.fluxcd.io/v1
3+
kind: OCIRepository
4+
metadata:
5+
name: podinfo-deploy-signed-with-v3-key
6+
spec:
7+
interval: 5m
8+
url: oci://ghcr.io/fluxcd-testing/cosign-testing/v3/podinfo-deploy
9+
ref:
10+
semver: "6.9.4"
11+
verify:
12+
provider: cosign
13+
secretRef:
14+
name: cosign-testing-key
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: source.toolkit.fluxcd.io/v1
3+
kind: OCIRepository
4+
metadata:
5+
name: podinfo-deploy-signed-with-v3-keyless
6+
spec:
7+
interval: 5m
8+
url: oci://ghcr.io/fluxcd-testing/cosign-testing/v3/manifests/podinfo
9+
ref:
10+
semver: "6.9.4"
11+
verify:
12+
provider: cosign
13+
matchOIDCIdentity:
14+
- issuer: ^https://token\.actions\.githubusercontent\.com$
15+
subject: ^https://github\.com/fluxcd-testing/cosign-testing/\.github/workflows/release\.yml@refs/tags/.*

hack/ci/e2e.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,29 @@ kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/helmchart-from-oc
8585
kubectl -n source-system wait helmchart/podinfo --for=condition=ready --timeout=1m
8686
kubectl -n source-system wait helmchart/podinfo-keyless --for=condition=ready --timeout=1m
8787

88+
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/helmchart-from-oci/cosign-v3.yaml"
89+
kubectl -n source-system wait helmchart/podinfo-cosign-v3-keyless --for=condition=ready --timeout=1m
90+
8891
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/helmchart-from-oci/notation.yaml"
8992
curl -sSLo notation.crt https://raw.githubusercontent.com/stefanprodan/podinfo/master/.notation/notation.crt
9093
curl -sSLo trustpolicy.json https://raw.githubusercontent.com/stefanprodan/podinfo/master/.notation/trustpolicy.json
9194
kubectl -n source-system create secret generic notation-config --from-file=notation.crt --from-file=trustpolicy.json --dry-run=client -o yaml | kubectl apply -f -
9295
kubectl -n source-system wait helmchart/podinfo-notation --for=condition=ready --timeout=1m
9396

9497
echo "Run OCIRepository verify tests"
95-
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/ocirepository/signed-with-key.yaml"
96-
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/ocirepository/signed-with-keyless.yaml"
98+
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/ocirepository/signed-with-cosign-v2-key.yaml"
99+
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/ocirepository/signed-with-cosign-v2-keyless.yaml"
100+
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/ocirepository/signed-with-cosign-v3-key.yaml"
101+
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/ocirepository/signed-with-cosign-v3-keyless.yaml"
97102
curl -sSLo cosign.pub https://raw.githubusercontent.com/stefanprodan/podinfo/master/.cosign/cosign.pub
98103
kubectl -n source-system create secret generic cosign-key --from-file=cosign.pub --dry-run=client -o yaml | kubectl apply -f -
104+
curl -sSLo cosign-testing.pub https://raw.githubusercontent.com/fluxcd-testing/cosign-testing/main/cosign.pub
105+
kubectl -n source-system create secret generic cosign-testing-key --from-file=cosign-testing.pub --dry-run=client -o yaml | kubectl apply -f -
99106

100-
kubectl -n source-system wait ocirepository/podinfo-deploy-signed-with-key --for=condition=ready --timeout=1m
101-
kubectl -n source-system wait ocirepository/podinfo-deploy-signed-with-keyless --for=condition=ready --timeout=1m
107+
kubectl -n source-system wait ocirepository/podinfo-deploy-signed-with-v2-key --for=condition=ready --timeout=1m
108+
kubectl -n source-system wait ocirepository/podinfo-deploy-signed-with-v2-keyless --for=condition=ready --timeout=1m
109+
kubectl -n source-system wait ocirepository/podinfo-deploy-signed-with-v3-key --for=condition=ready --timeout=1m
110+
kubectl -n source-system wait ocirepository/podinfo-deploy-signed-with-v3-keyless --for=condition=ready --timeout=1m
102111

103112
kubectl -n source-system apply -f "${ROOT_DIR}/config/testdata/ocirepository/signed-with-notation.yaml"
104113
kubectl -n source-system wait ocirepository/podinfo-deploy-signed-with-notation --for=condition=ready --timeout=1m

0 commit comments

Comments
 (0)