fix(region): vendor update (#18540)

This commit is contained in:
屈轩
2023-11-01 19:13:36 +08:00
committed by GitHub
parent 96a5eab116
commit 80f2d22b7e
5 changed files with 47 additions and 44 deletions
+2 -2
View File
@@ -83,12 +83,12 @@ 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.20231101101511-84cd9015cb57
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231101105700-645ed1a2181f
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900
yunion.io/x/pkg v1.0.1-0.20231031115900-08d23f61bcc3
yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v1.1.2-0.20231017172907-561e7f013926
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
+4 -4
View File
@@ -1179,8 +1179,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.20231101101511-84cd9015cb57 h1:qA0jIVE7pdmPRIDWslK77ajeKOdWig3CR8GTeUai3yA=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231101101511-84cd9015cb57/go.mod h1:McRjoG2gaOUisB+Qa41kLCNZhr0lsCu4apEjTiphXVY=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231101105700-645ed1a2181f h1:dCQAA/WrYAVkjILu3yl6hKkzQ0VPdMfoTlz9TtC2VBg=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231101105700-645ed1a2181f/go.mod h1:McRjoG2gaOUisB+Qa41kLCNZhr0lsCu4apEjTiphXVY=
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=
@@ -1194,8 +1194,8 @@ yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900 h1:Hu/4ERvoWaN6aiFs4h4/yvVB
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900/go.mod h1:0vLkNEhlmA64HViPBAnSTUMrx5QP1CLsxXmxDKQ80tc=
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v1.0.1-0.20231031115900-08d23f61bcc3 h1:VFVZECQEaxe30nt89YgUpaYvJKtL2yAILGW+gdDdn7c=
yunion.io/x/pkg v1.0.1-0.20231031115900-08d23f61bcc3/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142 h1:L6LqxfP08eWUx+A6yQdrL6VB3KILU1TbQllPtKZq7PM=
yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
yunion.io/x/sqlchemy v1.1.2-0.20231017172907-561e7f013926 h1:FJ+2J0MwmxUcuN/8ukWHdK2XIoV3GGCotTCgi0w4L+w=
+2 -2
View File
@@ -1438,7 +1438,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.20231101101511-84cd9015cb57
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231101105700-645ed1a2181f
## explicit; go 1.18
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
@@ -1539,7 +1539,7 @@ yunion.io/x/log/hooks
yunion.io/x/ovsdb/cli_util
yunion.io/x/ovsdb/schema/ovn_nb
yunion.io/x/ovsdb/types
# yunion.io/x/pkg v1.0.1-0.20231031115900-08d23f61bcc3
# yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142
## explicit; go 1.18
yunion.io/x/pkg/appctx
yunion.io/x/pkg/errors
+18 -21
View File
@@ -61,22 +61,23 @@ type SLoadbalancer struct {
subnet *SNetwork
eip *SEipAddress
Description string `json:"description"`
ProvisioningStatus string `json:"provisioning_status"`
TenantId string `json:"tenant_id"`
ProjectId string `json:"project_id"`
AdminStateUp bool `json:"admin_state_up"`
Provider string `json:"provider"`
Pools []Pool `json:"pools"`
Listeners []Listener `json:"listeners"`
VipPortId string `json:"vip_port_id"`
OperatingStatus string `json:"operating_status"`
VipAddress string `json:"vip_address"`
VipSubnetId string `json:"vip_subnet_id"`
Id string `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Description string `json:"description"`
ProvisioningStatus string `json:"provisioning_status"`
TenantId string `json:"tenant_id"`
ProjectId string `json:"project_id"`
EnterpriseProjectId string `json:"enterprise_project_id"`
AdminStateUp bool `json:"admin_state_up"`
Provider string `json:"provider"`
Pools []Pool `json:"pools"`
Listeners []Listener `json:"listeners"`
VipPortId string `json:"vip_port_id"`
OperatingStatus string `json:"operating_status"`
VipAddress string `json:"vip_address"`
VipSubnetId string `json:"vip_subnet_id"`
Id string `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Listener struct {
@@ -120,12 +121,8 @@ func (self *SLoadbalancer) Refresh() error {
return jsonutils.Update(self, lb)
}
func (self *SLoadbalancer) IsEmulated() bool {
return false
}
func (self *SLoadbalancer) GetProjectId() string {
return self.ProjectId
return self.EnterpriseProjectId
}
func (self *SLoadbalancer) GetAddress() string {
+21 -15
View File
@@ -417,12 +417,13 @@ const (
)
var privateIPRanges []IPV4AddrRange
var customizedPrivateIPRanges []IPV4AddrRange
var hostLocalIPRange IPV4AddrRange
var linkLocalIPRange IPV4AddrRange
var multicastIPRange IPV4AddrRange
func init() {
updatePrivateIPRanges(nil)
initPrivateIPRanges()
prefix, _ := NewIPV4Prefix(hostlocalPrefix)
hostLocalIPRange = prefix.ToIPRange()
@@ -432,17 +433,15 @@ func init() {
multicastIPRange = prefix.ToIPRange()
}
func updatePrivateIPRanges(prefs []string) {
if len(prefs) == 0 {
// https://zh.wikipedia.org/wiki/%E4%BF%9D%E7%95%99IP%E5%9C%B0%E5%9D%80
prefs = []string{
"10.0.0.0/8",
"100.64.0.0/10",
"172.16.0.0/12",
"192.0.0.0/24",
"198.18.0.0/15",
"192.168.0.0/16",
}
func initPrivateIPRanges() {
// https://zh.wikipedia.org/wiki/%E4%BF%9D%E7%95%99IP%E5%9C%B0%E5%9D%80
prefs := []string{
"10.0.0.0/8",
"100.64.0.0/10",
"172.16.0.0/12",
"192.0.0.0/24",
"198.18.0.0/15",
"192.168.0.0/16",
}
privateIPRanges = make([]IPV4AddrRange, len(prefs))
for i, prefix := range prefs {
@@ -455,15 +454,22 @@ func updatePrivateIPRanges(prefs []string) {
}
func SetPrivatePrefixes(pref []string) {
updatePrivateIPRanges(pref)
customizedPrivateIPRanges = make([]IPV4AddrRange, 0)
for _, prefix := range pref {
prefix, err := NewIPV4Prefix(prefix)
if err != nil {
continue
}
customizedPrivateIPRanges = append(customizedPrivateIPRanges, prefix.ToIPRange())
}
}
func GetPrivateIPRanges() []IPV4AddrRange {
return privateIPRanges
return append(privateIPRanges, customizedPrivateIPRanges...)
}
func IsPrivate(addr IPV4Addr) bool {
for _, ipRange := range privateIPRanges {
for _, ipRange := range GetPrivateIPRanges() {
if ipRange.Contains(addr) {
return true
}