Skip to content

Commit 98e62ee

Browse files
committed
review changes
1 parent 3f2e3d8 commit 98e62ee

File tree

15 files changed

+82
-65
lines changed

15 files changed

+82
-65
lines changed

internal/sql/repository/chartConfig/EnvConfigOverrideRepository.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type EnvConfigOverrideRepository interface {
6565
GetEnvConfigByChartId(chartId int) ([]EnvConfigOverride, error)
6666
UpdateEnvConfigStatus(config *EnvConfigOverride) error
6767
Delete(envConfigOverride *EnvConfigOverride) error
68-
FindLatestChartForAppByAppIdAndEnvId(appId, targetEnvironmentId int) (*EnvConfigOverride, error)
68+
FindLatestChartForAppByAppIdAndEnvId(tx *pg.Tx, appId, targetEnvironmentId int) (*EnvConfigOverride, error)
6969
FindChartRefIdsForLatestChartForAppByAppIdAndEnvIds(appId int, targetEnvironmentIds []int) (map[int]int, error)
7070
FindChartByAppIdAndEnvIdAndChartRefId(appId, targetEnvironmentId int, chartRefId int) (*EnvConfigOverride, error)
7171
Update(tx *pg.Tx, envConfigOverride *EnvConfigOverride) (*EnvConfigOverride, error)
@@ -279,9 +279,14 @@ func (r EnvConfigOverrideRepositoryImpl) Delete(envConfigOverride *EnvConfigOver
279279
return err
280280
}
281281

282-
func (r EnvConfigOverrideRepositoryImpl) FindLatestChartForAppByAppIdAndEnvId(appId, targetEnvironmentId int) (*EnvConfigOverride, error) {
282+
func (r EnvConfigOverrideRepositoryImpl) FindLatestChartForAppByAppIdAndEnvId(tx *pg.Tx, appId, targetEnvironmentId int) (*EnvConfigOverride, error) {
283283
eco := &EnvConfigOverride{}
284-
err := r.dbConnection.
284+
var connection orm.DB
285+
connection = tx
286+
if tx == nil {
287+
connection = r.dbConnection
288+
}
289+
err := connection.
285290
Model(eco).
286291
Where("env_config_override.target_environment = ?", targetEnvironmentId).
287292
Where("env_config_override.latest = ?", true).

pkg/app/AppListingService.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ func (impl AppListingServiceImpl) FetchOtherEnvironment(ctx context.Context, app
760760
return envs, err
761761
}
762762
newCtx, span = otel.Tracer("chartRepository").Start(newCtx, "FindLatestChartForAppByAppId")
763-
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(appId)
763+
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(nil, appId)
764764
span.End()
765765
if err != nil && err != pg.ErrNoRows {
766766
impl.Logger.Errorw("error in fetching latest chart", "err", err)
@@ -781,7 +781,7 @@ func (impl AppListingServiceImpl) FetchOtherEnvironment(ctx context.Context, app
781781
}
782782
for _, env := range envs {
783783
newCtx, span = otel.Tracer("envOverrideRepository").Start(newCtx, "FindLatestChartForAppByAppIdAndEnvId")
784-
envOverride, err := impl.envConfigOverrideReadService.FindLatestChartForAppByAppIdAndEnvId(appId, env.EnvironmentId)
784+
envOverride, err := impl.envConfigOverrideReadService.FindLatestChartForAppByAppIdAndEnvId(nil, appId, env.EnvironmentId)
785785
span.End()
786786
if err != nil && !errors2.IsNotFound(err) {
787787
impl.Logger.Errorw("error in fetching latest chart by appId and envId", "err", err, "appId", appId, "envId", env.EnvironmentId)

pkg/chart/ChartService.go

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (impl *ChartServiceImpl) Create(templateRequest bean3.TemplateRequest, ctx
175175
}
176176

177177
// STARTS
178-
currentLatestChart, err := impl.chartRepository.FindLatestChartForAppByAppId(templateRequest.AppId)
178+
currentLatestChart, err := impl.chartRepository.FindLatestChartForAppByAppId(nil, templateRequest.AppId)
179179
if err != nil && pg.ErrNoRows != err {
180180
return nil, err
181181
}
@@ -335,26 +335,14 @@ func (impl *ChartServiceImpl) UpdateExistingChartsToLatestFalse(tx *pg.Tx, templ
335335

336336
impl.logger.Debug("updating all other charts which are not latest but may be set previous true, setting previous=false")
337337
//step 2
338-
noLatestCharts, dbErr := impl.chartRepository.FindNoLatestChartForAppByAppId(templateRequest.AppId)
339-
if dbErr != nil && !util.IsErrNoRows(dbErr) {
340-
impl.logger.Errorw("error in getting non-latest charts", "appId", templateRequest.AppId, "err", dbErr)
341-
return dbErr
342-
}
343-
var updatedCharts []*chartRepoRepository.Chart
344-
for _, noLatestChart := range noLatestCharts {
345-
if noLatestChart.Id != templateRequest.Id {
346-
noLatestChart.Latest = false // these are already false by d way
347-
noLatestChart.Previous = false
348-
noLatestChart.UpdateAuditLog(templateRequest.UserId)
349-
updatedCharts = append(updatedCharts, noLatestChart)
350-
}
351-
}
352-
err := impl.chartRepository.UpdateAllInTx(tx, updatedCharts)
338+
_, err := impl.chartRepository.UpdateNoLatestChartForAppByAppId(tx, templateRequest.AppId, templateRequest.Id, templateRequest.UserId)
353339
if err != nil {
340+
impl.logger.Errorw("error in updating non-latest charts", "appId", templateRequest.AppId, "chartId", templateRequest.Id, "err", err)
354341
return err
355342
}
343+
356344
impl.logger.Debug("now going to update latest entry in db to false and previous flag = true")
357-
// now finally update latest entry in db to false and previous true
345+
// now finally update the latest entry in db to false and previous true
358346
currentLatestChart.Latest = false // these are already false by d way
359347
currentLatestChart.Previous = true
360348
currentLatestChart.UpdateAuditLog(templateRequest.UserId)
@@ -442,7 +430,7 @@ func (impl *ChartServiceImpl) CreateChartFromEnvOverride(ctx context.Context, te
442430
return nil, err
443431
}
444432

445-
currentLatestChart, err := impl.chartRepository.FindLatestChartForAppByAppId(templateRequest.AppId)
433+
currentLatestChart, err := impl.chartRepository.FindLatestChartForAppByAppId(nil, templateRequest.AppId)
446434
if err != nil && pg.ErrNoRows != err {
447435
return nil, err
448436
}
@@ -634,7 +622,7 @@ func (impl *ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateReq
634622

635623
// STARTS
636624
_, span = otel.Tracer("orchestrator").Start(newCtx, "chartRepository.FindLatestChartForAppByAppId")
637-
currentLatestChart, err := impl.chartRepository.FindLatestChartForAppByAppId(templateRequest.AppId)
625+
currentLatestChart, err := impl.chartRepository.FindLatestChartForAppByAppId(nil, templateRequest.AppId)
638626
span.End()
639627
if err != nil {
640628
return nil, err
@@ -799,14 +787,14 @@ func (impl *ChartServiceImpl) ChartRefAutocompleteForAppOrEnv(appId int, envId i
799787
impl.logger.Errorw("error, ChartRefAutocompleteGlobalData", "err", err)
800788
return nil, err
801789
}
802-
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(appId)
790+
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(nil, appId)
803791
if err != nil && err != pg.ErrNoRows {
804792
impl.logger.Errorw("error in fetching latest chart", "err", err)
805793
return chartRefResponse, err
806794
}
807795
chartRefResponse.LatestAppChartRef = chart.ChartRefId
808796
if envId > 0 {
809-
envOverride, err := impl.envConfigOverrideReadService.FindLatestChartForAppByAppIdAndEnvId(appId, envId)
797+
envOverride, err := impl.envConfigOverrideReadService.FindLatestChartForAppByAppIdAndEnvId(nil, appId, envId)
810798
if err != nil && !errors.IsNotFound(err) {
811799
impl.logger.Errorw("error in fetching latest chart", "err", err)
812800
return chartRefResponse, err
@@ -959,7 +947,7 @@ func (impl *ChartServiceImpl) UpgradeForApp(appId int, chartRefId int, newAppOve
959947
}
960948

961949
func (impl *ChartServiceImpl) CheckIfChartRefUserUploadedByAppId(id int) (bool, error) {
962-
chartInfo, err := impl.chartRepository.FindLatestChartForAppByAppId(id)
950+
chartInfo, err := impl.chartRepository.FindLatestChartForAppByAppId(nil, id)
963951
if err != nil {
964952
return false, err
965953
}

pkg/chart/read/ChartReadService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (impl *ChartReadServiceImpl) IsGitOpsRepoConfiguredForDevtronApps(appIds []
9191
}
9292

9393
func (impl *ChartReadServiceImpl) FindLatestChartForAppByAppId(appId int) (chartTemplate *bean.TemplateRequest, err error) {
94-
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(appId)
94+
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(nil, appId)
9595
if err != nil {
9696
impl.logger.Errorw("error in fetching chart ", "appId", appId, "err", err)
9797
return nil, err

pkg/chartRepo/repository/ChartsRepository.go

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/devtron-labs/devtron/pkg/sql"
2222
"github.com/go-pg/pg"
2323
"github.com/go-pg/pg/orm"
24+
"time"
2425
)
2526

2627
type Chart struct {
@@ -65,11 +66,12 @@ type ChartRepository interface {
6566
UpdateAllInTx(tx *pg.Tx, charts []*Chart) error
6667

6768
FindActiveChartsByAppId(appId int) (charts []*Chart, err error)
68-
FindLatestChartForAppByAppId(appId int) (chart *Chart, err error)
69+
FindLatestChartForAppByAppId(tx *pg.Tx, appId int) (chart *Chart, err error)
6970
FindLatestChartByAppIds(appId []int) (chart []*Chart, err error)
7071
FindChartRefIdForLatestChartForAppByAppId(appId int) (int, error)
7172
FindChartByAppIdAndRefId(appId int, chartRefId int) (chart *Chart, err error)
7273
FindNoLatestChartForAppByAppId(appId int) ([]*Chart, error)
74+
UpdateNoLatestChartForAppByAppId(tx *pg.Tx, appId, chartId int, updatedBy int32) ([]*Chart, error)
7375
FindPreviousChartByAppId(appId int) (chart *Chart, err error)
7476
FindNumberOfAppsWithDeploymentTemplate(appIds []int) (int, error)
7577
FindChartByGitRepoUrl(gitRepoUrl string) (*Chart, error)
@@ -142,9 +144,14 @@ func (repositoryImpl ChartRepositoryImpl) FindActiveChartsByAppId(appId int) (ch
142144
return activeCharts, err
143145
}
144146

145-
func (repositoryImpl ChartRepositoryImpl) FindLatestChartForAppByAppId(appId int) (chart *Chart, err error) {
147+
func (repositoryImpl ChartRepositoryImpl) FindLatestChartForAppByAppId(tx *pg.Tx, appId int) (chart *Chart, err error) {
148+
var connection orm.DB
149+
connection = tx
150+
if tx == nil {
151+
connection = repositoryImpl.dbConnection
152+
}
146153
chart = &Chart{}
147-
err = repositoryImpl.dbConnection.
154+
err = connection.
148155
Model(chart).
149156
Where("app_id= ?", appId).
150157
Where("latest= ?", true).
@@ -195,6 +202,21 @@ func (repositoryImpl ChartRepositoryImpl) FindNoLatestChartForAppByAppId(appId i
195202
return charts, err
196203
}
197204

205+
func (repositoryImpl ChartRepositoryImpl) UpdateNoLatestChartForAppByAppId(tx *pg.Tx, appId, chartId int, updatedBy int32) ([]*Chart, error) {
206+
var charts []*Chart
207+
_, err := tx.
208+
Model(&charts).
209+
Set("latest = ? ", false).
210+
Set("previous = ? ", false).
211+
Set("updated_on = ? ", time.Now()).
212+
Set("updated_by = ? ", updatedBy).
213+
Where("app_id = ?", appId).
214+
Where("latest = ?", false).
215+
Where("id != ?", chartId).
216+
Update()
217+
return charts, err
218+
}
219+
198220
func (repositoryImpl ChartRepositoryImpl) FindLatestChartForAppByAppIdAndEnvId(appId int, envId int) (chart *Chart, err error) {
199221
chart = &Chart{}
200222
err = repositoryImpl.dbConnection.

pkg/commonService/CommonService.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (impl *CommonServiceImpl) FetchLatestChartVersion(appId int, envId int) (st
9292
}
9393
//if chart is overrides in env, and not mark as overrides in db, it means it was not completed and refer to latest to the app.
9494
if (envOverride.Id == 0) || (envOverride.Id > 0 && !envOverride.IsOverride) {
95-
chart, err = impl.chartRepository.FindLatestChartForAppByAppId(appId)
95+
chart, err = impl.chartRepository.FindLatestChartForAppByAppId(nil, appId)
9696
if err != nil {
9797
return "", err
9898
}
@@ -101,7 +101,7 @@ func (impl *CommonServiceImpl) FetchLatestChartVersion(appId int, envId int) (st
101101
chart = envOverride.Chart
102102
}
103103
} else if appId > 0 {
104-
chartG, err := impl.chartRepository.FindLatestChartForAppByAppId(appId)
104+
chartG, err := impl.chartRepository.FindLatestChartForAppByAppId(nil, appId)
105105
if err != nil {
106106
return "", err
107107
}

pkg/config/configDiff/DeploymentConfigurationService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ func (impl *DeploymentConfigurationServiceImpl) getRefChartBytes(ctx context.Con
480480
func (impl *DeploymentConfigurationServiceImpl) getConfiguredChartRef(envId int, appId int) (int, error) {
481481
var chartRefId int
482482
if envId > 0 {
483-
envOverride, err := impl.envConfigOverrideService.FindLatestChartForAppByAppIdAndEnvId(appId, envId)
483+
envOverride, err := impl.envConfigOverrideService.FindLatestChartForAppByAppIdAndEnvId(nil, appId, envId)
484484
if err != nil && !errors.IsNotFound(err) {
485485
impl.logger.Errorw("error in fetching latest chart", "err", err)
486486
return 0, nil

pkg/deployment/common/read/deploymentConfigReadService.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type DeploymentConfigReadService interface {
3030

3131
GetDeploymentConfigForApp(tx *pg.Tx, appId int) (*bean.DeploymentConfig, bool, error)
3232
GetDeploymentConfigForAppAndEnv(tx *pg.Tx, appLevelConfig *bean.DeploymentConfig, appId, envId int) (*bean.DeploymentConfig, bool, error)
33-
ParseEnvLevelReleaseConfigForDevtronApp(config *bean.DeploymentConfig, appId int, envId int) (*bean.ReleaseConfiguration, error)
33+
ParseEnvLevelReleaseConfigForDevtronApp(tx *pg.Tx, config *bean.DeploymentConfig, appId int, envId int) (*bean.ReleaseConfiguration, error)
3434
}
3535

3636
type DeploymentConfigReadServiceImpl struct {
@@ -130,7 +130,7 @@ func (impl *DeploymentConfigReadServiceImpl) GetDeploymentConfigForApp(tx *pg.Tx
130130
return appLevelConfig, isMigrationNeeded, err
131131
} else if interalUtil.IsErrNoRows(err) {
132132
isMigrationNeeded = true
133-
appLevelConfig, err = impl.parseAppLevelMigrationDataForDevtronApps(appId)
133+
appLevelConfig, err = impl.parseAppLevelMigrationDataForDevtronApps(tx, appId)
134134
if err != nil {
135135
impl.logger.Errorw("error in migrating app level config to deployment config", "appId", appId, "err", err)
136136
return appLevelConfig, isMigrationNeeded, err
@@ -143,7 +143,7 @@ func (impl *DeploymentConfigReadServiceImpl) GetDeploymentConfigForApp(tx *pg.Tx
143143
}
144144
if appLevelConfig.ReleaseConfiguration == nil || len(appLevelConfig.ReleaseConfiguration.Version) == 0 {
145145
isMigrationNeeded = true
146-
releaseConfig, err := impl.parseAppLevelReleaseConfigForDevtronApp(appId, appLevelConfig)
146+
releaseConfig, err := impl.parseAppLevelReleaseConfigForDevtronApp(tx, appId, appLevelConfig)
147147
if err != nil {
148148
impl.logger.Errorw("error in parsing release configuration for app", "appId", appId, "err", err)
149149
return appLevelConfig, isMigrationNeeded, err
@@ -165,7 +165,7 @@ func (impl *DeploymentConfigReadServiceImpl) GetDeploymentConfigForAppAndEnv(tx
165165
return envLevelConfig, isMigrationNeeded, err
166166
} else if interalUtil.IsErrNoRows(err) {
167167
// case: deployment config data is not yet migrated
168-
envLevelConfig, err = impl.parseEnvLevelMigrationDataForDevtronApps(appLevelConfig, appId, envId)
168+
envLevelConfig, err = impl.parseEnvLevelMigrationDataForDevtronApps(tx, appLevelConfig, appId, envId)
169169
if err != nil {
170170
impl.logger.Errorw("error in parsing env level config to deployment config", "appId", appId, "envId", envId, "err", err)
171171
return envLevelConfig, isMigrationNeeded, err
@@ -180,7 +180,7 @@ func (impl *DeploymentConfigReadServiceImpl) GetDeploymentConfigForAppAndEnv(tx
180180
// case: deployment config is migrated; but release config is absent.
181181
if envLevelConfig.ReleaseConfiguration == nil || len(envLevelConfig.ReleaseConfiguration.Version) == 0 {
182182
isMigrationNeeded = true
183-
releaseConfig, err := impl.ParseEnvLevelReleaseConfigForDevtronApp(envLevelConfig, appId, envId)
183+
releaseConfig, err := impl.ParseEnvLevelReleaseConfigForDevtronApp(tx, envLevelConfig, appId, envId)
184184
if err != nil {
185185
impl.logger.Errorw("error in parsing env level release config", "appId", appId, "envId", envId, "err", err)
186186
return envLevelConfig, isMigrationNeeded, err
@@ -257,7 +257,7 @@ func (impl *DeploymentConfigReadServiceImpl) configureEnvURLByAppURLIfNotConfigu
257257
return appAndEnvLevelConfig, isRepoUrlUpdated, nil
258258
}
259259

260-
func (impl *DeploymentConfigReadServiceImpl) parseEnvLevelMigrationDataForDevtronApps(appLevelConfig *bean.DeploymentConfig, appId, envId int) (*bean.DeploymentConfig, error) {
260+
func (impl *DeploymentConfigReadServiceImpl) parseEnvLevelMigrationDataForDevtronApps(tx *pg.Tx, appLevelConfig *bean.DeploymentConfig, appId, envId int) (*bean.DeploymentConfig, error) {
261261
/*
262262
We can safely assume that no link argoCD pipeline is created if migration is happening
263263
migration case, default values for below fields will be =>
@@ -284,7 +284,7 @@ func (impl *DeploymentConfigReadServiceImpl) parseEnvLevelMigrationDataForDevtro
284284
}
285285
config.DeploymentAppType = deploymentAppType
286286

287-
releaseConfig, err := impl.ParseEnvLevelReleaseConfigForDevtronApp(config, appId, envId)
287+
releaseConfig, err := impl.ParseEnvLevelReleaseConfigForDevtronApp(tx, config, appId, envId)
288288
if err != nil {
289289
impl.logger.Errorw("error in parsing env level release config", "appId", appId, "envId", envId, "err", err)
290290
return nil, err
@@ -327,18 +327,18 @@ func (impl *DeploymentConfigReadServiceImpl) getConfigMetaDataForAppAndEnv(appId
327327
return environmentId, deploymentAppName, namespace, nil
328328
}
329329

330-
func (impl *DeploymentConfigReadServiceImpl) ParseEnvLevelReleaseConfigForDevtronApp(config *bean.DeploymentConfig, appId int, envId int) (*bean.ReleaseConfiguration, error) {
330+
func (impl *DeploymentConfigReadServiceImpl) ParseEnvLevelReleaseConfigForDevtronApp(tx *pg.Tx, config *bean.DeploymentConfig, appId int, envId int) (*bean.ReleaseConfiguration, error) {
331331
releaseConfig := &bean.ReleaseConfiguration{}
332332
if config.DeploymentAppType == interalUtil.PIPELINE_DEPLOYMENT_TYPE_ACD {
333333
releaseConfig.Version = bean.Version
334-
envOverride, err := impl.envConfigOverrideService.FindLatestChartForAppByAppIdAndEnvId(appId, envId)
334+
envOverride, err := impl.envConfigOverrideService.FindLatestChartForAppByAppIdAndEnvId(tx, appId, envId)
335335
if err != nil && !errors.IsNotFound(err) {
336336
impl.logger.Errorw("error in fetch")
337337
return nil, err
338338
}
339339
var latestChart *chartRepoRepository.Chart
340340
if !envOverride.IsOverridden() {
341-
latestChart, err = impl.chartRepository.FindLatestChartForAppByAppId(appId)
341+
latestChart, err = impl.chartRepository.FindLatestChartForAppByAppId(tx, appId)
342342
if err != nil {
343343
return nil, err
344344
}
@@ -380,8 +380,8 @@ func (impl *DeploymentConfigReadServiceImpl) ParseEnvLevelReleaseConfigForDevtro
380380
return releaseConfig, nil
381381
}
382382

383-
func (impl *DeploymentConfigReadServiceImpl) parseAppLevelMigrationDataForDevtronApps(appId int) (*bean.DeploymentConfig, error) {
384-
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(appId)
383+
func (impl *DeploymentConfigReadServiceImpl) parseAppLevelMigrationDataForDevtronApps(tx *pg.Tx, appId int) (*bean.DeploymentConfig, error) {
384+
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(tx, appId)
385385
if err != nil {
386386
return nil, err
387387
}
@@ -398,8 +398,8 @@ func (impl *DeploymentConfigReadServiceImpl) parseAppLevelMigrationDataForDevtro
398398
return config, nil
399399
}
400400

401-
func (impl *DeploymentConfigReadServiceImpl) parseAppLevelReleaseConfigForDevtronApp(appId int, appLevelConfig *bean.DeploymentConfig) (*bean.ReleaseConfiguration, error) {
402-
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(appId)
401+
func (impl *DeploymentConfigReadServiceImpl) parseAppLevelReleaseConfigForDevtronApp(tx *pg.Tx, appId int, appLevelConfig *bean.DeploymentConfig) (*bean.ReleaseConfiguration, error) {
402+
chart, err := impl.chartRepository.FindLatestChartForAppByAppId(tx, appId)
403403
if err != nil {
404404
return nil, err
405405
}
@@ -408,6 +408,7 @@ func (impl *DeploymentConfigReadServiceImpl) parseAppLevelReleaseConfigForDevtro
408408
if len(appLevelConfig.RepoURL) > 0 {
409409
repoURL = appLevelConfig.RepoURL
410410
}
411+
411412
chartLocation := filepath.Join(chart.ReferenceTemplate, chart.ChartVersion)
412413
releaseConfig := adapter.NewAppLevelReleaseConfigFromChart(repoURL, chartLocation)
413414
return releaseConfig, nil

pkg/deployment/manifest/ManifestCreationService.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func (impl *ManifestCreationServiceImpl) getEnvOverrideForLastSavedConfigTrigger
432432
}
433433
if envOverride.Id == 0 {
434434
_, span = otel.Tracer("orchestrator").Start(ctx, "chartRepository.FindLatestChartForAppByAppId")
435-
chart, err = impl.chartRepository.FindLatestChartForAppByAppId(overrideRequest.AppId)
435+
chart, err = impl.chartRepository.FindLatestChartForAppByAppId(nil, overrideRequest.AppId)
436436
span.End()
437437
if err != nil {
438438
impl.logger.Errorw("invalid state", "err", err, "req", overrideRequest)
@@ -480,7 +480,7 @@ func (impl *ManifestCreationServiceImpl) getEnvOverrideForLastSavedConfigTrigger
480480
envOverride.Chart = chart
481481
} else if envOverride.Id > 0 && !envOverride.IsOverride {
482482
_, span = otel.Tracer("orchestrator").Start(ctx, "chartRepository.FindLatestChartForAppByAppId")
483-
chart, err = impl.chartRepository.FindLatestChartForAppByAppId(overrideRequest.AppId)
483+
chart, err = impl.chartRepository.FindLatestChartForAppByAppId(nil, overrideRequest.AppId)
484484
span.End()
485485
if err != nil {
486486
impl.logger.Errorw("invalid state", "err", err, "req", overrideRequest)

0 commit comments

Comments
 (0)