From 1d87932250b6bf3587ac7e8a1e0875a84b5dbab0 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 13 Jul 2021 16:23:31 +0300 Subject: [PATCH] fix: correctly parse image if it contains ':' Signed-off-by: Anatolii Bazko --- src/api/kube.ts | 8 ++++---- yarn.lock | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api/kube.ts b/src/api/kube.ts index 16aca1c3f..30912f0c2 100644 --- a/src/api/kube.ts +++ b/src/api/kube.ts @@ -22,7 +22,7 @@ import * as net from 'net' import { Writable } from 'stream' import { CHE_CLUSTER_API_GROUP, CHE_CLUSTER_API_VERSION, CHE_CLUSTER_BACKUP_KIND_PLURAL, CHE_CLUSTER_KIND_PLURAL, CHE_CLUSTER_RESTORE_KIND_PLURAL, DEFAULT_K8S_POD_ERROR_RECHECK_TIMEOUT, DEFAULT_K8S_POD_WAIT_TIMEOUT, OLM_STABLE_CHANNEL_NAME } from '../constants' -import { getClusterClientCommand, isKubernetesPlatformFamily, newError, safeLoadFromYamlFile } from '../util' +import { getClusterClientCommand, getImageNameAndTag, isKubernetesPlatformFamily, newError, safeLoadFromYamlFile } from '../util' import { V1CheClusterBackup, V1CheClusterRestore } from './typings/backup-restore-crds' import { V1Certificate } from './typings/cert-manager' @@ -1546,9 +1546,9 @@ export class KubeHelper { } const cheImage = flags.cheimage if (cheImage) { - const imageAndTag = cheImage.split(':', 2) - cheClusterCR.spec.server.cheImage = imageAndTag[0] - cheClusterCR.spec.server.cheImageTag = imageAndTag.length === 2 ? imageAndTag[1] : 'latest' + const [image, tag] = getImageNameAndTag(cheImage) + cheClusterCR.spec.server.cheImage = image + cheClusterCR.spec.server.cheImageTag = tag } if ((flags.installer === 'olm' && !flags['catalog-source-yaml']) || (flags['catalog-source-yaml'] && flags['olm-channel'] === OLM_STABLE_CHANNEL_NAME)) { diff --git a/yarn.lock b/yarn.lock index 711c18eaa..0501ba171 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2601,15 +2601,15 @@ ecc-jsbn@~0.1.1: "eclipse-che-devfile-workspace-operator@git://github.com/devfile/devworkspace-operator#main": version "0.0.0" - resolved "git://github.com/devfile/devworkspace-operator#80702f75c00d21b777df4b79811d218fd63e25e3" + resolved "git://github.com/devfile/devworkspace-operator#4e57632132bd3f960fa7a1e397bcbbf01da72470" "eclipse-che-operator@git://github.com/eclipse-che/che-operator#main": version "0.0.0" - resolved "git://github.com/eclipse-che/che-operator#22ab2ed97224c8eb2eae9bfd9e1af13e4ceb0fdf" + resolved "git://github.com/eclipse-che/che-operator#cab8b922135cbc2985d7a4780fb3e5dcf83b5252" "eclipse-che-server@git://github.com/eclipse-che/che-server#main": version "0.0.0" - resolved "git://github.com/eclipse-che/che-server#8eccf8d6a29f261c894804c4ee302b885a3d7dc4" + resolved "git://github.com/eclipse-che/che-server#aa308ba64ad0e440530393c70405b650513f4b3a" editorconfig@^0.15.0: version "0.15.3"