Skip to content

Commit 1bbd924

Browse files
Merge pull request #25880 from mtrmac/verify-signature-over-the-wall
Fix and re-enable test/extended/images/signatures.go
2 parents 6c84517 + 922ee64 commit 1bbd924

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

test/extended/images/signatures.go

+16-10
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ var _ = g.Describe("[sig-imageregistry][Serial][Suite:openshift/registry/serial]
2222
)
2323

2424
g.It("can push a signed image to openshift registry and verify it", func() {
25-
g.Skip("disable because containers/image: https://github.com/containers/image/pull/570")
2625
g.By("building a signer image that knows how to sign images")
2726
output, err := oc.Run("create").Args("-f", signerBuildFixture).Output()
2827
if err != nil {
@@ -83,24 +82,31 @@ var _ = g.Describe("[sig-imageregistry][Serial][Suite:openshift/registry/serial]
8382
o.Expect(err).NotTo(o.HaveOccurred())
8483
o.Expect(out).To(o.ContainSubstring("keyring `/var/lib/origin/gnupg/secring.gpg' created"))
8584

86-
// Create kubeconfig for skopeo
85+
// Create kubeconfig for oc
8786
g.By("logging as a test user")
8887
out, err = pod.Exec("oc login https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT --token=" + token + " --certificate-authority=/run/secrets/kubernetes.io/serviceaccount/ca.crt")
8988
o.Expect(err).NotTo(o.HaveOccurred())
9089
o.Expect(out).To(o.ContainSubstring("Logged in"))
9190

9291
// Sign and copy the memcached image into target image stream tag
93-
// TODO: Fix skopeo to pickup the Kubernetes environment variables (remove the $KUBERNETES_MASTER)
94-
g.By("signing the memcached:latest image and pushing it into openshift registry")
92+
g.By("signing a just-built image and pushing it into openshift registry")
9593
out, err = pod.Exec(strings.Join([]string{
96-
"KUBERNETES_MASTER=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT",
9794
"GNUPGHOME=/var/lib/origin/gnupg",
98-
"skopeo", "--debug", "copy", "--sign-by", "[email protected]",
95+
"skopeo", "--debug",
96+
// Disable the default-docker: file sigstore default in /etc/containers/registries.d, so that the X-Registry-Supports-Signatures protocol is used.
97+
// Newer versions of Skopeo default to X-R-S-S if present, this test (as of 2021-02) uses skopeo-0.1.40-11.el7_8.x86_64, which defaults to sigstore.
98+
"--registries.d", "/this/does/not/exist",
99+
100+
"copy", "--sign-by", "[email protected]",
101+
"--src-creds=" + user + ":" + token,
99102
"--dest-creds=" + user + ":" + token,
100-
// TODO: test with this turned to true as well
101-
"--dest-tls-verify=false",
102-
"docker://docker.io/library/memcached:latest",
103-
"atomic:" + signedImage,
103+
104+
// Expect to use /run/secrets/kubernetes.io/serviceaccount/ca.crt
105+
"--src-cert-dir=/run/secrets/kubernetes.io/serviceaccount",
106+
"--dest-cert-dir=/run/secrets/kubernetes.io/serviceaccount",
107+
108+
"docker://" + signerImage,
109+
"docker://" + signedImage,
104110
}, " "))
105111
fmt.Fprintf(g.GinkgoWriter, "output: %s\n", out)
106112
o.Expect(err).NotTo(o.HaveOccurred())

0 commit comments

Comments
 (0)