-
Notifications
You must be signed in to change notification settings - Fork 532
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
Conversation
podMetadata := resourceTree["podMetadata"] | ||
for _, data := range podMetadata.([]interface{}) { | ||
dataMap := data.(map[string]interface{}) | ||
if _, ok := dataMap["isNew"]; !ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace with constant
@@ -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"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace with constant
@@ -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"] | |||
for _, data := range podMetadata.([]interface{}) { |
There was a problem hiding this comment.
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
// add "isNew = false" flag in podMetaData - isNew flag will be omitted when the value is false | ||
podMetadata := resourceTree["podMetadata"] | ||
for _, data := range podMetadata.([]interface{}) { | ||
dataMap := data.(map[string]interface{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check for assertion
Kudos, SonarCloud Quality Gate passed!
|
Outdated, Not required anymore |
Description
These changes fix the flag condition which decides whether the pods are new or old
Fixes #4024
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:
Does this PR introduce a user-facing change?