@cloudbase/cli 2.6.0-alpha.4 → 2.6.0-alpha.5
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/lib/commands/fun/base.js +11 -4
- package/package.json +1 -1
package/lib/commands/fun/base.js
CHANGED
|
@@ -54,7 +54,6 @@ let FunListCommand = class FunListCommand extends common_1.Command {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
execute(envId, log) {
|
|
57
|
-
var _a;
|
|
58
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
58
|
const loading = (0, utils_1.loadingFactory)();
|
|
60
59
|
if (!envId) {
|
|
@@ -69,10 +68,13 @@ let FunListCommand = class FunListCommand extends common_1.Command {
|
|
|
69
68
|
.request('DescribeCloudBaseRunServers', {
|
|
70
69
|
EnvId: envId,
|
|
71
70
|
Limit: 100,
|
|
72
|
-
Offset: 0
|
|
71
|
+
Offset: 0,
|
|
72
|
+
Filter: {
|
|
73
|
+
Tag: 'function'
|
|
74
|
+
}
|
|
73
75
|
})
|
|
74
76
|
.finally(() => loading.stop());
|
|
75
|
-
const serverList =
|
|
77
|
+
const serverList = serverListRes.CloudBaseRunServerSet;
|
|
76
78
|
const head = ['服务名称', '状态', '创建时间', '更新时间'];
|
|
77
79
|
const tableData = serverList.map((serverItem) => [
|
|
78
80
|
serverItem.ServerName,
|
|
@@ -175,7 +177,7 @@ let FunDeployCommand = class FunDeployCommand extends common_1.Command {
|
|
|
175
177
|
Limit: 1,
|
|
176
178
|
Offset: 0
|
|
177
179
|
});
|
|
178
|
-
if (fetchSvrRes.ServerName && fetchSvrRes.
|
|
180
|
+
if (fetchSvrRes.ServerName && !_hasTag(fetchSvrRes.Tags, 'function')) {
|
|
179
181
|
log.error(`${serviceName} 服务已存在,但不是一个函数式托管服务,请使用另外的服务名称`);
|
|
180
182
|
return;
|
|
181
183
|
}
|
|
@@ -410,3 +412,8 @@ function _inputAppId(defaultVal = '') {
|
|
|
410
412
|
return answers['appId'];
|
|
411
413
|
});
|
|
412
414
|
}
|
|
415
|
+
function _hasTag(tagsStr, target) {
|
|
416
|
+
const tags = tagsStr.split(',');
|
|
417
|
+
const tag_list = tags.map((item) => item.split(':')[0]);
|
|
418
|
+
return tag_list.includes(target);
|
|
419
|
+
}
|