@catladder/cli 0.0.0-fix-error-sql-db-delete-a719775a → 0.0.0-fix-error-sql-db-delete-7bf85929
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/dist/apps/cli/commands/project/commandCloudSqlProxy.js +17 -61
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupContext.js +3 -10
- package/dist/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/bundles/catenv/index.js +59 -21
- package/dist/bundles/cli/index.js +79 -155
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +12 -42
- package/src/apps/cli/commands/project/setup/setupContext.ts +2 -5
- package/dist/apps/cli/commands/project/setup/setupCloudSQL.d.ts +0 -3
- package/dist/apps/cli/commands/project/setup/setupCloudSQL.js +0 -56
- package/dist/apps/cli/commands/project/setup/setupCloudSQL.js.map +0 -1
- package/src/apps/cli/commands/project/setup/setupCloudSQL.ts +0 -22
|
@@ -1453,20 +1453,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
1453
1453
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1454
1454
|
}
|
|
1455
1455
|
};
|
|
1456
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
1457
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1458
|
-
if (ar || !(i in from)) {
|
|
1459
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1460
|
-
ar[i] = from[i];
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1464
|
-
};
|
|
1465
1456
|
exports.__esModule = true;
|
|
1466
1457
|
var pipeline_1 = __nccwpck_require__(25355);
|
|
1458
|
+
var pipeline_2 = __nccwpck_require__(25355);
|
|
1467
1459
|
var child_process_promise_1 = __nccwpck_require__(75763);
|
|
1468
|
-
var fs_extra_1 = __nccwpck_require__(85501);
|
|
1469
|
-
var tmp_promise_1 = __nccwpck_require__(68841);
|
|
1470
1460
|
var getProjectConfig_1 = __nccwpck_require__(24146);
|
|
1471
1461
|
var autocompletions_1 = __nccwpck_require__(41373);
|
|
1472
1462
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1482,8 +1472,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1482
1472
|
.action(function (_a) {
|
|
1483
1473
|
var envComponent = _a.envComponent;
|
|
1484
1474
|
return __awaiter(this, void 0, void 0, function () {
|
|
1485
|
-
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, DB_USER, instanceName, localPort
|
|
1486
|
-
var _this = this;
|
|
1475
|
+
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, DB_USER, instanceName, localPort;
|
|
1487
1476
|
return __generator(this, function (_c) {
|
|
1488
1477
|
switch (_c.label) {
|
|
1489
1478
|
case 0:
|
|
@@ -1494,13 +1483,13 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1494
1483
|
if (env === "review") {
|
|
1495
1484
|
vorpal.log("⚠️ connection string does not include mr information on review environments");
|
|
1496
1485
|
}
|
|
1497
|
-
if (!(0,
|
|
1486
|
+
if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) return [3 /*break*/, 3];
|
|
1498
1487
|
return [4 /*yield*/, getProxyInfoForKubernetes(context)];
|
|
1499
1488
|
case 2:
|
|
1500
1489
|
proxyInfo = _c.sent();
|
|
1501
1490
|
return [3 /*break*/, 6];
|
|
1502
1491
|
case 3:
|
|
1503
|
-
if (!(0,
|
|
1492
|
+
if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun")) return [3 /*break*/, 5];
|
|
1504
1493
|
return [4 /*yield*/, getProxyInfoForCloudRun(context)];
|
|
1505
1494
|
case 4:
|
|
1506
1495
|
proxyInfo = _c.sent();
|
|
@@ -1521,37 +1510,11 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1521
1510
|
this.log("");
|
|
1522
1511
|
this.log("POSTGRESQL_URL=postgresql://".concat(DB_USER, ":").concat(DB_PASSWORD, "@localhost:").concat(localPort, "/").concat(DB_NAME, "?schema=public"));
|
|
1523
1512
|
this.log("");
|
|
1524
|
-
return [4 /*yield*/, (0,
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
return [4 /*yield*/, (0, tmp_promise_1.withFile)(function (_a) {
|
|
1528
|
-
var tmpFilePath = _a.path;
|
|
1529
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
1530
|
-
return __generator(this, function (_b) {
|
|
1531
|
-
switch (_b.label) {
|
|
1532
|
-
case 0:
|
|
1533
|
-
if (!cloudsqlProxyCredentials) return [3 /*break*/, 2];
|
|
1534
|
-
return [4 /*yield*/, (0, fs_extra_1.writeFile)(tmpFilePath, cloudsqlProxyCredentials)];
|
|
1535
|
-
case 1:
|
|
1536
|
-
_b.sent();
|
|
1537
|
-
_b.label = 2;
|
|
1538
|
-
case 2: return [4 /*yield*/, (0, child_process_promise_1.spawn)("cloud_sql_proxy", __spreadArray([
|
|
1539
|
-
"-instances",
|
|
1540
|
-
"".concat(instanceName, "=tcp:").concat(localPort)
|
|
1541
|
-
], (cloudsqlProxyCredentials
|
|
1542
|
-
? ["-credential_file", tmpFilePath]
|
|
1543
|
-
: []), true), {
|
|
1544
|
-
stdio: "inherit",
|
|
1545
|
-
shell: true
|
|
1546
|
-
})];
|
|
1547
|
-
case 3:
|
|
1548
|
-
_b.sent();
|
|
1549
|
-
return [2 /*return*/];
|
|
1550
|
-
}
|
|
1551
|
-
});
|
|
1552
|
-
});
|
|
1513
|
+
return [4 /*yield*/, (0, child_process_promise_1.spawn)("cloud_sql_proxy", ["-instances", "".concat(instanceName, "=tcp:").concat(localPort)], {
|
|
1514
|
+
stdio: "inherit",
|
|
1515
|
+
shell: true
|
|
1553
1516
|
})];
|
|
1554
|
-
case
|
|
1517
|
+
case 8:
|
|
1555
1518
|
_c.sent();
|
|
1556
1519
|
return [2 /*return*/];
|
|
1557
1520
|
}
|
|
@@ -1562,27 +1525,20 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1562
1525
|
});
|
|
1563
1526
|
}); });
|
|
1564
1527
|
var getProxyInfoForKubernetes = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1565
|
-
var envVars, DB_PASSWORD, DB_NAME,
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
switch (_e.label) {
|
|
1528
|
+
var envVars, cloudSqlValues, DB_PASSWORD, DB_NAME, instanceName;
|
|
1529
|
+
return __generator(this, function (_a) {
|
|
1530
|
+
switch (_a.label) {
|
|
1569
1531
|
case 0:
|
|
1570
|
-
if (!(0,
|
|
1532
|
+
if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
|
|
1571
1533
|
throw new Error("unsupported");
|
|
1572
1534
|
}
|
|
1573
1535
|
return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(this, context.environment.shortName, context.componentName)];
|
|
1574
1536
|
case 1:
|
|
1575
|
-
envVars =
|
|
1537
|
+
envVars = _a.sent();
|
|
1538
|
+
cloudSqlValues = (0, pipeline_1.createKubernetesCloudsqlBaseValues)(context);
|
|
1576
1539
|
DB_PASSWORD = (envVars === null || envVars === void 0 ? void 0 : envVars.DB_PASSWORD) || (envVars === null || envVars === void 0 ? void 0 : envVars.POSTGRESQL_PASSWORD);
|
|
1577
|
-
DB_NAME =
|
|
1578
|
-
|
|
1579
|
-
projectId = ((_a = values === null || values === void 0 ? void 0 : values.cloudsql) === null || _a === void 0 ? void 0 : _a.projectId) ||
|
|
1580
|
-
((_b = context.componentConfig.deploy.cluster) === null || _b === void 0 ? void 0 : _b.projectId);
|
|
1581
|
-
defaultInstanceId = "".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName, "-").concat(context.environment.shortName);
|
|
1582
|
-
instanceId = ((_c = values === null || values === void 0 ? void 0 : values.cloudsql) === null || _c === void 0 ? void 0 : _c.instanceId) || defaultInstanceId;
|
|
1583
|
-
defaultRegion = "europe-west6";
|
|
1584
|
-
region = ((_d = values === null || values === void 0 ? void 0 : values.cloudsql) === null || _d === void 0 ? void 0 : _d.region) || defaultRegion;
|
|
1585
|
-
instanceName = "".concat(projectId, ":").concat(region, ":").concat(instanceId);
|
|
1540
|
+
DB_NAME = cloudSqlValues.cloudsql.fullDbName;
|
|
1541
|
+
instanceName = cloudSqlValues.cloudsql.instanceConnectionName;
|
|
1586
1542
|
return [2 /*return*/, {
|
|
1587
1543
|
instanceName: instanceName,
|
|
1588
1544
|
DB_PASSWORD: DB_PASSWORD,
|
|
@@ -1597,7 +1553,7 @@ var getProxyInfoForCloudRun = function (context) { return __awaiter(void 0, void
|
|
|
1597
1553
|
return __generator(this, function (_a) {
|
|
1598
1554
|
switch (_a.label) {
|
|
1599
1555
|
case 0:
|
|
1600
|
-
if (!(0,
|
|
1556
|
+
if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun") ||
|
|
1601
1557
|
!context.componentConfig.deploy.cloudSql) {
|
|
1602
1558
|
throw new Error("unsupported");
|
|
1603
1559
|
}
|
|
@@ -4551,69 +4507,6 @@ exports.setupCloudRun = setupCloudRun;
|
|
|
4551
4507
|
|
|
4552
4508
|
/***/ }),
|
|
4553
4509
|
|
|
4554
|
-
/***/ 63660:
|
|
4555
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4556
|
-
|
|
4557
|
-
"use strict";
|
|
4558
|
-
|
|
4559
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4560
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4561
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4562
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
4563
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
4564
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
4565
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4566
|
-
});
|
|
4567
|
-
};
|
|
4568
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
4569
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4570
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
4571
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
4572
|
-
function step(op) {
|
|
4573
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
4574
|
-
while (_) try {
|
|
4575
|
-
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;
|
|
4576
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
4577
|
-
switch (op[0]) {
|
|
4578
|
-
case 0: case 1: t = op; break;
|
|
4579
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
4580
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
4581
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
4582
|
-
default:
|
|
4583
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
4584
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
4585
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
4586
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
4587
|
-
if (t[2]) _.ops.pop();
|
|
4588
|
-
_.trys.pop(); continue;
|
|
4589
|
-
}
|
|
4590
|
-
op = body.call(thisArg, _);
|
|
4591
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
4592
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
4593
|
-
}
|
|
4594
|
-
};
|
|
4595
|
-
exports.__esModule = true;
|
|
4596
|
-
exports.setupCloudSQL = void 0;
|
|
4597
|
-
var pipeline_1 = __nccwpck_require__(25355);
|
|
4598
|
-
var setupCloudSQL = function (instance, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4599
|
-
var config;
|
|
4600
|
-
return __generator(this, function (_a) {
|
|
4601
|
-
if (!(0, pipeline_1.hasKubernetesCloudSQL)(context)) {
|
|
4602
|
-
throw new Error("cannot setup cloudsql, as it has none");
|
|
4603
|
-
}
|
|
4604
|
-
config = (0, pipeline_1.getKubernetesCloudSQLConfig)(context);
|
|
4605
|
-
instance.log("");
|
|
4606
|
-
instance.log("! make sure to provide cloudsqlProxyCredentials for the cloud sql service account in " +
|
|
4607
|
-
config.projectId);
|
|
4608
|
-
instance.log("");
|
|
4609
|
-
return [2 /*return*/];
|
|
4610
|
-
});
|
|
4611
|
-
}); };
|
|
4612
|
-
exports.setupCloudSQL = setupCloudSQL;
|
|
4613
|
-
//# sourceMappingURL=setupCloudSQL.js.map
|
|
4614
|
-
|
|
4615
|
-
/***/ }),
|
|
4616
|
-
|
|
4617
4510
|
/***/ 40663:
|
|
4618
4511
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4619
4512
|
|
|
@@ -4659,7 +4552,6 @@ exports.__esModule = true;
|
|
|
4659
4552
|
exports.setupContext = void 0;
|
|
4660
4553
|
var pipeline_1 = __nccwpck_require__(25355);
|
|
4661
4554
|
var setupCloudRun_1 = __nccwpck_require__(89010);
|
|
4662
|
-
var setupCloudSQL_1 = __nccwpck_require__(63660);
|
|
4663
4555
|
var setupKubernetes_1 = __nccwpck_require__(82308);
|
|
4664
4556
|
var setupContext = function (instance, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4665
4557
|
var deployConfig;
|
|
@@ -4680,19 +4572,13 @@ var setupContext = function (instance, context) { return __awaiter(void 0, void
|
|
|
4680
4572
|
_a.sent();
|
|
4681
4573
|
_a.label = 2;
|
|
4682
4574
|
case 2:
|
|
4683
|
-
|
|
4684
|
-
|
|
4575
|
+
deployConfig = context.componentConfig.deploy;
|
|
4576
|
+
if (!(0, pipeline_1.isOfDeployType)(deployConfig, "kubernetes")) return [3 /*break*/, 4];
|
|
4577
|
+
return [4 /*yield*/, (0, setupKubernetes_1.setupKubernetes)(instance, context)];
|
|
4685
4578
|
case 3:
|
|
4686
4579
|
_a.sent();
|
|
4687
4580
|
_a.label = 4;
|
|
4688
4581
|
case 4:
|
|
4689
|
-
deployConfig = context.componentConfig.deploy;
|
|
4690
|
-
if (!(0, pipeline_1.isOfDeployType)(deployConfig, "kubernetes")) return [3 /*break*/, 6];
|
|
4691
|
-
return [4 /*yield*/, (0, setupKubernetes_1.setupKubernetes)(instance, context)];
|
|
4692
|
-
case 5:
|
|
4693
|
-
_a.sent();
|
|
4694
|
-
_a.label = 6;
|
|
4695
|
-
case 6:
|
|
4696
4582
|
instance.log("");
|
|
4697
4583
|
instance.log("✅ " +
|
|
4698
4584
|
context.environment.shortName +
|
|
@@ -351506,7 +351392,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
351506
351392
|
|
|
351507
351393
|
exports.__esModule = true;
|
|
351508
351394
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
351509
|
-
exports.PIPELINE_IMAGE_TAG = "fix-error-sql-db-delete-
|
|
351395
|
+
exports.PIPELINE_IMAGE_TAG = "fix-error-sql-db-delete-7bf85929" || 0;
|
|
351510
351396
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
351511
351397
|
|
|
351512
351398
|
/***/ }),
|
|
@@ -352944,20 +352830,21 @@ exports.__esModule = true;
|
|
|
352944
352830
|
exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
|
|
352945
352831
|
var context_1 = __nccwpck_require__(22041);
|
|
352946
352832
|
var gitlab_1 = __nccwpck_require__(84997);
|
|
352833
|
+
var utils_1 = __nccwpck_require__(70463);
|
|
352947
352834
|
var deployJob_1 = __nccwpck_require__(82256);
|
|
352948
352835
|
var jobName_1 = __nccwpck_require__(77311);
|
|
352949
352836
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
352950
352837
|
exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
|
|
352951
352838
|
var getCloudSqlVariables = function (_a) {
|
|
352952
|
-
var _b, _c
|
|
352839
|
+
var _b, _c;
|
|
352953
352840
|
var deployConfigRaw = _a.deployConfigRaw,
|
|
352954
352841
|
environmentSlugPrefix = _a.environmentSlugPrefix,
|
|
352955
352842
|
env = _a.env,
|
|
352956
352843
|
componentName = _a.componentName,
|
|
352957
352844
|
fullConfig = _a.fullConfig;
|
|
352958
352845
|
if (deployConfigRaw && deployConfigRaw.cloudSql) {
|
|
352959
|
-
var DB_NAME =
|
|
352960
|
-
var additionalQueryParamsString = Object.entries((
|
|
352846
|
+
var DB_NAME = (0, utils_1.getFullDbName)(deployConfigRaw.cloudSql, fullConfig, environmentSlugPrefix, componentName);
|
|
352847
|
+
var additionalQueryParamsString = Object.entries((_b = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
|
|
352961
352848
|
var _b = __read(_a, 2),
|
|
352962
352849
|
key = _b[0],
|
|
352963
352850
|
value = _b[1];
|
|
@@ -352966,7 +352853,7 @@ var getCloudSqlVariables = function (_a) {
|
|
|
352966
352853
|
return {
|
|
352967
352854
|
CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
|
|
352968
352855
|
DB_NAME: DB_NAME,
|
|
352969
|
-
DB_USER: (
|
|
352856
|
+
DB_USER: (_c = deployConfigRaw.cloudSql.dbUser) !== null && _c !== void 0 ? _c : "postgres",
|
|
352970
352857
|
DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
|
|
352971
352858
|
DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
|
|
352972
352859
|
DATABASE_JDBC_URL: "jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD".concat(additionalQueryParamsString)
|
|
@@ -353185,6 +353072,22 @@ exports.getCloudRunJobName = getCloudRunJobName;
|
|
|
353185
353072
|
|
|
353186
353073
|
/***/ }),
|
|
353187
353074
|
|
|
353075
|
+
/***/ 70463:
|
|
353076
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
353077
|
+
|
|
353078
|
+
"use strict";
|
|
353079
|
+
|
|
353080
|
+
|
|
353081
|
+
exports.__esModule = true;
|
|
353082
|
+
exports.getFullDbName = void 0;
|
|
353083
|
+
var getFullDbName = function (cloudSqlConfig, fullConfig, environmentSlugPrefix, componentName) {
|
|
353084
|
+
var _a, _b;
|
|
353085
|
+
return [(_a = cloudSqlConfig.dbNamePrefix) !== null && _a !== void 0 ? _a : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlugPrefix, (_b = cloudSqlConfig.dbBaseName) !== null && _b !== void 0 ? _b : componentName].filter(Boolean).join("-");
|
|
353086
|
+
};
|
|
353087
|
+
exports.getFullDbName = getFullDbName;
|
|
353088
|
+
|
|
353089
|
+
/***/ }),
|
|
353090
|
+
|
|
353188
353091
|
/***/ 16531:
|
|
353189
353092
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
353190
353093
|
|
|
@@ -353415,8 +353318,9 @@ exports.additionalKubernetesSecretKeys = additionalKubernetesSecretKeys;
|
|
|
353415
353318
|
|
|
353416
353319
|
|
|
353417
353320
|
exports.__esModule = true;
|
|
353418
|
-
exports.
|
|
353321
|
+
exports.createKubernetesCloudsqlBaseValues = exports.hasKubernetesCloudSQL = void 0;
|
|
353419
353322
|
var context_1 = __nccwpck_require__(22041);
|
|
353323
|
+
var utils_1 = __nccwpck_require__(70463);
|
|
353420
353324
|
var types_1 = __nccwpck_require__(63109);
|
|
353421
353325
|
var hasKubernetesCloudSQL = function (context) {
|
|
353422
353326
|
var _a, _b;
|
|
@@ -353426,22 +353330,42 @@ var hasKubernetesCloudSQL = function (context) {
|
|
|
353426
353330
|
return false;
|
|
353427
353331
|
};
|
|
353428
353332
|
exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
|
|
353429
|
-
var
|
|
353430
|
-
var _a;
|
|
353431
|
-
if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
|
|
353432
|
-
|
|
353333
|
+
var createKubernetesCloudsqlBaseValues = function (context) {
|
|
353334
|
+
var _a, _b, _c, _d, _e;
|
|
353335
|
+
if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
|
|
353336
|
+
throw new Error("cannot get cloud sql config");
|
|
353337
|
+
}
|
|
353338
|
+
var config = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql;
|
|
353339
|
+
if (!config) {
|
|
353340
|
+
throw new Error("cannot get cloud sql config");
|
|
353341
|
+
}
|
|
353342
|
+
var proxyCredentials = "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"));
|
|
353343
|
+
if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
|
|
353344
|
+
var instanceConnectionName = "".concat((_b = config.projectId) !== null && _b !== void 0 ? _b : "skynet-164509", ":").concat((_c = config.region) !== null && _c !== void 0 ? _c : "europe-west6", ":").concat((_d = config.instanceId) !== null && _d !== void 0 ? _d : context.environment.envVars.KUBE_NAMESPACE);
|
|
353345
|
+
return {
|
|
353346
|
+
cloudsql: {
|
|
353347
|
+
enabled: config.enabled,
|
|
353348
|
+
dbUser: "postgres",
|
|
353349
|
+
instanceConnectionName: instanceConnectionName,
|
|
353350
|
+
proxyCredentials: proxyCredentials,
|
|
353351
|
+
fullDbName: context.environment.envVars.KUBE_APP_NAME
|
|
353352
|
+
}
|
|
353353
|
+
};
|
|
353354
|
+
} else if (config.type === "unmanaged") {
|
|
353355
|
+
return {
|
|
353356
|
+
cloudsql: {
|
|
353357
|
+
enabled: config.enabled,
|
|
353358
|
+
dbUser: (_e = config.dbUser) !== null && _e !== void 0 ? _e : "postgres",
|
|
353359
|
+
instanceConnectionName: config.instanceConnectionName,
|
|
353360
|
+
proxyCredentials: proxyCredentials,
|
|
353361
|
+
fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.componentName)
|
|
353362
|
+
}
|
|
353363
|
+
};
|
|
353364
|
+
} else {
|
|
353365
|
+
throw new Error("unknonw type");
|
|
353433
353366
|
}
|
|
353434
|
-
throw new Error("cannot get cloud sql config");
|
|
353435
|
-
};
|
|
353436
|
-
exports.getKubernetesCloudSQLConfig = getKubernetesCloudSQLConfig;
|
|
353437
|
-
var createCloudsqlBaseConfig = function (context) {
|
|
353438
|
-
return {
|
|
353439
|
-
cloudsql: {
|
|
353440
|
-
proxyCredentials: "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"))
|
|
353441
|
-
}
|
|
353442
|
-
};
|
|
353443
353367
|
};
|
|
353444
|
-
exports.
|
|
353368
|
+
exports.createKubernetesCloudsqlBaseValues = createKubernetesCloudsqlBaseValues;
|
|
353445
353369
|
|
|
353446
353370
|
/***/ }),
|
|
353447
353371
|
|
|
@@ -353824,7 +353748,7 @@ var createKubeValues = function (context) {
|
|
|
353824
353748
|
var defaultKubeValues = (0, lodash_1.merge)({
|
|
353825
353749
|
env: env,
|
|
353826
353750
|
application: createAppConfig(context, application)
|
|
353827
|
-
}, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.
|
|
353751
|
+
}, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(context) : {}, ((_b = (_a = deployConfig.values) === null || _a === void 0 ? void 0 : _a.mongodb) === null || _b === void 0 ? void 0 : _b.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
|
|
353828
353752
|
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
353829
353753
|
jobs: removeFalsy(jobs),
|
|
353830
353754
|
cronjobs: removeFalsy(cronjobs)
|