Skip to content

Commit 6baca46

Browse files
committed
Update crc deploy script to remove port-forward
Signed-off-by: perdasilva <[email protected]>
1 parent 8d54310 commit 6baca46

File tree

2 files changed

+11
-77
lines changed

2 files changed

+11
-77
lines changed

scripts/crc-deploy.sh

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,26 @@ function push_images {
1919
# push images to the global crc registry "openshift"
2020
# so that they can be pulled from any other namespace in the cluster
2121
CRC_GLOBAL_REGISTRY="openshift"
22+
CRC_REGISTRY="default-route-openshift-image-registry.apps-crc.testing"
2223

2324
# 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"
2627

2728
# CRC registry coordinates
28-
OPENSHIFT_REGISTRY_NAMESPACE="openshift-image-registry"
2929
OLM_NAMESPACE="openshift-operator-lifecycle-manager"
30-
IMAGE_REGISTRY_SVC="image-registry"
31-
IMAGE_REGISTRY_PORT=5000
3230

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
3637

37-
# Remember to close the port-forward
38-
trap 'kill "${PORT_FWD_PID}"' EXIT
3938

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
4439

4540
# 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
4742

4843
# Tag and push olm image
4944
echo "Pushing olm image"
@@ -190,4 +185,4 @@ fi
190185

191186
echo "Done"
192187

193-
exit 0
188+
exit 0

staging/operator-lifecycle-manager/pkg/controller/operators/olm/downstream_csv_labeler.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)