瀏覽代碼

fix: hardcoded aws lambda runtime

Yeuoly 8 月之前
父節點
當前提交
991329bd65
共有 1 個文件被更改,包括 12 次插入1 次删除
  1. 12 1
      internal/service/install_plugin.go

+ 12 - 1
internal/service/install_plugin.go

@@ -271,10 +271,21 @@ func InstallPluginFromIdentifiers(
 		plugin_unique_identifier plugin_entities.PluginUniqueIdentifier,
 		declaration *plugin_entities.PluginDeclaration,
 	) error {
+		runtime_type := plugin_entities.PluginRuntimeType("")
+
+		switch config.Platform {
+		case app.PLATFORM_AWS_LAMBDA:
+			runtime_type = plugin_entities.PLUGIN_RUNTIME_TYPE_AWS
+		case app.PLATFORM_LOCAL:
+			runtime_type = plugin_entities.PLUGIN_RUNTIME_TYPE_LOCAL
+		default:
+			return fmt.Errorf("unsupported platform: %s", config.Platform)
+		}
+
 		_, _, err := curd.InstallPlugin(
 			tenant_id,
 			plugin_unique_identifier,
-			plugin_entities.PLUGIN_RUNTIME_TYPE_AWS,
+			runtime_type,
 			declaration,
 			source,
 			meta,