Merge pull request #8326 from zexi/hotfix/images-distinct-field

fix: get images distinct field
This commit is contained in:
yunion-ci-robot
2020-10-16 14:31:34 +08:00
committed by GitHub
+6
View File
@@ -93,6 +93,12 @@ func (this *ImageManager) GetByName(session *mcclient.ClientSession, id string,
}
func (this *ImageManager) Get(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
// hack: some GetPropertiesMethod must use HTTP GET action like:
// - GET /images/distinct-field
// hard code this id currently, should found a better solution
if ok, _ := utils.InStringArray(id, []string{"distinct-field"}); ok {
return this.ResourceManager.Get(session, id, params)
}
r, e := this.GetById(session, id, params)
if e == nil {
return r, e