@@ -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