Skip to content

Commit 4a2aa7e

Browse files
authored
fix(region): support cnware (#23388)
1 parent 524c676 commit 4a2aa7e

File tree

26 files changed

+575
-12
lines changed

26 files changed

+575
-12
lines changed

cmd/climc/shell/compute/cloudaccounts.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func init() {
6262
cmd.CreateWithKeyword("create-qingcloud", &options.SQingCloudCloudAccountCreateOptions{})
6363
cmd.CreateWithKeyword("create-oracle", &options.SOracleCloudAccountCreateOptions{})
6464
cmd.CreateWithKeyword("create-cephfs", &options.SCephFSCloudAccountCreateOptions{})
65+
cmd.CreateWithKeyword("create-cnware", &options.SCNwareCloudAccountCreateOptions{})
6566

6667
cmd.UpdateWithKeyword("update-vmware", &options.SVMwareCloudAccountUpdateOptions{})
6768
cmd.UpdateWithKeyword("update-aliyun", &options.SAliyunCloudAccountUpdateOptions{})
@@ -88,6 +89,7 @@ func init() {
8889
cmd.UpdateWithKeyword("update-baidu", &options.SBaiduCloudAccountUpdateOptions{})
8990
cmd.UpdateWithKeyword("update-cucloud", &options.SCucloudCloudAccountUpdateOptions{})
9091
cmd.UpdateWithKeyword("update-qingcloud", &options.SQingCloudCloudAccountUpdateOptions{})
92+
cmd.UpdateWithKeyword("update-cnware", &options.SCNwareCloudAccountUpdateOptions{})
9193

9294
cmd.Perform("update-credential", &options.CloudaccountUpdateCredentialOptions{})
9395

@@ -117,6 +119,7 @@ func init() {
117119
cmd.PerformWithKeyword("update-credential-baidu", "update-credential", &options.SBaiduCloudAccountUpdateCredentialOptions{})
118120
cmd.PerformWithKeyword("update-credential-cucloud", "update-credential", &options.SCucloudCloudAccountUpdateCredentialOptions{})
119121
cmd.PerformWithKeyword("update-credential-qingcloud", "update-credential", &options.SQingCloudCloudAccountUpdateCredentialOptions{})
122+
cmd.PerformWithKeyword("update-credential-cnware", "update-credential", &options.SCNwareCloudAccountUpdateCredentialOptions{})
120123

121124
cmd.PerformWithKeyword("test-connectivity-google", "test-connectivity", &options.SGoogleCloudAccountUpdateCredentialOptions{})
122125
cmd.PerformWithKeyword("test-connectivity-vmware", "test-connectivity", &options.SVMwareCloudAccountUpdateCredentialOptions{})

cmd/climc/shell/compute/usages.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ import (
3131
)
3232

3333
type GeneralUsageOptions struct {
34-
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack|google|ctyun"`
35-
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun"`
36-
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun"`
34+
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack|google|ctyun|cnware"`
35+
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun|CNWare"`
36+
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun|CNWare"`
3737
Project string `help:"show usage of specified project"`
3838

3939
ProjectDomain string `help:"show usage of specified domain"`

cmd/climc/shell/misc/feature.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func init() {
105105
"oraclecloud",
106106
"sangfor",
107107
"cephfs",
108+
"cnware",
108109
}
109110

110111
features = append(features, storageFeatures...)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ require (
9696
k8s.io/cri-api v0.22.17
9797
k8s.io/klog/v2 v2.20.0
9898
moul.io/http2curl/v2 v2.3.0
99-
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250926020310-3d004271191d
99+
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250926060627-f3514bd9ae0e
100100
yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0
101101
yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1
102102
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,8 +1426,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
14261426
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
14271427
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
14281428
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
1429-
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250926020310-3d004271191d h1:ZAYOZuFaAeGFz+LYE2FMXu4fwx/qqfuTww3eJRK/ZzY=
1430-
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250926020310-3d004271191d/go.mod h1:R5iP/4nGCluuekoa30B5hM/49IfPpGHXwFK3yT7m6Vw=
1429+
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250926060627-f3514bd9ae0e h1:i2PgAwxPsZROib7oSmrJ0ZshRZE+2V/hOtIIXPyNYf4=
1430+
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250926060627-f3514bd9ae0e/go.mod h1:R5iP/4nGCluuekoa30B5hM/49IfPpGHXwFK3yT7m6Vw=
14311431
yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0 h1:msG4SiDSVU7CrXH06WuHlNEZXIooTcmNbfrIGHuIHBU=
14321432
yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
14331433
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=

pkg/apis/compute/cloudaccount_const.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const (
7676
CLOUD_PROVIDER_UIS = compute.CLOUD_PROVIDER_UIS
7777
CLOUD_PROVIDER_CAS = compute.CLOUD_PROVIDER_CAS
7878
CLOUD_PROVIDER_CLOUDFLARE = compute.CLOUD_PROVIDER_CLOUDFLARE
79+
CLOUD_PROVIDER_CNWARE = compute.CLOUD_PROVIDER_CNWARE
7980

8081
CLOUD_PROVIDER_GENERICS3 = compute.CLOUD_PROVIDER_GENERICS3
8182
CLOUD_PROVIDER_CEPH = compute.CLOUD_PROVIDER_CEPH
@@ -125,7 +126,7 @@ var (
125126
CLOUD_PROVIDER_HCSO, CLOUD_PROVIDER_HCS, CLOUD_PROVIDER_HCSOP,
126127
CLOUD_PROVIDER_INCLOUD_SPHERE, CLOUD_PROVIDER_PROXMOX, CLOUD_PROVIDER_REMOTEFILE,
127128
CLOUD_PROVIDER_H3C, CLOUD_PROVIDER_SANGFOR, CLOUD_PROVIDER_ZSTACK, CLOUD_PROVIDER_UIS,
128-
CLOUD_PROVIDER_ZETTAKIT, CLOUD_PROVIDER_CAS,
129+
CLOUD_PROVIDER_ZETTAKIT, CLOUD_PROVIDER_CAS, CLOUD_PROVIDER_CNWARE,
129130
}
130131
PUBLIC_CLOUD_PROVIDERS = []string{
131132
CLOUD_PROVIDER_ALIYUN,
@@ -184,6 +185,7 @@ var (
184185
CLOUD_PROVIDER_UIS,
185186
CLOUD_PROVIDER_CAS,
186187
CLOUD_PROVIDER_CLOUDFLARE,
188+
CLOUD_PROVIDER_CNWARE,
187189
}
188190

189191
CLOUD_PROVIDER_HOST_TYPE_MAP = map[string][]string{
@@ -294,6 +296,9 @@ var (
294296
CLOUD_PROVIDER_CAS: {
295297
HOST_TYPE_CAS,
296298
},
299+
CLOUD_PROVIDER_CNWARE: {
300+
HOST_TYPE_CNWARE,
301+
},
297302
}
298303
)
299304

pkg/apis/compute/guest_const.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ const (
223223
HYPERVISOR_ZETTAKIT = compute.HYPERVISOR_ZETTAKIT
224224
HYPERVISOR_UIS = compute.HYPERVISOR_UIS
225225
HYPERVISOR_CAS = compute.HYPERVISOR_CAS
226+
HYPERVISOR_CNWARE = compute.HYPERVISOR_CNWARE
226227

227228
// HYPERVISOR_DEFAULT = HYPERVISOR_KVM
228229
HYPERVISOR_DEFAULT = HYPERVISOR_KVM
@@ -305,6 +306,7 @@ var HYPERVISORS = []string{
305306
HYPERVISOR_SANGFOR,
306307
HYPERVISOR_ZETTAKIT,
307308
HYPERVISOR_UIS,
309+
HYPERVISOR_CNWARE,
308310
}
309311

310312
const (

pkg/apis/compute/host_const.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const (
6060
HOST_TYPE_ZETTAKIT = compute.HOST_TYPE_ZETTAKIT
6161
HOST_TYPE_UIS = compute.HOST_TYPE_UIS
6262
HOST_TYPE_CAS = compute.HOST_TYPE_CAS
63+
HOST_TYPE_CNWARE = compute.HOST_TYPE_CNWARE
6364

6465
HOST_TYPE_DEFAULT = HOST_TYPE_HYPERVISOR
6566

@@ -165,6 +166,7 @@ var HOST_TYPES = []string{
165166
HOST_TYPE_SANGFOR,
166167
HOST_TYPE_ZETTAKIT,
167168
HOST_TYPE_UIS,
169+
HOST_TYPE_CNWARE,
168170
}
169171

170172
var ALL_NIC_TYPES = []compute.TNicType{NIC_TYPE_IPMI, NIC_TYPE_ADMIN, NIC_TYPE_NORMAL}

pkg/apis/compute/storage_const.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ const (
143143

144144
// zettakit
145145
STORAGE_ZETTAKIT_NORMAL = compute.STORAGE_ZETTAKIT_NORMAL
146+
147+
// cnware storage type
148+
STORAGE_CNWARE_FCSAN = compute.STORAGE_CNWARE_FC_SAN
149+
STORAGE_CNWARE_IPSAN = compute.STORAGE_CNWARE_IP_SAN
150+
STORAGE_CNWARE_NAS = compute.STORAGE_CNWARE_NAS
151+
STORAGE_CNWARE_CEPH = compute.STORAGE_CNWARE_CEPH
152+
STORAGE_CNWARE_LOCAL = compute.STORAGE_CNWARE_LOCAL
153+
STORAGE_CNWARE_NVME = compute.STORAGE_CNWARE_NVME
146154
)
147155

148156
const (

pkg/apis/webconsole/consts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ const (
4040
VOLC_ENGINE = "volcengine"
4141
BAIDU = "baidu"
4242
SANGFOR = "sangfor"
43+
CNWARE = "cnware"
4344
)

0 commit comments

Comments
 (0)