@@ -81,6 +81,7 @@ func LoadPlugin(itOrm *gorm.DB, logger *zap.Logger, plugin platformspec.PluginSp
81
81
logger .Error ("failed to create integration binary" , zap .Error (err ))
82
82
return err
83
83
}
84
+ pluginBinary = nil
84
85
85
86
logger .Info ("integration binary created" )
86
87
@@ -106,8 +107,8 @@ func ExtractIntegrationBinaries(logger *zap.Logger, plugin platformspec.PluginSp
106
107
err = tagsJsonb .Set (tagsJsonData )
107
108
108
109
// download files from urls
109
- var integrationPlugin [] byte
110
- var cloudqlPlugin [] byte
110
+ binaries := & models. IntegrationPluginBinary {
111
+ PluginID : plugin . IntegrationType . String ()}
111
112
var describerURL , describerTags , demoDataUrl , url string
112
113
discoveryType := models .IntegrationPluginDiscoveryTypeClassic
113
114
installState := models .IntegrationTypeInstallStateNotInstalled
@@ -152,7 +153,7 @@ func ExtractIntegrationBinaries(logger *zap.Logger, plugin platformspec.PluginSp
152
153
discoveryType = models .IntegrationPluginDiscoveryTypeTask
153
154
}
154
155
logger .Info ("platform binary path" , zap .String ("path" , baseDir + "/integarion_type/" + plugin .Components .PlatformBinary .PathInArchive ))
155
- integrationPlugin , err = os .ReadFile (baseDir + "/integarion_type/" + plugin .Components .PlatformBinary .PathInArchive )
156
+ binaries . IntegrationPlugin , err = os .ReadFile (baseDir + "/integarion_type/" + plugin .Components .PlatformBinary .PathInArchive )
156
157
if err != nil {
157
158
logger .Error ("failed to open integration-plugin file" , zap .Error (err ), zap .String ("url" , plugin .Components .PlatformBinary .URI ))
158
159
return nil , nil , fmt .Errorf ("open integration-plugin file for url %s: %w" , plugin , err )
@@ -178,13 +179,15 @@ func ExtractIntegrationBinaries(logger *zap.Logger, plugin platformspec.PluginSp
178
179
}
179
180
180
181
logger .Info ("cloudql binary path" , zap .String ("path" , baseDir + "/integarion_type/" + plugin .Components .CloudQLBinary .PathInArchive ))
181
- cloudqlPlugin , err = os .ReadFile (baseDir + "/integarion_type/" + plugin .Components .CloudQLBinary .PathInArchive )
182
+ binaries . CloudQlPlugin , err = os .ReadFile (baseDir + "/integarion_type/" + plugin .Components .CloudQLBinary .PathInArchive )
182
183
if err != nil {
183
184
logger .Error ("failed to open cloudql-plugin file" , zap .Error (err ), zap .String ("url" , plugin .Components .CloudQLBinary .URI ))
184
185
return nil , nil , fmt .Errorf ("open cloudql-plugin file for url %s: %w" , plugin .IntegrationType .String (), err )
185
186
}
186
187
}
187
188
189
+ logger .Info ("integration binaries loaded" )
190
+
188
191
operationalStatusUpdates := pgtype.JSONB {}
189
192
operationalStatusUpdates .Set ("[]" )
190
193
@@ -205,9 +208,6 @@ func ExtractIntegrationBinaries(logger *zap.Logger, plugin platformspec.PluginSp
205
208
DescriberTag : describerTags ,
206
209
DiscoveryType : discoveryType ,
207
210
Tags : tagsJsonb ,
208
- }, & models.IntegrationPluginBinary {
209
- PluginID : plugin .IntegrationType .String (),
210
- IntegrationPlugin : integrationPlugin ,
211
- CloudQlPlugin : cloudqlPlugin },
211
+ }, binaries ,
212
212
nil
213
213
}
0 commit comments