@geek-fun/serverlessinsight 0.6.14 → 0.6.15
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -579,9 +579,24 @@ const updateResource = async (context, fn, state) => {
|
|
|
579
579
|
};
|
|
580
580
|
}
|
|
581
581
|
const codePath = fn.code.path;
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
|
|
582
|
+
const currentCodeHash = existingState?.definition?.codeHash;
|
|
583
|
+
const desiredCodeHash = (0, common_1.computeFileHash)(codePath);
|
|
584
|
+
const codeChanged = currentCodeHash !== desiredCodeHash;
|
|
585
|
+
const existingConfig = existingState?.definition;
|
|
586
|
+
const desiredDefinition = (0, fc3Types_1.extractFc3Definition)(config, desiredCodeHash);
|
|
587
|
+
const { codeHash: _existingCodeHash, ...existingConfigOnly } = existingConfig || {};
|
|
588
|
+
const { codeHash: _desiredCodeHash, ...desiredConfigOnly } = desiredDefinition;
|
|
589
|
+
const configChanged = !(0, common_1.attributesEqual)(existingConfigOnly, desiredConfigOnly);
|
|
590
|
+
if (configChanged) {
|
|
591
|
+
await client.fc3.updateFunctionConfiguration(config);
|
|
592
|
+
}
|
|
593
|
+
if (codeChanged) {
|
|
594
|
+
const ossCode = await ensureOssCodeUpload(client, codePath, context.region, fn.name);
|
|
595
|
+
await client.fc3.updateFunctionCode(fn.name, codePath, ossCode);
|
|
596
|
+
}
|
|
597
|
+
if (!configChanged && !codeChanged) {
|
|
598
|
+
logger_1.logger.warn(lang_1.lang.__('UPDATING_RESOURCE_WITH_NO_CHANGES', { resourceType: 'function', name: fn.name }));
|
|
599
|
+
}
|
|
585
600
|
const functionInfo = await client.fc3.getFunction(fn.name);
|
|
586
601
|
if (!functionInfo) {
|
|
587
602
|
throw new Error(`Failed to refresh state for function: ${fn.name}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|