@@ -19,31 +19,26 @@ function push_images {
19
19
# push images to the global crc registry "openshift"
20
20
# so that they can be pulled from any other namespace in the cluster
21
21
CRC_GLOBAL_REGISTRY=" openshift"
22
+ CRC_REGISTRY=" default-route-openshift-image-registry.apps-crc.testing"
22
23
23
24
# CRC destined images
24
- CRC_OLM_IMAGE=" localhost:5000 /${CRC_GLOBAL_REGISTRY} /olm:test"
25
- CRC_OPM_IMAGE=" localhost:5000 /${CRC_GLOBAL_REGISTRY} /opm:test"
25
+ CRC_OLM_IMAGE=" ${CRC_REGISTRY} /${CRC_GLOBAL_REGISTRY} /olm:test"
26
+ CRC_OPM_IMAGE=" ${CRC_REGISTRY} /${CRC_GLOBAL_REGISTRY} /opm:test"
26
27
27
28
# CRC registry coordinates
28
- OPENSHIFT_REGISTRY_NAMESPACE=" openshift-image-registry"
29
29
OLM_NAMESPACE=" openshift-operator-lifecycle-manager"
30
- IMAGE_REGISTRY_SVC=" image-registry"
31
- IMAGE_REGISTRY_PORT=5000
32
30
33
- # Create port-forward to CRC registry
34
- kubectl port-forward -n ${OPENSHIFT_REGISTRY_NAMESPACE} svc/${IMAGE_REGISTRY_SVC} ${IMAGE_REGISTRY_PORT} :${IMAGE_REGISTRY_PORT} > /dev/null 2>&1 &
35
- PORT_FWD_PID=$!
31
+ # Copy OCP docker registry certificate
32
+ echo " need sudo to copy OCP certificate to docker configuration"
33
+ rm -rf tls.crt
34
+ oc extract secret/router-ca --keys=tls.crt -n openshift-ingress-operator
35
+ sudo mkdir -p /etc/docker/certs.d/default-route-openshift-image-registry.apps-crc.testing/
36
+ sudo mv tls.crt /etc/docker/certs.d/default-route-openshift-image-registry.apps-crc.testing/tls.crt
36
37
37
- # Remember to close the port-forward
38
- trap ' kill "${PORT_FWD_PID}"' EXIT
39
38
40
- # give port-forward a second
41
- # I found that without this docker login would not work
42
- # as if it couldn't reach the docker server
43
- sleep 1
44
39
45
40
# Login to the CRC registry
46
- oc whoami -t | docker login localhost:5000 --username user --password-stdin
41
+ oc whoami -t | docker login " ${CRC_REGISTRY} " --username user --password-stdin
47
42
48
43
# Tag and push olm image
49
44
echo " Pushing olm image"
190
185
191
186
echo " Done"
192
187
193
- exit 0
188
+ exit 0
0 commit comments