Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #1099: fix(ucloud): avoid panic when sync vm tags #1101

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading