Skip to content

Commit 8b21ae3

Browse files
Arta AsadiArta Asadi
Arta Asadi
authored and
Arta Asadi
committed
fix: add more logs
1 parent 3e9826a commit 8b21ae3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

jobs/post-install-job/job/migrations/plugins/migrator.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"github.com/opengovern/og-util/pkg/postgres"
77
"github.com/opengovern/opensecurity/jobs/post-install-job/config"
8-
"github.com/opengovern/opensecurity/jobs/post-install-job/db"
98
"github.com/opengovern/opensecurity/services/integration/models"
109
"github.com/opengovern/opensecurity/services/integration/utils"
1110
"go.uber.org/zap"
@@ -37,9 +36,8 @@ func (m Migration) Run(ctx context.Context, conf config.MigratorConfig, logger *
3736
if err != nil {
3837
return fmt.Errorf("new postgres client: %w", err)
3938
}
40-
dbm := db.Database{ORM: orm}
4139

42-
err = dbm.ORM.AutoMigrate(&models.IntegrationPlugin{}, &models.IntegrationPluginBinary{})
40+
err = orm.AutoMigrate(&models.IntegrationPlugin{}, &models.IntegrationPluginBinary{})
4341
if err != nil {
4442
logger.Error("failed to auto migrate integration binaries", zap.Error(err))
4543
return err
@@ -56,14 +54,15 @@ func (m Migration) Run(ctx context.Context, conf config.MigratorConfig, logger *
5654
if err != nil {
5755
return err
5856
}
57+
logger.Info(fmt.Sprintf("migrated plugin: %s", path))
5958
}
6059

6160
return nil
6261
})
63-
6462
if err != nil {
6563
return err
6664
}
65+
logger.Info(fmt.Sprintf("plugins migrated"))
6766

6867
return nil
6968
}

services/integration/utils/load-plugin.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ func LoadPlugin(itOrm *gorm.DB, logger *zap.Logger, plugin platformspec.PluginSp
8282
return err
8383
}
8484

85+
logger.Info("integration binary created")
86+
8587
return nil
8688
}
8789

0 commit comments

Comments
 (0)