Skip to content

Commit 9856f6d

Browse files
fixed non existing runtime-environment (#486)
1 parent 7e719c8 commit 9856f6d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/interface/cli/commands/hybrid/upgrade.cmd.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ const upgradeCmd = new Command({
8888
let runtimeVersion;
8989
if (!runtimeName) {
9090
const runtimesWithVersions = getRuntimesWithVersions(runtimes, agents);
91+
if (!_.size(runtimesWithVersions)) {
92+
handleError(new Error('Found 0 runtime environments that can be upgraded or migrated'), 'no runtimes found');
93+
}
9194

9295
// for fast lookup of the choice
9396
const runtimesWithVersionsStrings = {};
@@ -106,6 +109,9 @@ const upgradeCmd = new Command({
106109
runtimeVersion = getRuntimeVersion(runtimeName, agents);
107110
}
108111
const runtime = runtimesByName[runtimeName];
112+
if (!runtime) {
113+
handleError(new Error(`runtime environment "${colors.cyan(runtimeName)}" does not exist on this account. run "${colors.cyan('codefresh get re')}" to get all runtimes-environments of this account`), 'runtime environment not found');
114+
}
109115
runtime.metadata.version = runtimeVersion;
110116

111117
if (!kubeContextName) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.65.0",
3+
"version": "0.65.1",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,

0 commit comments

Comments
 (0)