From c835c87afcaec336decb1ffcfe3051ebb219c6e5 Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Sat, 31 May 2025 18:47:54 +0800 Subject: [PATCH] fix: update vendor to fix keystone user join project not found (#22645) Co-authored-by: Qiu Jian --- go.mod | 6 +- go.sum | 8 +- vendor/modules.txt | 4 +- .../cloudmux/pkg/apis/compute/waf_instance.go | 3 + .../x/cloudmux/pkg/cloudprovider/resources.go | 1 + .../pkg/multicloud/aliyun/waf_domain.go | 8 + .../cloudmux/pkg/multicloud/aws/waf_rules.go | 5 + .../x/cloudmux/pkg/multicloud/azure/waf.go | 8 + vendor/yunion.io/x/sqlchemy/reflect.go | 244 ++++++++++-------- 9 files changed, 177 insertions(+), 110 deletions(-) diff --git a/go.mod b/go.mod index f430e9ba8d..be186303e3 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ require ( github.com/go-yaml/yaml v2.1.0+incompatible github.com/golang-plus/uuid v1.0.0 github.com/golang/mock v1.4.4 + github.com/golang/protobuf v1.5.3 github.com/google/cadvisor v0.38.5 github.com/google/gopacket v1.1.17 github.com/google/uuid v1.6.0 @@ -93,14 +94,14 @@ require ( k8s.io/cri-api v0.22.17 k8s.io/klog/v2 v2.20.0 moul.io/http2curl/v2 v2.3.0 - yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250528153742-2296b9b7287c + yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250529120035-500191be2aeb yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0 yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1 yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900 yunion.io/x/pkg v1.10.4-0.20250519013345-54017bf6c1f0 yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1 - yunion.io/x/sqlchemy v1.1.3-0.20250513031856-ce9f71063b3a + yunion.io/x/sqlchemy v1.1.3-0.20250531010554-ce98f840b833 yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c ) @@ -195,7 +196,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-plus/errors v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.0.1 // indirect github.com/google/go-querystring v1.0.0 // indirect diff --git a/go.sum b/go.sum index 7ccfa013dd..bcf521ecaa 100644 --- a/go.sum +++ b/go.sum @@ -1376,8 +1376,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.20250528153742-2296b9b7287c h1:DGnSo1KJS+0dZQTz76vArY+D1dEB8LoINmQP257Miso= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250528153742-2296b9b7287c/go.mod h1:FXxAEbdNfWXX9gjME3K2nJhkydHY5EKEUZb+RLEzVwQ= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250529120035-500191be2aeb h1:T2I2F35yKnu94plsfRDRbSVyFtip/PGQ6s4BNrYjl9I= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250529120035-500191be2aeb/go.mod h1:FXxAEbdNfWXX9gjME3K2nJhkydHY5EKEUZb+RLEzVwQ= yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0 h1:msG4SiDSVU7CrXH06WuHlNEZXIooTcmNbfrIGHuIHBU= yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634= @@ -1395,7 +1395,7 @@ yunion.io/x/pkg v1.10.4-0.20250519013345-54017bf6c1f0 h1:iKWkBMKazSijYNhOaSh4qBu yunion.io/x/pkg v1.10.4-0.20250519013345-54017bf6c1f0/go.mod h1:0Bwxqd9MA3ACi119/l02FprY/o9gHahmYC2bsSbnVpM= yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1 h1:1KJ3YYinydPHpDEQRXdr/T8SYcKZ5Er+m489H+PnaQ4= yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo= -yunion.io/x/sqlchemy v1.1.3-0.20250513031856-ce9f71063b3a h1:mDW1VyYJxZ4ORITZGDWacUiBNyqX6rMObnQk77NvUOg= -yunion.io/x/sqlchemy v1.1.3-0.20250513031856-ce9f71063b3a/go.mod h1:vCIZpqhZ5Jzaq3tFyrti/vv8BijQKtkzSgNT/uH4H5A= +yunion.io/x/sqlchemy v1.1.3-0.20250531010554-ce98f840b833 h1:XTFC1naKYkciCQDLm9izpzHXfTenmmtYsTpVKrsN5hE= +yunion.io/x/sqlchemy v1.1.3-0.20250531010554-ce98f840b833/go.mod h1:vCIZpqhZ5Jzaq3tFyrti/vv8BijQKtkzSgNT/uH4H5A= yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ= yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng= diff --git a/vendor/modules.txt b/vendor/modules.txt index 4eca199afd..58a9016d97 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1785,7 +1785,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.20250528153742-2296b9b7287c +# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250529120035-500191be2aeb ## explicit; go 1.21 yunion.io/x/cloudmux/pkg/apis yunion.io/x/cloudmux/pkg/apis/billing @@ -1936,7 +1936,7 @@ yunion.io/x/pkg/utils # yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1 ## explicit; go 1.12 yunion.io/x/s3cli -# yunion.io/x/sqlchemy v1.1.3-0.20250513031856-ce9f71063b3a +# yunion.io/x/sqlchemy v1.1.3-0.20250531010554-ce98f840b833 ## explicit; go 1.17 yunion.io/x/sqlchemy yunion.io/x/sqlchemy/backends diff --git a/vendor/yunion.io/x/cloudmux/pkg/apis/compute/waf_instance.go b/vendor/yunion.io/x/cloudmux/pkg/apis/compute/waf_instance.go index 507f24e8aa..f44a4bcb31 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/apis/compute/waf_instance.go +++ b/vendor/yunion.io/x/cloudmux/pkg/apis/compute/waf_instance.go @@ -15,6 +15,9 @@ package compute const ( + WAF_RULE_TYPE_CUSTOM = "Custom" + WAF_RULE_TYPE_TEMPLATE = "Template" + WAF_STATUS_AVAILABLE = "available" WAF_STATUS_DELETING = "deleting" WAF_STATUS_CREATE_FAILED = "create_failed" diff --git a/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go b/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go index f36ececdbd..dec8870316 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go +++ b/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go @@ -1532,6 +1532,7 @@ type ICloudWafRule interface { GetDesc() string GetGlobalId() string GetPriority() int + GetType() string GetAction() *DefaultAction GetStatementCondition() TWafStatementCondition GetStatements() ([]SWafStatement, error) diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/aliyun/waf_domain.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/aliyun/waf_domain.go index dfe554b205..44bc9cd9d7 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/aliyun/waf_domain.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/aliyun/waf_domain.go @@ -233,6 +233,10 @@ func (self *ManagedRuleGroup) GetName() string { return "RuleGroup" } +func (self *ManagedRuleGroup) GetType() string { + return "RuleGroup" +} + func (self *ManagedRuleGroup) GetDesc() string { return "规则组" } @@ -316,6 +320,10 @@ func (self *SDefenseTypeRule) GetName() string { return self.defenseType } +func (self *SDefenseTypeRule) GetType() string { + return self.defenseType +} + func (self *SDefenseTypeRule) GetDesc() string { return "" } diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/aws/waf_rules.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/aws/waf_rules.go index 53a0189dae..a95743bcd6 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/aws/waf_rules.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/aws/waf_rules.go @@ -23,6 +23,7 @@ import ( "yunion.io/x/pkg/errors" "yunion.io/x/pkg/utils" + api "yunion.io/x/cloudmux/pkg/apis/compute" "yunion.io/x/cloudmux/pkg/cloudprovider" ) @@ -49,6 +50,10 @@ func (self *sWafRule) GetDesc() string { return "" } +func (self *sWafRule) GetType() string { + return api.WAF_RULE_TYPE_CUSTOM +} + func (self *sWafRule) GetName() string { return *self.Rule.Name } diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/azure/waf.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/azure/waf.go index abb5f28606..e33c14550a 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/azure/waf.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/azure/waf.go @@ -56,6 +56,10 @@ func (self *CustomRule) GetName() string { return self.Name } +func (self *CustomRule) GetType() string { + return api.WAF_RULE_TYPE_CUSTOM +} + func (self *CustomRule) GetGlobalId() string { return fmt.Sprintf("%s-%s", self.waf.GetGlobalId(), self.GetName()) } @@ -322,6 +326,10 @@ type ManagedRules struct { Managedrulesets []ManagedRule `json:"managedRuleSets"` } +func (self *ManagedRules) GetType() string { + return api.WAF_RULE_TYPE_TEMPLATE +} + func (self *ManagedRules) GetName() string { return fmt.Sprintf("%s Managed rules", self.waf.GetName()) } diff --git a/vendor/yunion.io/x/sqlchemy/reflect.go b/vendor/yunion.io/x/sqlchemy/reflect.go index ddba6381f8..27c84d4509 100644 --- a/vendor/yunion.io/x/sqlchemy/reflect.go +++ b/vendor/yunion.io/x/sqlchemy/reflect.go @@ -15,6 +15,7 @@ package sqlchemy import ( + "database/sql" "fmt" "reflect" "strconv" @@ -382,35 +383,80 @@ func ConvertValueToBool(val interface{}) bool { case float64: return v > 0 case *string: + if gotypes.IsNil(v) { + return false + } nv := strings.ToLower(*v) return nv == "1" || nv == "true" || nv == "ok" || nv == "yes" || nv == "on" case *bool: + if gotypes.IsNil(v) { + return false + } return *v case *tristate.TriState: + if gotypes.IsNil(v) { + return false + } return *v == tristate.True case *int8: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *int16: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *int: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *int32: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *int64: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *uint8: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *uint16: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *uint: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *uint32: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *uint64: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *float32: + if gotypes.IsNil(v) { + return false + } return *v > 0 case *float64: + if gotypes.IsNil(v) { + return false + } return *v > 0 } return false @@ -435,115 +481,99 @@ func ConvertValueToTriState(val interface{}) tristate.TriState { } else { return tristate.False } + case sql.NullInt32: + if v.Valid { + return ConvertValueToTriState(v.Int32) + } + return tristate.None case int8: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case int16: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case int: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case int32: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case int64: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case uint8: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case uint16: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case uint: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case uint32: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case uint64: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case float32: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case float64: switch { case v > 0: return tristate.True - case v < 0: - return tristate.False default: - return tristate.None + return tristate.False } case *string: + if gotypes.IsNil(v) { + return tristate.None + } switch strings.ToLower(*v) { case "true", "yes", "on", "ok", "1": return tristate.True @@ -553,6 +583,9 @@ func ConvertValueToTriState(val interface{}) tristate.TriState { return tristate.False } case *bool: + if gotypes.IsNil(v) { + return tristate.None + } if *v { return tristate.True } else { @@ -561,104 +594,113 @@ func ConvertValueToTriState(val interface{}) tristate.TriState { case *tristate.TriState: return *v case *int8: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } + case *int16: + if gotypes.IsNil(v) { + return tristate.None + } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *int: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *int32: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *int64: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *uint8: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *uint16: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *uint: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *uint32: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *uint64: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } case *float32: - switch { - case *v > 0: - return tristate.True - case *v < 0: - return tristate.False - default: + if gotypes.IsNil(v) { return tristate.None } - case *float64: - switch { - case *v > 0: + if *v > 0 { return tristate.True - case *v < 0: + } else { return tristate.False - default: + } + case *float64: + if gotypes.IsNil(v) { return tristate.None } + if *v > 0 { + return tristate.True + } else { + return tristate.False + } } return tristate.None }