diff --git a/pkg/models/openpitrix/applicationversions.go b/pkg/models/openpitrix/applicationversions.go index 1fa4229d0..c134d4a6e 100644 --- a/pkg/models/openpitrix/applicationversions.go +++ b/pkg/models/openpitrix/applicationversions.go @@ -230,7 +230,11 @@ func (c *applicationOperator) ListAppVersionReviews(conditions *params.Condition items := make([]interface{}, 0, len(filtered)) for i, j := offset, 0; i < len(filtered) && j < limit; i, j = i+1, j+1 { - review := convertAppVersionReview(filtered[i]) + app, err := c.appLister.Get(filtered[i].GetHelmApplicationId()) + if err != nil { + return nil, err + } + review := convertAppVersionReview(app, filtered[i]) items = append(items, review) } diff --git a/pkg/models/openpitrix/utils.go b/pkg/models/openpitrix/utils.go index 3abe7bea4..d54941c05 100644 --- a/pkg/models/openpitrix/utils.go +++ b/pkg/models/openpitrix/utils.go @@ -17,6 +17,7 @@ limitations under the License. package openpitrix import ( + "encoding/json" "fmt" "path" "regexp" @@ -754,7 +755,7 @@ func attachmentKeyInStorage(ws, id string) string { return path.Join(ws, id) } -func convertAppVersionReview(appVersion *v1alpha1.HelmApplicationVersion) *AppVersionReview { +func convertAppVersionReview(app *v1alpha1.HelmApplication, appVersion *v1alpha1.HelmApplicationVersion) *AppVersionReview { review := &AppVersionReview{} status := appVersion.Status review.Reviewer = status.Audit[0].Operator @@ -766,7 +767,7 @@ func convertAppVersionReview(appVersion *v1alpha1.HelmApplicationVersion) *AppVe review.VersionName = appVersion.GetVersionName() review.StatusTime = strfmt.DateTime(status.Audit[0].Time.Time) - review.AppName = appVersion.GetTrueName() + review.AppName = app.GetTrueName() return review }