fix(region): gcp image sync

This commit is contained in:
ioito
2023-02-16 17:16:32 +08:00
parent 2a887c2e42
commit d13e8d7c8d
5 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ require (
k8s.io/client-go v0.19.3
k8s.io/cluster-bootstrap v0.19.3
moul.io/http2curl/v2 v2.3.0
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230214091640-428e1d10455b
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230216091342-1c576ec91caa
yunion.io/x/executor v0.0.0-20211018100936-39a2cd966656
yunion.io/x/jsonutils v1.0.1-0.20220819091305-3bab322ab4fd
yunion.io/x/log v1.0.0
+2 -2
View File
@@ -1158,8 +1158,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230214091640-428e1d10455b h1:9PLPqwmPvneJsh9KCNWzj7DK6jHMSex9GRjKRoCyJXE=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230214091640-428e1d10455b/go.mod h1:yEMFtIKPyIdIfPzsw7oTcH41JXc8G5StUAQw3ZoGj5I=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230216091342-1c576ec91caa h1:TUYEeZD2HdT9p/zmB8zOuh/98fl7jR1YF8eVTGij9lI=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230216091342-1c576ec91caa/go.mod h1:yEMFtIKPyIdIfPzsw7oTcH41JXc8G5StUAQw3ZoGj5I=
yunion.io/x/executor v0.0.0-20211018100936-39a2cd966656 h1:0zlZD5uhZoIHgLVAWCz2aHaYk2ZrNsACCYD7R6EIBII=
yunion.io/x/executor v0.0.0-20211018100936-39a2cd966656/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
+4 -1
View File
@@ -121,7 +121,10 @@ func SyncPublicCloudImages(ctx context.Context, userCred mcclient.TokenCredentia
func (self *SCloudimage) syncRemove(ctx context.Context, userCred mcclient.TokenCredential) error {
_image, err := db.FetchByExternalId(CachedimageManager, self.ExternalId)
if err != nil {
return errors.Wrapf(err, "db.FetchByExternalId")
if errors.Cause(err) == sql.ErrNoRows {
return self.Delete(ctx, userCred)
}
return errors.Wrapf(err, "db.FetchByExternalId(%s)", self.ExternalId)
}
image := _image.(*SCachedimage)
+1 -1
View File
@@ -1439,7 +1439,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
# sigs.k8s.io/yaml v1.2.0
## explicit; go 1.12
sigs.k8s.io/yaml
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230214091640-428e1d10455b
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230216091342-1c576ec91caa
## explicit; go 1.18
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
+2 -2
View File
@@ -39,7 +39,7 @@ type SStoragecache struct {
}
func (cache *SStoragecache) GetId() string {
return cache.region.client.cpcfg.Id
return fmt.Sprintf("%s-%s", cache.region.client.cpcfg.Id, cache.region.GetGlobalId())
}
func (cache *SStoragecache) GetName() string {
@@ -55,7 +55,7 @@ func (cache *SStoragecache) Refresh() error {
}
func (cache *SStoragecache) GetGlobalId() string {
return cache.region.client.cpcfg.Id
return cache.GetId()
}
func (cache *SStoragecache) IsEmulated() bool {