Fixed an issue where categories were not updated in the App Store aft… (#5925)

Fixed an issue where categories were not updated in the App Store after the app template was republished

Signed-off-by: bingbing ma <bingbing.ma@gientech.com>
Co-authored-by: bingbing ma <bingbing.ma@gientech.com>
This commit is contained in:
bbma
2023-10-08 15:43:55 +08:00
committed by GitHub
parent b0812d183d
commit 5c3ecd0407

View File

@@ -428,8 +428,9 @@ func (c *applicationOperator) DoAppVersionAction(versionId string, request *Acti
return err
}
if !reflect.DeepEqual(&app.Spec, &appInStore.Spec) {
if !reflect.DeepEqual(&app.Spec, &appInStore.Spec) || !reflect.DeepEqual(app.Labels[constants.CategoryIdLabelKey], appInStore.Labels[constants.CategoryIdLabelKey]) {
appCopy := appInStore.DeepCopy()
appCopy.Labels[constants.CategoryIdLabelKey] = app.Labels[constants.CategoryIdLabelKey]
appCopy.Spec = app.Spec
patch := client.MergeFrom(appInStore)
data, _ := patch.Data(appCopy)