mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
Merge pull request #2301 from wanyaoqi/bugfix/wyq/fix-image-head-no-field-tenant
bugfix: fix image head request no field tenant
This commit is contained in:
@@ -284,13 +284,17 @@ func (self *SImage) GetExtraDetailsHeaders(ctx context.Context, userCred mcclien
|
||||
headers := make(map[string]string)
|
||||
|
||||
extra, _ := self.SVirtualResourceBase.GetExtraDetails(ctx, userCred, query)
|
||||
if extra != nil {
|
||||
for _, k := range extra.SortedKeys() {
|
||||
log.Infof("%s", k)
|
||||
val, _ := extra.GetString(k)
|
||||
if len(val) > 0 {
|
||||
headers[fmt.Sprintf("%s%s", modules.IMAGE_META, k)] = val
|
||||
}
|
||||
if extra == nil {
|
||||
extra = jsonutils.NewDict()
|
||||
}
|
||||
extraRows := self.GetModelManager().FetchCustomizeColumns(ctx, userCred, query, []db.IModel{self}, nil)
|
||||
if len(extraRows) == 1 {
|
||||
extra.Update(extraRows[0])
|
||||
}
|
||||
for _, k := range extra.SortedKeys() {
|
||||
val, _ := extra.GetString(k)
|
||||
if len(val) > 0 {
|
||||
headers[fmt.Sprintf("%s%s", modules.IMAGE_META, k)] = val
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user