@@ -24,10 +24,10 @@ import (
2424)
2525
2626const (
27- // credVerifyPublicImage is a publicly available image used in multi-tenancy tests
28- credVerifyPublicImage = "docker.io/library/nginx:alpine"
2927 // internalRegistryPrefix is the OpenShift internal registry service address
3028 internalRegistryPrefix = "image-registry.openshift-image-registry.svc:5000"
29+ // credVerifyPublicImage is a cluster-hosted image accessible to all authenticated SAs
30+ credVerifyPublicImage = internalRegistryPrefix + "/openshift/tools:latest"
3131)
3232
3333var _ = g .Describe ("[sig-node][Suite:openshift/disruptive-longrunning][Disruptive][OCPFeatureGate:KubeletEnsureSecretPulledImages][Serial]" , g .Ordered , func () {
@@ -64,12 +64,13 @@ var _ = g.Describe("[sig-node][Suite:openshift/disruptive-longrunning][Disruptiv
6464 workerNode = nodes [0 ].Name
6565 e2e .Logf ("Worker node: %s" , workerNode )
6666
67- // Import busybox into a namespace-scoped imagestream in the internal registry
67+ // Tag the cluster-hosted openshift/tools image into a namespace-scoped imagestream
68+ // so it becomes a "private" image requiring namespace-level pull credentials.
6869 credVerifyEnsureNamespace (ctx , oc , sourceNS )
6970 privateImage = fmt .Sprintf ("%s/%s/test-image:latest" , internalRegistryPrefix , sourceNS )
7071
7172 err = oc .AsAdmin ().WithoutNamespace ().Run ("tag" ).Args (
72- "--source=docker" , "docker.io/library/busybox :latest" ,
73+ "openshift/tools :latest" ,
7374 fmt .Sprintf ("%s/test-image:latest" , sourceNS ),
7475 ).Execute ()
7576 o .Expect (err ).NotTo (o .HaveOccurred ())
@@ -248,10 +249,20 @@ var _ = g.Describe("[sig-node][Suite:openshift/disruptive-longrunning][Disruptiv
248249 g .By ("Caching private image then making the registry unavailable" )
249250 credVerifyRunPod (ctx , oc , credVerifyPod (ns , "pod-seed" , privateImage , workerNode , corev1 .PullIfNotPresent , "pull-secret" ))
250251
251- err := oc .AsAdmin ().WithoutNamespace ().Run ("scale" ).Args ("deployment/image-registry" , "-n" , "openshift-image-registry" , "--replicas=0" ).Execute ()
252+ deploy , err := oc .AdminKubeClient ().AppsV1 ().Deployments ("openshift-image-registry" ).Get (ctx , "image-registry" , metav1.GetOptions {})
253+ o .Expect (err ).NotTo (o .HaveOccurred ())
254+ originalReplicas := ptr .Deref (deploy .Spec .Replicas , int32 (1 ))
255+
256+ err = oc .AsAdmin ().WithoutNamespace ().Run ("scale" ).Args ("deployment/image-registry" , "-n" , "openshift-image-registry" , "--replicas=0" ).Execute ()
252257 o .Expect (err ).NotTo (o .HaveOccurred ())
253258 g .DeferCleanup (func () {
254- _ = oc .AsAdmin ().WithoutNamespace ().Run ("scale" ).Args ("deployment/image-registry" , "-n" , "openshift-image-registry" , "--replicas=2" ).Execute ()
259+ _ = oc .AsAdmin ().WithoutNamespace ().Run ("scale" ).Args (
260+ "deployment/image-registry" , "-n" , "openshift-image-registry" ,
261+ fmt .Sprintf ("--replicas=%d" , originalReplicas ),
262+ ).Execute ()
263+ _ = oc .AsAdmin ().WithoutNamespace ().Run ("rollout" ).Args (
264+ "status" , "deployment/image-registry" , "-n" , "openshift-image-registry" , "--timeout=2m" ,
265+ ).Execute ()
255266 })
256267 err = oc .AsAdmin ().WithoutNamespace ().Run ("rollout" ).Args ("status" , "deployment/image-registry" , "-n" , "openshift-image-registry" , "--timeout=2m" ).Execute ()
257268 o .Expect (err ).NotTo (o .HaveOccurred ())
0 commit comments