Skip to content

fix: old pods are listed in new pod section for devtron apps deployed through Helm #4165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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
8 changes: 8 additions & 0 deletions api/restHandler/AppListingRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,14 @@ func (handler AppListingRestHandlerImpl) fetchResourceTree(w http.ResponseWriter
}
if detail != nil && detail.ReleaseExist {
resourceTree = util2.InterfaceToMapAdapter(detail.ResourceTreeResponse)
// add "isNew = false" flag in podMetaData - isNew flag will be omitted when the value is false
podMetadata := resourceTree["podMetadata"]
Copy link
Member

Choose a reason for hiding this comment

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

replace with constant

for _, data := range podMetadata.([]interface{}) {
Copy link
Member

Choose a reason for hiding this comment

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

is this type assertion always going to work? should add a validation for this

dataMap := data.(map[string]interface{})
Copy link
Member

Choose a reason for hiding this comment

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

check for assertion

if _, ok := dataMap["isNew"]; !ok {
Copy link
Member

Choose a reason for hiding this comment

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

replace with constant

dataMap["isNew"] = false
}
}
releaseStatus := util2.InterfaceToMapAdapter(detail.ReleaseStatus)
applicationStatus := detail.ApplicationStatus
resourceTree["releaseStatus"] = releaseStatus
Expand Down