From 10ae4b4bf8af134474d84f7a231ca2d18c80793c Mon Sep 17 00:00:00 2001 From: TangBin Date: Tue, 6 Aug 2019 14:57:52 +0800 Subject: [PATCH] add elastic cache purge fix --- pkg/multicloud/huawei/client/modules/mod_elasticcache.go | 2 +- pkg/multicloud/huawei/elasticcache_instance.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/multicloud/huawei/client/modules/mod_elasticcache.go b/pkg/multicloud/huawei/client/modules/mod_elasticcache.go index 82f712a589..fab9180270 100644 --- a/pkg/multicloud/huawei/client/modules/mod_elasticcache.go +++ b/pkg/multicloud/huawei/client/modules/mod_elasticcache.go @@ -18,7 +18,7 @@ func NewElasticcacheManager(regionId string, projectId string, signer auth.Signe Region: regionId, ProjectId: projectId, version: "v1.0", - Keyword: "instance", + Keyword: "", KeywordPlural: "instances", ResourceKeyword: "instances", diff --git a/pkg/multicloud/huawei/elasticcache_instance.go b/pkg/multicloud/huawei/elasticcache_instance.go index e9852a5f77..8f227e980f 100644 --- a/pkg/multicloud/huawei/elasticcache_instance.go +++ b/pkg/multicloud/huawei/elasticcache_instance.go @@ -155,7 +155,13 @@ func (self *SElasticcache) GetVpcId() string { func (self *SElasticcache) GetZoneId() string { if len(self.AvailableZones) > 0 { - return self.AvailableZones[0] + zone, err := self.region.getZoneById(self.AvailableZones[0]) + if err != nil { + log.Errorf("elasticcache.GetZoneId %s", err) + return "" + } + + return zone.GetGlobalId() } return ""