@@ -2,6 +2,7 @@ package registry
2
2
3
3
import (
4
4
"fmt"
5
+ "strings"
5
6
6
7
g "github.com/onsi/ginkgo"
7
8
o "github.com/onsi/gomega"
@@ -12,7 +13,7 @@ import (
12
13
e2e "k8s.io/kubernetes/test/e2e/framework"
13
14
)
14
15
15
- var _ = g .Describe ("[imageapis][registry][Skipped][ Serial] image signature workflow" , func () {
16
+ var _ = g .Describe ("[imageapis][registry][Serial] image signature workflow" , func () {
16
17
17
18
defer g .GinkgoRecover ()
18
19
@@ -22,7 +23,6 @@ var _ = g.Describe("[imageapis][registry][Skipped][Serial] image signature workf
22
23
)
23
24
24
25
g .It ("can push a signed image to openshift registry and verify it" , func () {
25
- g .Skip ("FIXME: fix oadm verify-image-signature to work with secured registry" )
26
26
g .By ("building a signer image that knows how to sign images" )
27
27
output , err := oc .Run ("create" ).Args ("-f" , signerBuildFixture ).Output ()
28
28
if err != nil {
@@ -86,8 +86,17 @@ var _ = g.Describe("[imageapis][registry][Skipped][Serial] image signature workf
86
86
// Sign and copy the origin-pod image into target image stream tag
87
87
// TODO: Fix skopeo to pickup the Kubernetes environment variables (remove the $KUBERNETES_MASTER)
88
88
g .By ("signing the origin-pod:latest image and pushing it into openshift registry" )
89
- _ , err = pod .Exec ("KUBERNETES_MASTER=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT GNUPGHOME=/var/lib/origin/gnupg " +
90
- "skopeo --debug --tls-verify=false copy --sign-by [email protected] --dest-creds " + user + ":" + token + " --dest-tls-verify=false docker://docker.io/openshift/origin-pod:latest atomic:" + signedImage )
89
+ out , err = pod .Exec (strings .Join ([]string {
90
+ "KUBERNETES_MASTER=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT" ,
91
+ "GNUPGHOME=/var/lib/origin/gnupg" ,
92
+ "skopeo" ,
"--debug" ,
"copy" ,
"--sign-by" ,
"[email protected] " ,
93
+ "--dest-creds=" + user + ":" + token ,
94
+ // TODO: test with this turned to true as well
95
+ "--dest-tls-verify=false" ,
96
+ "docker://docker.io/openshift/origin-pod:latest" ,
97
+ "atomic:" + signedImage ,
98
+ }, " " ))
99
+ fmt .Fprintf (g .GinkgoWriter , "output: %s\n " , out )
91
100
o .Expect (err ).NotTo (o .HaveOccurred ())
92
101
93
102
err = exutil .WaitForAnImageStreamTag (oc , oc .Namespace (), "signed" , "latest" )
@@ -102,8 +111,16 @@ var _ = g.Describe("[imageapis][registry][Skipped][Serial] image signature workf
102
111
o .Expect (err ).NotTo (o .HaveOccurred ())
103
112
o .Expect (out ).To (o .ContainSubstring ("Unverified" ))
104
113
105
- out , err = pod .Exec ("GNUPGHOME=/var/lib/origin/gnupg " +
106
- "oc adm verify-image-signature " + imageName + " --expected-identity=" + signedImage + " --save" )
114
+ out , err = pod .Exec (strings .Join ([]string {
115
+ "GNUPGHOME=/var/lib/origin/gnupg" ,
116
+ "oc" , "adm" , "verify-image-signature" ,
117
+ "--insecure=true" , // TODO: import the ca certificate into the signing pod
118
+ "--loglevel=5" ,
119
+ imageName ,
120
+ "--expected-identity=" + signedImage ,
121
+ " --save" ,
122
+ }, " " ))
123
+ fmt .Fprintf (g .GinkgoWriter , "output: %s\n " , out )
107
124
o .Expect (err ).NotTo (o .HaveOccurred ())
108
125
o .Expect (out ).To (o .ContainSubstring ("identity is now confirmed" ))
109
126
0 commit comments