Skip to content

Commit 489c992

Browse files
committed
fix: reordered updateChartLocationForEnvironmentConfigs func
1 parent b3e3adc commit 489c992

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/chart/ChartService.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,6 @@ func (impl *ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateReq
688688
return nil, err
689689
}
690690

691-
if currentLatestChart.Id != 0 && currentLatestChart.Id != templateRequest.Id {
692-
err = impl.updateChartLocationForEnvironmentConfigs(newCtx, templateRequest.AppId, templateRequest.ChartRefId, templateRequest.UserId, template.ChartVersion)
693-
if err != nil {
694-
impl.logger.Errorw("error in updating chart location in env overrides", "appId", templateRequest.AppId, "err", err)
695-
return nil, err
696-
}
697-
}
698-
699691
config, err := impl.deploymentConfigService.GetConfigForDevtronApps(template.AppId, 0)
700692
if err != nil {
701693
impl.logger.Errorw("error in fetching config", "appId", template.AppId, "err", err)
@@ -727,6 +719,14 @@ func (impl *ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateReq
727719
return nil, err
728720
}
729721

722+
if currentLatestChart.Id != 0 && currentLatestChart.Id != templateRequest.Id {
723+
err = impl.updateChartLocationForEnvironmentConfigs(newCtx, templateRequest.AppId, templateRequest.ChartRefId, templateRequest.UserId, template.ChartVersion)
724+
if err != nil {
725+
impl.logger.Errorw("error in updating chart location in env overrides", "appId", templateRequest.AppId, "err", err)
726+
return nil, err
727+
}
728+
}
729+
730730
appLevelMetricsUpdateReq := &bean.DeployedAppMetricsRequest{
731731
EnableMetrics: templateRequest.IsAppMetricsEnabled,
732732
AppId: templateRequest.AppId,

0 commit comments

Comments
 (0)