Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions api/helm-app/HelmAppRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
clientErrors "github.com/devtron-labs/devtron/pkg/errors"
"github.com/devtron-labs/devtron/pkg/fluxApplication"
bean2 "github.com/devtron-labs/devtron/pkg/k8s/application/bean"
"github.com/devtron-labs/devtron/pkg/pipeline"
"net/http"
"strconv"
"strings"
Expand Down Expand Up @@ -144,6 +145,11 @@ func (handler *HelmAppRestHandlerImpl) GetApplicationDetail(w http.ResponseWrite
//RBAC enforcer Ends
appdetail, err := handler.helmAppService.GetApplicationDetail(context.Background(), appIdentifier)
if err != nil {

if pipeline.CheckAppReleaseNotExist(err) {
common.WriteJsonResp(w, err, nil, http.StatusNotFound)
return
}
apiError := clientErrors.ConvertToApiError(err)
if apiError != nil {
err = apiError
Expand Down
2 changes: 1 addition & 1 deletion cmd/external-app/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/pipeline/AppDeploymentTypeChangeManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ func (impl *AppDeploymentTypeChangeManagerImpl) fetchDeletedApp(ctx context.Cont
impl.logger.Errorw("error in getting application detail", "err", err, "deploymentAppName", pipeline.DeploymentAppName)
}

if err != nil && checkAppReleaseNotExist(err) {
if err != nil && CheckAppReleaseNotExist(err) {
successfulPipelines = impl.appendToDeploymentChangeStatusList(
successfulPipelines,
pipeline,
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipeline/PipelineBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ type PipelineStrategy struct {
Default bool `json:"default"`
}

func checkAppReleaseNotExist(err error) bool {
func CheckAppReleaseNotExist(err error) bool {
// RELEASE_NOT_EXIST check for helm App and NOT_FOUND check for argo app
return strings.Contains(err.Error(), bean.NOT_FOUND) || strings.Contains(err.Error(), bean.RELEASE_NOT_EXIST)
}