Skip to content

noqe: script fixes #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions scripts/crc-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,26 @@ function push_images {
# push images to the global crc registry "openshift"
# so that they can be pulled from any other namespace in the cluster
CRC_GLOBAL_REGISTRY="openshift"
CRC_REGISTRY="default-route-openshift-image-registry.apps-crc.testing"

# CRC destined images
CRC_OLM_IMAGE="localhost:5000/${CRC_GLOBAL_REGISTRY}/olm:test"
CRC_OPM_IMAGE="localhost:5000/${CRC_GLOBAL_REGISTRY}/opm:test"
CRC_OLM_IMAGE="${CRC_REGISTRY}/${CRC_GLOBAL_REGISTRY}/olm:test"
CRC_OPM_IMAGE="${CRC_REGISTRY}/${CRC_GLOBAL_REGISTRY}/opm:test"

# CRC registry coordinates
OPENSHIFT_REGISTRY_NAMESPACE="openshift-image-registry"
OLM_NAMESPACE="openshift-operator-lifecycle-manager"
IMAGE_REGISTRY_SVC="image-registry"
IMAGE_REGISTRY_PORT=5000

# Create port-forward to CRC registry
kubectl port-forward -n ${OPENSHIFT_REGISTRY_NAMESPACE} svc/${IMAGE_REGISTRY_SVC} ${IMAGE_REGISTRY_PORT}:${IMAGE_REGISTRY_PORT} > /dev/null 2>&1 &
PORT_FWD_PID=$!
# Copy OCP docker registry certificate
echo "need sudo to copy OCP certificate to docker configuration"
rm -rf tls.crt
oc extract secret/router-ca --keys=tls.crt -n openshift-ingress-operator
sudo mkdir -p /etc/docker/certs.d/default-route-openshift-image-registry.apps-crc.testing/
sudo mv tls.crt /etc/docker/certs.d/default-route-openshift-image-registry.apps-crc.testing/tls.crt

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

# give port-forward a second
# I found that without this docker login would not work
# as if it couldn't reach the docker server
sleep 1

# Login to the CRC registry
oc whoami -t | docker login localhost:5000 --username user --password-stdin
oc whoami -t | docker login "${CRC_REGISTRY}" --username user --password-stdin

# Tag and push olm image
echo "Pushing olm image"
Expand Down Expand Up @@ -190,4 +185,4 @@ fi

echo "Done"

exit 0
exit 0
2 changes: 1 addition & 1 deletion scripts/sync_pop_candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ done
set -u

remote="${1:-api}"
subtree_dir="staging/${remote}"
subtree_dir="staging/${2:-${remote}}"
cherrypick_set="${remote}.cherrypick"
remaining=$(wc -l < "${cherrypick_set}")

Expand Down