fix(region): vendor update for web app (#20269)

This commit is contained in:
屈轩
2024-05-14 20:57:39 +08:00
committed by GitHub
parent 7f11f43f0f
commit cdde2bafa1
4 changed files with 55 additions and 8 deletions
+1 -1
View File
@@ -88,7 +88,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.20240514110447-1183a70bd704
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240514124346-2e662f930eaf
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
+2 -2
View File
@@ -1208,8 +1208,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.20240514110447-1183a70bd704 h1:q4PJPMHqMINFeYoCehXErUwDyJWMCTONdHwEz/n0pRQ=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240514110447-1183a70bd704/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240514124346-2e662f930eaf h1:YDpkOBXPWqvycSOIisnDAQc+3pTyq45hKeeLsavryX0=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240514124346-2e662f930eaf/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=
+1 -1
View File
@@ -1479,7 +1479,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.20240514110447-1183a70bd704
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240514124346-2e662f930eaf
## explicit; go 1.18
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
+51 -4
View File
@@ -124,7 +124,7 @@ func (as *SAppSite) GetStack() (string, error) {
if len(as.stack) > 0 {
return as.stack, nil
}
res := fmt.Sprintf("%s/config/metadata", as.Id)
res := fmt.Sprintf("%s/config/metadata/list", as.Id)
resp, err := as.region.post_v2(res, "2023-12-01", nil)
if err != nil {
return "", nil
@@ -267,14 +267,61 @@ func (a *SAppSite) GetTechStack() string {
if s, ok := techStacks[stack]; ok {
return s
}
res := fmt.Sprintf("%s/config", a.Id)
resp, err := a.region.list_v2(res, "2023-12-01", nil)
if err != nil {
return ""
}
value := []struct {
Properties struct {
PhpVersion string
PythonVersion string
NodeVersion string
PowerShellVersion string
JavaVersion string
}
}{}
resp.Unmarshal(&value, "value")
for _, v := range value {
if len(v.Properties.NodeVersion) > 0 {
return "Node"
}
if len(v.Properties.PhpVersion) > 0 {
return "PHP"
}
if len(v.Properties.PowerShellVersion) > 0 {
return "PowerShell"
}
if len(v.Properties.JavaVersion) > 0 {
return "Java"
}
}
return stack
}
func (a *SAppSite) GetOsType() cloudprovider.TOsType {
if strings.Contains(strings.ToLower(a.GetTechStack()), "net") {
return cloudprovider.OsTypeWindows
res := fmt.Sprintf("%s/config", a.Id)
resp, err := a.region.list_v2(res, "2023-12-01", nil)
if err != nil {
return cloudprovider.OsTypeLinux
}
return cloudprovider.OsTypeLinux
value := []struct {
Properties struct {
LinuxFxVersion string
WindowsFxVersion string
}
}{}
resp.Unmarshal(&value, "value")
for _, v := range value {
if len(v.Properties.LinuxFxVersion) > 0 {
return cloudprovider.OsTypeLinux
}
if len(v.Properties.WindowsFxVersion) > 0 {
return cloudprovider.OsTypeWindows
}
}
return cloudprovider.OsTypeWindows
}
func (self *SAppSite) SetTags(tags map[string]string, replace bool) error {