Skip to content

Commit ed86291

Browse files
authored
Merge pull request #6533 from devtron-labs/feat-base-template-chart-update
fix: error pg.ErrNoRow on base deployment template update
2 parents ba05cb7 + 489c992 commit ed86291

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
}
@@ -725,6 +719,14 @@ func (impl *ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateReq
725719
return nil, err
726720
}
727721

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+
728730
appLevelMetricsUpdateReq := &bean.DeployedAppMetricsRequest{
729731
EnableMetrics: templateRequest.IsAppMetricsEnabled,
730732
AppId: templateRequest.AppId,

0 commit comments

Comments
 (0)