Skip to content

Commit

Permalink
fix(region): sync cloudpods host storage driver (#20465)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito authored Jun 4, 2024
1 parent 71bd725 commit dd66d16
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ require (
k8s.io/cri-api v0.22.17
k8s.io/klog/v2 v2.2.0
moul.io/http2curl/v2 v2.3.0
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072803-dd17647bb71c
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034047-e1e06dfdf1f9
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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1309,8 +1309,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.20240603072803-dd17647bb71c h1:GRMRxsn9qZVHiqI/+bBnDUT9gGCtoO2RYdoIK96fUco=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072803-dd17647bb71c/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034047-e1e06dfdf1f9 h1:D5VDFE0Ab9rmBT3/MtO4Dqk1oZxLxS90Io3ToC915q8=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034047-e1e06dfdf1f9/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=
Expand Down
4 changes: 4 additions & 0 deletions pkg/compute/models/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,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 {
Expand Down Expand Up @@ -2274,6 +2277,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
Expand Down
4 changes: 4 additions & 0 deletions pkg/mcclient/cloudpods/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,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.20240603072803-dd17647bb71c
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034047-e1e06dfdf1f9
## explicit; go 1.18
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/yunion.io/x/cloudmux/pkg/multicloud/host_base.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vendor/yunion.io/x/cloudmux/pkg/multicloud/qcloud/mongodb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dd66d16

Please sign in to comment.