@catladder/cli 1.0.0 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -11
- package/src/apps/cli/cli.ts +0 -2
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +9 -5
- package/src/apps/cli/verify/migration/fromv2.ts +1 -2
- package/dist/apps/catenv/catenv.d.ts +0 -2
- package/dist/apps/catenv/catenv.js +0 -135
- package/dist/apps/catenv/catenv.js.map +0 -1
- package/dist/apps/cli/cli.d.ts +0 -2
- package/dist/apps/cli/cli.js +0 -81
- package/dist/apps/cli/cli.js.map +0 -1
- package/dist/apps/cli/commands/general/index.d.ts +0 -4
- package/dist/apps/cli/commands/general/index.js +0 -274
- package/dist/apps/cli/commands/general/index.js.map +0 -1
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.d.ts +0 -3
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.js +0 -56
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.js.map +0 -1
- package/dist/apps/cli/commands/general/portForward.d.ts +0 -3
- package/dist/apps/cli/commands/general/portForward.js +0 -98
- package/dist/apps/cli/commands/general/portForward.js.map +0 -1
- package/dist/apps/cli/commands/mongodb/index.d.ts +0 -3
- package/dist/apps/cli/commands/mongodb/index.js +0 -53
- package/dist/apps/cli/commands/mongodb/index.js.map +0 -1
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +0 -3
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +0 -190
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +0 -1
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +0 -3
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js +0 -96
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js.map +0 -1
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +0 -3
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +0 -105
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +0 -1
- package/dist/apps/cli/commands/mongodb/utils/index.d.ts +0 -13
- package/dist/apps/cli/commands/mongodb/utils/index.js +0 -167
- package/dist/apps/cli/commands/mongodb/utils/index.js.map +0 -1
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +0 -128
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +0 -1
- package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandConfigSecrets.js +0 -254
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +0 -1
- package/dist/apps/cli/commands/project/commandCopyDB.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandCopyDB.js +0 -102
- package/dist/apps/cli/commands/project/commandCopyDB.js.map +0 -1
- package/dist/apps/cli/commands/project/commandDeletePods.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandDeletePods.js +0 -119
- package/dist/apps/cli/commands/project/commandDeletePods.js.map +0 -1
- package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandDeleteProject.js +0 -97
- package/dist/apps/cli/commands/project/commandDeleteProject.js.map +0 -1
- package/dist/apps/cli/commands/project/commandEnvVars.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandEnvVars.js +0 -74
- package/dist/apps/cli/commands/project/commandEnvVars.js.map +0 -1
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +0 -58
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +0 -1
- package/dist/apps/cli/commands/project/commandGetShell.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandGetShell.js +0 -92
- package/dist/apps/cli/commands/project/commandGetShell.js.map +0 -1
- package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandGitlabCi.js +0 -185
- package/dist/apps/cli/commands/project/commandGitlabCi.js.map +0 -1
- package/dist/apps/cli/commands/project/commandInitGitlab.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandInitGitlab.js +0 -245
- package/dist/apps/cli/commands/project/commandInitGitlab.js.map +0 -1
- package/dist/apps/cli/commands/project/commandInitProject.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandInitProject.js +0 -345
- package/dist/apps/cli/commands/project/commandInitProject.js.map +0 -1
- package/dist/apps/cli/commands/project/commandListPods.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandListPods.js +0 -78
- package/dist/apps/cli/commands/project/commandListPods.js.map +0 -1
- package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +0 -7
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js +0 -113
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +0 -1
- package/dist/apps/cli/commands/project/commandNamespace.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandNamespace.js +0 -70
- package/dist/apps/cli/commands/project/commandNamespace.js.map +0 -1
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.js +0 -83
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +0 -1
- package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandOpenDashboard.js +0 -92
- package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +0 -1
- package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandOpenEnv.js +0 -80
- package/dist/apps/cli/commands/project/commandOpenEnv.js.map +0 -1
- package/dist/apps/cli/commands/project/commandOpenGit.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandOpenGit.js +0 -56
- package/dist/apps/cli/commands/project/commandOpenGit.js.map +0 -1
- package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandOpenGrafana.js +0 -83
- package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +0 -1
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +0 -99
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +0 -1
- package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandOpenLogs.js +0 -87
- package/dist/apps/cli/commands/project/commandOpenLogs.js.map +0 -1
- package/dist/apps/cli/commands/project/commandPauseProject.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandPauseProject.js +0 -97
- package/dist/apps/cli/commands/project/commandPauseProject.js.map +0 -1
- package/dist/apps/cli/commands/project/commandPortForward.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandPortForward.js +0 -106
- package/dist/apps/cli/commands/project/commandPortForward.js.map +0 -1
- package/dist/apps/cli/commands/project/commandReloadConfig.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandReloadConfig.js +0 -62
- package/dist/apps/cli/commands/project/commandReloadConfig.js.map +0 -1
- package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +0 -3
- package/dist/apps/cli/commands/project/commandTriggerCronjob.js +0 -144
- package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +0 -1
- package/dist/apps/cli/commands/project/index.d.ts +0 -3
- package/dist/apps/cli/commands/project/index.js +0 -97
- package/dist/apps/cli/commands/project/index.js.map +0 -1
- package/dist/apps/cli/commands/project/utils/autocompletions.d.ts +0 -3
- package/dist/apps/cli/commands/project/utils/autocompletions.js +0 -96
- package/dist/apps/cli/commands/project/utils/autocompletions.js.map +0 -1
- package/dist/apps/cli/commands/project/utils/ensureCluster.d.ts +0 -1
- package/dist/apps/cli/commands/project/utils/ensureCluster.js +0 -84
- package/dist/apps/cli/commands/project/utils/ensureCluster.js.map +0 -1
- package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +0 -1
- package/dist/apps/cli/commands/project/utils/ensureNamespace.js +0 -92
- package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +0 -1
- package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +0 -2
- package/dist/apps/cli/commands/project/utils/showProjectBanner.js +0 -58
- package/dist/apps/cli/commands/project/utils/showProjectBanner.js.map +0 -1
- package/dist/apps/cli/commands/shared/index.d.ts +0 -2
- package/dist/apps/cli/commands/shared/index.js +0 -72
- package/dist/apps/cli/commands/shared/index.js.map +0 -1
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +0 -3
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +0 -131
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +0 -1
- package/dist/apps/cli/config/writeConfig.d.ts +0 -5
- package/dist/apps/cli/config/writeConfig.js +0 -104
- package/dist/apps/cli/config/writeConfig.js.map +0 -1
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.d.ts +0 -1
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +0 -69
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +0 -1
- package/dist/apps/cli/verify/index.d.ts +0 -2
- package/dist/apps/cli/verify/index.js +0 -90
- package/dist/apps/cli/verify/index.js.map +0 -1
- package/dist/apps/cli/verify/migration/fromv2.d.ts +0 -3
- package/dist/apps/cli/verify/migration/fromv2.js +0 -322
- package/dist/apps/cli/verify/migration/fromv2.js.map +0 -1
- package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +0 -4
- package/dist/apps/cli/verify/migration/migrateSecrets.js +0 -88
- package/dist/apps/cli/verify/migration/migrateSecrets.js.map +0 -1
- package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +0 -17
- package/dist/apps/cli/verify/migration/oldGitlabCi.js +0 -26
- package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +0 -1
- package/dist/catenv.d.ts +0 -1
- package/dist/catenv.js +0 -8
- package/dist/catenv.js.map +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -13
- package/dist/cli.js.map +0 -1
- package/dist/config/clusters.d.ts +0 -14
- package/dist/config/clusters.js +0 -72
- package/dist/config/clusters.js.map +0 -1
- package/dist/config/constants.d.ts +0 -4
- package/dist/config/constants.js +0 -8
- package/dist/config/constants.js.map +0 -1
- package/dist/config/getProjectConfig.d.ts +0 -21
- package/dist/config/getProjectConfig.js +0 -212
- package/dist/config/getProjectConfig.js.map +0 -1
- package/dist/k8sApi/index.d.ts +0 -5
- package/dist/k8sApi/index.js +0 -11
- package/dist/k8sApi/index.js.map +0 -1
- package/dist/packageInfos.d.ts +0 -2
- package/dist/packageInfos.js +0 -6
- package/dist/packageInfos.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/types.d.ts +0 -18
- package/dist/types/types.js +0 -3
- package/dist/types/types.js.map +0 -1
- package/dist/utils/cluster.d.ts +0 -12
- package/dist/utils/cluster.js +0 -100
- package/dist/utils/cluster.js.map +0 -1
- package/dist/utils/dashboardToken.d.ts +0 -2
- package/dist/utils/dashboardToken.js +0 -89
- package/dist/utils/dashboardToken.js.map +0 -1
- package/dist/utils/editAsFile.d.ts +0 -1
- package/dist/utils/editAsFile.js +0 -85
- package/dist/utils/editAsFile.js.map +0 -1
- package/dist/utils/files.d.ts +0 -2
- package/dist/utils/files.js +0 -83
- package/dist/utils/files.js.map +0 -1
- package/dist/utils/formatEnvVars.d.ts +0 -2
- package/dist/utils/formatEnvVars.js +0 -10
- package/dist/utils/formatEnvVars.js.map +0 -1
- package/dist/utils/getEditor.d.ts +0 -4
- package/dist/utils/getEditor.js +0 -70
- package/dist/utils/getEditor.js.map +0 -1
- package/dist/utils/gitlab.d.ts +0 -21
- package/dist/utils/gitlab.js +0 -258
- package/dist/utils/gitlab.js.map +0 -1
- package/dist/utils/log.d.ts +0 -1
- package/dist/utils/log.js +0 -14
- package/dist/utils/log.js.map +0 -1
- package/dist/utils/passwordstore/index.d.ts +0 -8
- package/dist/utils/passwordstore/index.js +0 -378
- package/dist/utils/passwordstore/index.js.map +0 -1
- package/dist/utils/portForward.d.ts +0 -4
- package/dist/utils/portForward.js +0 -116
- package/dist/utils/portForward.js.map +0 -1
- package/dist/utils/preferences/index.d.ts +0 -3
- package/dist/utils/preferences/index.js +0 -119
- package/dist/utils/preferences/index.js.map +0 -1
- package/dist/utils/projects/index.d.ts +0 -8
- package/dist/utils/projects/index.js +0 -150
- package/dist/utils/projects/index.js.map +0 -1
- package/dist/utils/promise.d.ts +0 -2
- package/dist/utils/promise.js +0 -62
- package/dist/utils/promise.js.map +0 -1
- package/dist/utils/shell.d.ts +0 -1
- package/dist/utils/shell.js +0 -81
- package/dist/utils/shell.js.map +0 -1
- package/src/types/git-repo-name.d.ts +0 -1
- package/src/types/yawn-yaml.d.ts +0 -1
- package/src/utils/dashboardToken.ts +0 -20
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.__esModule = true;
|
|
39
|
-
exports.namespaceAutoCompletion = void 0;
|
|
40
|
-
var index_1 = require("./index");
|
|
41
|
-
exports.namespaceAutoCompletion = {
|
|
42
|
-
data: function () {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
-
var namespaces;
|
|
45
|
-
return __generator(this, function (_a) {
|
|
46
|
-
switch (_a.label) {
|
|
47
|
-
case 0: return [4 /*yield*/, (0, index_1.getAllNamespacesNames)()];
|
|
48
|
-
case 1:
|
|
49
|
-
namespaces = _a.sent();
|
|
50
|
-
return [2 /*return*/, namespaces];
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=namespaceAutoCompletion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"namespaceAutoCompletion.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/general/namespaceAutoCompletion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAgD;AACnC,QAAA,uBAAuB,GAAG;IAC/B,IAAI;;;;;4BACW,qBAAM,IAAA,6BAAqB,GAAE,EAAA;;wBAA1C,UAAU,GAAG,SAA6B;wBAChD,sBAAO,UAAU,EAAC;;;;KACnB;CACF,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
exports.__esModule = true;
|
|
42
|
-
var log_1 = require("../../../../utils/log");
|
|
43
|
-
var portForward_1 = require("../../../../utils/portForward");
|
|
44
|
-
var k8sApi_1 = __importDefault(require("../../../../k8sApi"));
|
|
45
|
-
var namespaceAutoCompletion_1 = require("./namespaceAutoCompletion");
|
|
46
|
-
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
-
return __generator(this, function (_a) {
|
|
48
|
-
return [2 /*return*/, vorpal
|
|
49
|
-
.command("port-forward <namespace>", "start port-forwarding")
|
|
50
|
-
.autocomplete(namespaceAutoCompletion_1.namespaceAutoCompletion)
|
|
51
|
-
.action(function (_a) {
|
|
52
|
-
var namespace = _a.namespace;
|
|
53
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
-
var res, podNames, podName, localPort, remotePort;
|
|
55
|
-
return __generator(this, function (_b) {
|
|
56
|
-
switch (_b.label) {
|
|
57
|
-
case 0: return [4 /*yield*/, k8sApi_1["default"].listNamespacedPod(namespace)];
|
|
58
|
-
case 1:
|
|
59
|
-
res = _b.sent();
|
|
60
|
-
if (res.body.items.length === 0) {
|
|
61
|
-
(0, log_1.logError)(this, "sorry, no pods found");
|
|
62
|
-
return [2 /*return*/];
|
|
63
|
-
}
|
|
64
|
-
podNames = res.body.items.map(function (i) { return i.metadata.name; });
|
|
65
|
-
if (podNames.length === 0) {
|
|
66
|
-
(0, log_1.logError)(this, "sorry, no pods found");
|
|
67
|
-
return [2 /*return*/];
|
|
68
|
-
}
|
|
69
|
-
return [4 /*yield*/, this.prompt({
|
|
70
|
-
type: "list",
|
|
71
|
-
name: "podName",
|
|
72
|
-
choices: podNames,
|
|
73
|
-
message: "Which pod? 🤔"
|
|
74
|
-
})];
|
|
75
|
-
case 2:
|
|
76
|
-
podName = (_b.sent()).podName;
|
|
77
|
-
return [4 /*yield*/, this.prompt({
|
|
78
|
-
type: "number",
|
|
79
|
-
name: "localPort",
|
|
80
|
-
message: "Local port: "
|
|
81
|
-
})];
|
|
82
|
-
case 3:
|
|
83
|
-
localPort = (_b.sent()).localPort;
|
|
84
|
-
return [4 /*yield*/, this.prompt({
|
|
85
|
-
type: "number",
|
|
86
|
-
name: "remotePort",
|
|
87
|
-
message: "Remote port: "
|
|
88
|
-
})];
|
|
89
|
-
case 4:
|
|
90
|
-
remotePort = (_b.sent()).remotePort;
|
|
91
|
-
return [2 /*return*/, (0, portForward_1.startPortForward)(podName, localPort, remotePort, namespace)];
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
})];
|
|
96
|
-
});
|
|
97
|
-
}); });
|
|
98
|
-
//# sourceMappingURL=portForward.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"portForward.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/general/portForward.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAiD;AAEjD,6DAAiE;AAEjE,8DAAwC;AACxC,qEAAoE;AAEpE,sBAAe,UAAO,MAAc;;QAClC,sBAAA,MAAM;iBACH,OAAO,CAAC,0BAA0B,EAAE,uBAAuB,CAAC;iBAC5D,YAAY,CAAC,iDAAuB,CAAC;iBACrC,MAAM,CAAC,UAAgB,EAAa;oBAAX,SAAS,eAAA;;;;;oCACrB,qBAAM,mBAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAA;;gCAA/C,GAAG,GAAG,SAAyC;gCACrD,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;oCAC/B,IAAA,cAAQ,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;oCACvC,sBAAO;iCACR;gCACK,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAf,CAAe,CAAC,CAAC;gCAE5D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;oCACzB,IAAA,cAAQ,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;oCACvC,sBAAO;iCACR;gCACmB,qBAAM,IAAI,CAAC,MAAM,CAAC;wCACpC,IAAI,EAAE,MAAM;wCACZ,IAAI,EAAE,SAAS;wCACf,OAAO,EAAE,QAAQ;wCACjB,OAAO,EAAE,eAAe;qCACzB,CAAC,EAAA;;gCALM,OAAO,GAAK,CAAA,SAKlB,CAAA,QALa;gCAOO,qBAAM,IAAI,CAAC,MAAM,CAAC;wCACtC,IAAI,EAAE,QAAQ;wCACd,IAAI,EAAE,WAAW;wCAEjB,OAAO,EAAE,cAAc;qCACxB,CAAC,EAAA;;gCALM,SAAS,GAAK,CAAA,SAKpB,CAAA,UALe;gCAOM,qBAAM,IAAI,CAAC,MAAM,CAAC;wCACvC,IAAI,EAAE,QAAQ;wCACd,IAAI,EAAE,YAAY;wCAElB,OAAO,EAAE,eAAe;qCACzB,CAAC,EAAA;;gCALM,UAAU,GAAK,CAAA,SAKrB,CAAA,WALgB;gCAOlB,sBAAO,IAAA,8BAAgB,EAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,EAAC;;;;aACpE,CAAC,EAAA;;KAAA,EAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
exports.__esModule = true;
|
|
42
|
-
var projectMongoDestroyMember_1 = __importDefault(require("./projectMongoDestroyMember"));
|
|
43
|
-
var projectMongoGetShell_1 = __importDefault(require("./projectMongoGetShell"));
|
|
44
|
-
var projectMongoPortForward_1 = __importDefault(require("./projectMongoPortForward"));
|
|
45
|
-
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
-
return __generator(this, function (_a) {
|
|
47
|
-
(0, projectMongoGetShell_1["default"])(vorpal);
|
|
48
|
-
(0, projectMongoPortForward_1["default"])(vorpal);
|
|
49
|
-
(0, projectMongoDestroyMember_1["default"])(vorpal);
|
|
50
|
-
return [2 /*return*/];
|
|
51
|
-
});
|
|
52
|
-
}); });
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/mongodb/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0FAAoE;AACpE,gFAA0D;AAC1D,sFAAgE;AAEhE,sBAAe,UAAO,MAAc;;QAClC,IAAA,iCAAoB,EAAC,MAAM,CAAC,CAAC;QAC7B,IAAA,oCAAuB,EAAC,MAAM,CAAC,CAAC;QAChC,IAAA,sCAAyB,EAAC,MAAM,CAAC,CAAC;;;KACnC,EAAC"}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
exports.__esModule = true;
|
|
42
|
-
var child_process_promise_1 = require("child-process-promise");
|
|
43
|
-
var log_1 = require("../../../../utils/log");
|
|
44
|
-
var projects_1 = require("../../../../utils/projects");
|
|
45
|
-
var autocompletions_1 = require("../project/utils/autocompletions");
|
|
46
|
-
var ensureCluster_1 = __importDefault(require("../project/utils/ensureCluster"));
|
|
47
|
-
var utils_1 = require("./utils");
|
|
48
|
-
var removeFinalizer = function (namespace, type, name) { return __awaiter(void 0, void 0, void 0, function () {
|
|
49
|
-
return __generator(this, function (_a) {
|
|
50
|
-
return [2 /*return*/, (0, child_process_promise_1.exec)("kubectl patch --namespace ".concat(namespace, " ").concat(type, " ").concat(name, " -p '{\"metadata\":{\"finalizers\":null}}'"))];
|
|
51
|
-
});
|
|
52
|
-
}); };
|
|
53
|
-
var deleteResource = function (namespace, type, name) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
54
|
-
return [2 /*return*/, (0, child_process_promise_1.exec)("kubectl delete --namespace ".concat(namespace, " ").concat(type, " ").concat(name))];
|
|
55
|
-
}); }); };
|
|
56
|
-
var removeFinalizerAndDelete = function (namespace, type, name) { return __awaiter(void 0, void 0, void 0, function () {
|
|
57
|
-
var _a, _b, _c;
|
|
58
|
-
return __generator(this, function (_d) {
|
|
59
|
-
switch (_d.label) {
|
|
60
|
-
case 0:
|
|
61
|
-
_b = (_a = Promise).all;
|
|
62
|
-
_c = [removeFinalizer(namespace, type, name)];
|
|
63
|
-
return [4 /*yield*/, deleteResource(namespace, type, name)];
|
|
64
|
-
case 1: return [2 /*return*/, _b.apply(_a, [_c.concat([
|
|
65
|
-
_d.sent()
|
|
66
|
-
])])];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}); };
|
|
70
|
-
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
-
var _a, _b;
|
|
72
|
-
return __generator(this, function (_c) {
|
|
73
|
-
switch (_c.label) {
|
|
74
|
-
case 0:
|
|
75
|
-
_b = (_a = vorpal
|
|
76
|
-
.command("project-mongo-destroy-member <envComponent>", "DESTROY a member of a replicaset in order to reinitialize it"))
|
|
77
|
-
.autocomplete;
|
|
78
|
-
return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
|
|
79
|
-
case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])
|
|
80
|
-
.action(function (_a) {
|
|
81
|
-
var envComponent = _a.envComponent;
|
|
82
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
-
var understood, namespace, mongodbPods, pvcs, secondaries, podName, thePvc, shouldContinue, e_1, e_2;
|
|
84
|
-
return __generator(this, function (_b) {
|
|
85
|
-
switch (_b.label) {
|
|
86
|
-
case 0: return [4 /*yield*/, ensureCluster_1["default"].call(this, envComponent)];
|
|
87
|
-
case 1:
|
|
88
|
-
_b.sent();
|
|
89
|
-
this.log("this command tries to delete a (secondary) member of the replicaset, it's persistent volume claim (pvc) and the volume");
|
|
90
|
-
this.log("");
|
|
91
|
-
this.log("this is useful, if you update the stateful set with new volume configuration (different size or storage class)");
|
|
92
|
-
this.log("");
|
|
93
|
-
this.log("Kubernetes will usually recreate the missing member with the updated config and mongodb will start synchronizing the new member.");
|
|
94
|
-
this.log("");
|
|
95
|
-
this.log("This works without downtime, but should be done when load on the db is low. Also it has not been tested with large dbs (> 10gi)");
|
|
96
|
-
this.log("");
|
|
97
|
-
this.log("Deleting the volume and claim often stuck, just wait or cancel and restart.");
|
|
98
|
-
this.log("");
|
|
99
|
-
return [4 /*yield*/, this.prompt({
|
|
100
|
-
"default": true,
|
|
101
|
-
message: "DO YOU UNDERSTAND?",
|
|
102
|
-
name: "understood",
|
|
103
|
-
type: "confirm"
|
|
104
|
-
})];
|
|
105
|
-
case 2:
|
|
106
|
-
understood = (_b.sent()).understood;
|
|
107
|
-
if (!understood) {
|
|
108
|
-
throw new Error("abort");
|
|
109
|
-
}
|
|
110
|
-
return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
|
|
111
|
-
case 3:
|
|
112
|
-
namespace = _b.sent();
|
|
113
|
-
return [4 /*yield*/, (0, utils_1.getMongoDbPodsWithReplInfo)(envComponent)];
|
|
114
|
-
case 4:
|
|
115
|
-
mongodbPods = _b.sent();
|
|
116
|
-
return [4 /*yield*/, (0, projects_1.getProjectPvcs)(envComponent)];
|
|
117
|
-
case 5:
|
|
118
|
-
pvcs = _b.sent();
|
|
119
|
-
secondaries = mongodbPods.filter(function (pod) { return !pod.isMaster; });
|
|
120
|
-
if (secondaries.length === 0) {
|
|
121
|
-
(0, log_1.logError)(this, "sorry, no pods found");
|
|
122
|
-
return [2 /*return*/];
|
|
123
|
-
}
|
|
124
|
-
return [4 /*yield*/, this.prompt({
|
|
125
|
-
type: "list",
|
|
126
|
-
name: "podName",
|
|
127
|
-
choices: secondaries.map(function (p) { return ({
|
|
128
|
-
name: "[ secondary ] ".concat(p.podName),
|
|
129
|
-
value: p.podName
|
|
130
|
-
}); }),
|
|
131
|
-
message: "Which pod? 🤔"
|
|
132
|
-
})];
|
|
133
|
-
case 6:
|
|
134
|
-
podName = (_b.sent()).podName;
|
|
135
|
-
thePvc = pvcs.find(function (pvc) { return pvc.metadata.name === "datadir-".concat(podName); });
|
|
136
|
-
if (!thePvc) {
|
|
137
|
-
(0, log_1.logError)(this, "sorry, no pvc found for ".concat(podName));
|
|
138
|
-
return [2 /*return*/];
|
|
139
|
-
}
|
|
140
|
-
return [4 /*yield*/, this.prompt({
|
|
141
|
-
"default": true,
|
|
142
|
-
message: "THIS WILL DESTROY THE POD, ITS VOLUME AND ALL ITS DATA 🙀🙀🙀!!! continue? 🤔",
|
|
143
|
-
name: "shouldContinue",
|
|
144
|
-
type: "confirm"
|
|
145
|
-
})];
|
|
146
|
-
case 7:
|
|
147
|
-
shouldContinue = (_b.sent()).shouldContinue;
|
|
148
|
-
if (!shouldContinue) {
|
|
149
|
-
throw new Error("abort");
|
|
150
|
-
}
|
|
151
|
-
// force delete, see https://github.com/kubernetes/kubernetes/issues/77258#issuecomment-502209800
|
|
152
|
-
this.log("destroying volume...");
|
|
153
|
-
_b.label = 8;
|
|
154
|
-
case 8:
|
|
155
|
-
_b.trys.push([8, 10, , 11]);
|
|
156
|
-
return [4 /*yield*/, removeFinalizerAndDelete(namespace, "pv", thePvc.spec.volumeName)];
|
|
157
|
-
case 9:
|
|
158
|
-
_b.sent();
|
|
159
|
-
return [3 /*break*/, 11];
|
|
160
|
-
case 10:
|
|
161
|
-
e_1 = _b.sent();
|
|
162
|
-
this.log(e_1.message);
|
|
163
|
-
return [3 /*break*/, 11];
|
|
164
|
-
case 11:
|
|
165
|
-
this.log("destroying volume claim...");
|
|
166
|
-
_b.label = 12;
|
|
167
|
-
case 12:
|
|
168
|
-
_b.trys.push([12, 14, , 15]);
|
|
169
|
-
return [4 /*yield*/, removeFinalizerAndDelete(namespace, "pvc", thePvc.metadata.name)];
|
|
170
|
-
case 13:
|
|
171
|
-
_b.sent();
|
|
172
|
-
return [3 /*break*/, 15];
|
|
173
|
-
case 14:
|
|
174
|
-
e_2 = _b.sent();
|
|
175
|
-
this.log(e_2.message);
|
|
176
|
-
return [3 /*break*/, 15];
|
|
177
|
-
case 15:
|
|
178
|
-
this.log("destroying pod...");
|
|
179
|
-
return [4 /*yield*/, removeFinalizerAndDelete(namespace, "pod", podName)];
|
|
180
|
-
case 16:
|
|
181
|
-
_b.sent();
|
|
182
|
-
return [2 /*return*/];
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
})];
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}); });
|
|
190
|
-
//# sourceMappingURL=projectMongoDestroyMember.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectMongoDestroyMember.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/mongodb/projectMongoDestroyMember.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
exports.__esModule = true;
|
|
42
|
-
var log_1 = require("../../../../utils/log");
|
|
43
|
-
var projects_1 = require("../../../../utils/projects");
|
|
44
|
-
var autocompletions_1 = require("../project/utils/autocompletions");
|
|
45
|
-
var ensureCluster_1 = __importDefault(require("../project/utils/ensureCluster"));
|
|
46
|
-
var utils_1 = require("./utils");
|
|
47
|
-
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
|
-
var _a, _b;
|
|
49
|
-
return __generator(this, function (_c) {
|
|
50
|
-
switch (_c.label) {
|
|
51
|
-
case 0:
|
|
52
|
-
_b = (_a = vorpal
|
|
53
|
-
.command("project-mongo-get-shell <envComponent>", "get a shell to a mongodb in the environment"))
|
|
54
|
-
.autocomplete;
|
|
55
|
-
return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
|
|
56
|
-
case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])
|
|
57
|
-
.action(function (_a) {
|
|
58
|
-
var envComponent = _a.envComponent;
|
|
59
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
60
|
-
var namespace, podNames, podName;
|
|
61
|
-
return __generator(this, function (_b) {
|
|
62
|
-
switch (_b.label) {
|
|
63
|
-
case 0: return [4 /*yield*/, ensureCluster_1["default"].call(this, envComponent)];
|
|
64
|
-
case 1:
|
|
65
|
-
_b.sent();
|
|
66
|
-
return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
|
|
67
|
-
case 2:
|
|
68
|
-
namespace = _b.sent();
|
|
69
|
-
return [4 /*yield*/, (0, utils_1.getProjectMongodbAllPodsSortedWithLabel)(envComponent)];
|
|
70
|
-
case 3:
|
|
71
|
-
podNames = _b.sent();
|
|
72
|
-
if (podNames.length === 0) {
|
|
73
|
-
(0, log_1.logError)(this, "sorry, no pods found");
|
|
74
|
-
return [2 /*return*/];
|
|
75
|
-
}
|
|
76
|
-
if (!(podNames.length === 1)) return [3 /*break*/, 4];
|
|
77
|
-
podName = podNames[0];
|
|
78
|
-
return [3 /*break*/, 6];
|
|
79
|
-
case 4: return [4 /*yield*/, this.prompt({
|
|
80
|
-
type: "list",
|
|
81
|
-
name: "podName",
|
|
82
|
-
choices: podNames,
|
|
83
|
-
message: "Which pod? 🤔"
|
|
84
|
-
})];
|
|
85
|
-
case 5:
|
|
86
|
-
podName = (_b.sent()).podName;
|
|
87
|
-
_b.label = 6;
|
|
88
|
-
case 6: return [2 /*return*/, (0, utils_1.getMongodbShell)(namespace, podName)];
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
})];
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}); });
|
|
96
|
-
//# sourceMappingURL=projectMongoGetShell.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectMongoGetShell.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/mongodb/projectMongoGetShell.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAiD;AACjD,uDAAiE;AACjE,oEAAoE;AACpE,iFAA2D;AAC3D,iCAGiB;AAEjB,sBAAe,UAAO,MAAc;;;;;gBAClC,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CACN,wCAAwC,EACxC,6CAA6C,CAC9C,CAAA;qBACA,YAAY,CAAA;gBAAC,qBAAM,IAAA,kCAAgB,GAAE,EAAA;oBALxC,sBAAA,cAKgB,SAAwB,EAAC;qBACtC,MAAM,CAAC,UAAgB,EAAgB;wBAAd,YAAY,kBAAA;;;;;wCACpC,qBAAM,0BAAa,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAA;;oCAA5C,SAA4C,CAAC;oCAC3B,qBAAM,IAAA,8BAAmB,EAAC,YAAY,CAAC,EAAA;;oCAAnD,SAAS,GAAG,SAAuC;oCACxC,qBAAM,IAAA,+CAAuC,EAC5D,YAAY,CACb,EAAA;;oCAFK,QAAQ,GAAG,SAEhB;oCACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;wCACzB,IAAA,cAAQ,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;wCACvC,sBAAO;qCACR;yCAEG,CAAA,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAA,EAArB,wBAAqB;oCACvB,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;;wCAGpB,qBAAM,IAAI,CAAC,MAAM,CAAC;wCAChB,IAAI,EAAE,MAAM;wCACZ,IAAI,EAAE,SAAS;wCACf,OAAO,EAAE,QAAQ;wCACjB,OAAO,EAAE,eAAe;qCACzB,CAAC,EAAA;;oCANJ,OAAO,GAAG,CACR,SAKE,CACH,CAAC,OAAO,CAAC;;wCAGZ,sBAAO,IAAA,uBAAe,EAAC,SAAS,EAAE,OAAO,CAAC,EAAC;;;;iBAC5C,CAAC,EAAA;;;KAAA,EAAC"}
|