mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): sync cloudpods host storage driver (#20466)
This commit is contained in:
@@ -89,7 +89,7 @@ require (
|
||||
k8s.io/cluster-bootstrap v0.19.3
|
||||
k8s.io/cri-api v0.22.17
|
||||
moul.io/http2curl/v2 v2.3.0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072806-f376c3f1c8a1
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034108-b452a0501fee
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91
|
||||
|
||||
@@ -1215,8 +1215,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.20240603072806-f376c3f1c8a1 h1:xcovGMz5XbcbyLGEn9o7gkAiOLjugMwHaf7csu2fob8=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072806-f376c3f1c8a1/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034108-b452a0501fee h1:Fkp5JJIMayFVF5W/qcLfzQ4n8BUuLOlFiMC6AZv4Z7o=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034108-b452a0501fee/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
|
||||
@@ -2015,6 +2015,9 @@ func (hh *SHost) SyncWithCloudHost(ctx context.Context, userCred mcclient.TokenC
|
||||
hh.IsBaremetal = true
|
||||
}
|
||||
hh.StorageInfo = extHost.GetStorageInfo()
|
||||
if storageDriver := extHost.GetStorageDriver(); len(storageDriver) > 0 {
|
||||
hh.StorageDriver = storageDriver
|
||||
}
|
||||
hh.OvnVersion = extHost.GetOvnVersion()
|
||||
|
||||
if cpuCmt := extHost.GetCpuCmtbound(); cpuCmt > 0 {
|
||||
@@ -2271,6 +2274,7 @@ func (manager *SHostManager) NewFromCloudHost(ctx context.Context, userCred mccl
|
||||
host.MemSize = extHost.GetMemSizeMB()
|
||||
host.StorageSize = extHost.GetStorageSizeMB()
|
||||
host.StorageType = extHost.GetStorageType()
|
||||
host.StorageDriver = extHost.GetStorageDriver()
|
||||
host.CpuCmtbound = 8.0
|
||||
if cpuCmt := extHost.GetCpuCmtbound(); cpuCmt > 0 {
|
||||
host.CpuCmtbound = cpuCmt
|
||||
|
||||
@@ -157,6 +157,10 @@ func (host *SHost) GetStorageSizeMB() int64 {
|
||||
return host.StorageSize
|
||||
}
|
||||
|
||||
func (host *SHost) GetStorageDriver() string {
|
||||
return host.StorageDriver
|
||||
}
|
||||
|
||||
func (host *SHost) GetStorageInfo() jsonutils.JSONObject {
|
||||
return host.StorageInfo
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1489,7 +1489,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.20240603072806-f376c3f1c8a1
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034108-b452a0501fee
|
||||
## explicit; go 1.18
|
||||
yunion.io/x/cloudmux/pkg/apis
|
||||
yunion.io/x/cloudmux/pkg/apis/billing
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ package compute
|
||||
const (
|
||||
MONGO_DB_STATUS_CREATING = "creating"
|
||||
MONGO_DB_STATUS_RUNNING = "running"
|
||||
MONGO_DB_STATUS_PROCESSING = "processing"
|
||||
MONGO_DB_STATUS_DEPLOY = "deploy"
|
||||
MONGO_DB_STATUS_CHANGE_CONFIG = "change_config"
|
||||
MONGO_DB_STATUS_DELETING = "deleting"
|
||||
|
||||
+1
@@ -306,6 +306,7 @@ type ICloudHost interface {
|
||||
GetStorageSizeMB() int64
|
||||
GetStorageType() string
|
||||
GetHostType() string
|
||||
GetStorageDriver() string
|
||||
GetStorageInfo() jsonutils.JSONObject
|
||||
|
||||
GetIsMaintenance() bool
|
||||
|
||||
+4
@@ -48,6 +48,10 @@ func (host *SHostBase) GetCpuArchitecture() string {
|
||||
return apis.OS_ARCH_X86_64
|
||||
}
|
||||
|
||||
func (host *SHostBase) GetStorageDriver() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (host *SHostBase) GetStorageInfo() jsonutils.JSONObject {
|
||||
return nil
|
||||
}
|
||||
|
||||
+3
-1
@@ -115,8 +115,10 @@ func (self *SMongoDB) GetName() string {
|
||||
|
||||
func (self *SMongoDB) GetStatus() string {
|
||||
switch self.Status {
|
||||
case 0, 1:
|
||||
case 0:
|
||||
return api.MONGO_DB_STATUS_CREATING
|
||||
case 1:
|
||||
return api.MONGO_DB_STATUS_PROCESSING
|
||||
case 2:
|
||||
return api.MONGO_DB_STATUS_RUNNING
|
||||
case -2, -3:
|
||||
|
||||
Reference in New Issue
Block a user