Skip to content

Commit

Permalink
fix: correctly parse image if it contains ':'
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Jul 13, 2021
1 parent 0cf7a4e commit 1d87932
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/api/kube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)) {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1d87932

Please sign in to comment.