Fix: show app name in review list
Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user