From bc5422cf9fd9d21d7028d445fe1982080101611a Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 7 Jun 2023 00:25:27 +0200 Subject: [PATCH] Fix default installer to make local cluster pull images from private registry Change-Id: Ied88a31ce3c4c5daa11f95dc68e7312a7dd70c50 Signed-off-by: garciadeblas --- installers/full_install_osm.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index f3d89230..943a0804 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -216,10 +216,22 @@ function docker_login() { [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } +function create_k8s_secret_regcred() { + [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function + echo "Creating K8s secret regcred with the docker registry credentials from $HOME/.docker/config.json" + kubectl -n osm create secret generic regcred \ + --from-file=.dockerconfigjson=$HOME/.docker/config.json \ + --type=kubernetes.io/dockerconfigjson + [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function +} + function pull_docker_images() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function echo "Pulling docker images" - [ -n "${DOCKER_REGISTRY_URL}" ] && docker_login + if [ -n "${DOCKER_REGISTRY_URL}" ]; then + docker_login + create_k8s_secret_registrycreds + fi echo "Pulling non-OSM docker images" if [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q KAFKA ; then -- 2.25.1