Skip to content

Commit

Permalink
Merge pull request #1101 from ioito/automated-cherry-pick-of-#1099-up…
Browse files Browse the repository at this point in the history
…stream-master

Automated cherry pick of #1099: fix(ucloud): avoid panic when sync vm tags
  • Loading branch information
ioito authored Oct 29, 2024
2 parents 47c8a5c + eeadb01 commit 9bd0fd7
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions pkg/multicloud/ucloud/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,28 +184,6 @@ func (self *SInstance) Refresh() error {
return jsonutils.Update(self, new)
}

func (self *SInstance) IsEmulated() bool {
return false
}

func (self *SInstance) GetSysTags() map[string]string {
data := map[string]string{}
// todo: add price key here
data["zone_ext_id"] = self.host.zone.GetGlobalId()
if len(self.BasicImageID) > 0 {
if image, err := self.host.zone.region.GetImage(self.BasicImageID); err != nil {
log.Errorf("Failed to find image %s for instance %s", self.BasicImageID, self.GetName())
} else {
meta := image.GetSysTags()
for k, v := range meta {
data[k] = v
}
}
}

return data
}

// 计费模式,枚举值为: Year,按年付费; Month,按月付费; Dynamic,按需付费(需开启权限);
func (self *SInstance) GetBillingType() string {
switch self.ChargeType {
Expand Down

0 comments on commit 9bd0fd7

Please sign in to comment.