Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions pkg/app/AppService.go
Original file line number Diff line number Diff line change
Expand Up @@ -2176,17 +2176,27 @@ func (impl *AppServiceImpl) createHelmAppForCdPipeline(overrideRequest *bean.Val
ReleaseIdentifier: releaseIdentifier,
}
helmResponse, err := impl.helmAppClient.InstallReleaseWithCustomChart(ctx, helmInstallRequest)

//IMP: update cd pipeline to mark deployment app created, even if helm install fails
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we have to mark this true if app does not created

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed

// If the helm install fails, it still creates the app in failed state, so trying to
// re-create the app results in error from helm that cannot re-use name which is still in use
_, pgErr := impl.updatePipeline(pipeline, overrideRequest.UserId)

if err != nil {
impl.logger.Errorw("error in helm install custom chart", "err", err)

if pgErr != nil {
impl.logger.Errorw("failed to update deployment app created flag in pipeline table", "err", err)
}
return false, err
}
impl.logger.Debugw("received helm release response", "helmResponse", helmResponse, "isSuccess", helmResponse.Success)
//update cd pipeline to mark deployment app created
_, err = impl.updatePipeline(pipeline, overrideRequest.UserId)
if err != nil {
impl.logger.Errorw("error in update cd pipeline for deployment app created or not", "err", err)

if pgErr != nil {
impl.logger.Errorw("failed to update deployment app created flag in pipeline table", "err", err)
return false, err
}

impl.logger.Debugw("received helm release response", "helmResponse", helmResponse, "isSuccess", helmResponse.Success)
}

//update workflow runner status, used in app workflow view
Expand Down