Skip to content

Commit b3e3adc

Browse files
committed
fix: error pg.ErrNoRow on base deployment template update
1 parent e2daf69 commit b3e3adc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pkg/chart/ChartService.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,6 @@ func (impl *ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateReq
663663
return nil, err
664664
}
665665

666-
err = impl.updateChartLocationForEnvironmentConfigs(newCtx, templateRequest.AppId, templateRequest.ChartRefId, templateRequest.UserId, template.ChartVersion)
667-
if err != nil {
668-
impl.logger.Errorw("error in updating chart location in env overrides", "appId", templateRequest.AppId, "err", err)
669-
return nil, err
670-
}
671-
672666
} else {
673667
return nil, nil
674668
}
@@ -694,6 +688,14 @@ func (impl *ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateReq
694688
return nil, err
695689
}
696690

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+
697699
config, err := impl.deploymentConfigService.GetConfigForDevtronApps(template.AppId, 0)
698700
if err != nil {
699701
impl.logger.Errorw("error in fetching config", "appId", template.AppId, "err", err)

0 commit comments

Comments
 (0)