mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-31 01:35:56 +08:00
update vendor
This commit is contained in:
@@ -144,9 +144,9 @@ require (
|
||||
yunion.io/x/jsonutils v0.0.0-20201022101715-4e3add1ac4aa
|
||||
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
|
||||
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6
|
||||
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v0.0.0-20201014101037-8fe75542e6d8
|
||||
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
|
||||
)
|
||||
|
||||
|
||||
@@ -1136,9 +1136,11 @@ yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZV
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6 h1:UarEDTBGkgcgc+nc+PZ75uo9M9+jiOGd5P2B90TxDNw=
|
||||
yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc h1:cgwWI6k9LsXpq6yiOuEIprsXmPyPGUa60sOZu57e8Jo=
|
||||
yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
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 v0.0.0-20201014101037-8fe75542e6d8 h1:AkPrqO37Yi3aICys9qDjTlSdVVGh2pWQ8ET+dSJmhoI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20201014101037-8fe75542e6d8/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b h1:xBAzDPvvmsOBjxAj0PLHMNLVdPNOlYFHAm7T3IZ2ehs=
|
||||
yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce h1:kU8xE7O5uZ1GSJVMZHoJ+jrNL7csUQHYGyAPW9QfNpE=
|
||||
yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
Vendored
+2
-2
@@ -1077,7 +1077,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 v0.0.0-20200814072949-4f1b541857d6
|
||||
# yunion.io/x/pkg v0.0.0-20201028134817-3ed15ee169bc
|
||||
yunion.io/x/pkg/errors
|
||||
yunion.io/x/pkg/gotypes
|
||||
yunion.io/x/pkg/prettytable
|
||||
@@ -1110,7 +1110,7 @@ yunion.io/x/pkg/util/workqueue
|
||||
yunion.io/x/pkg/utils
|
||||
# yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/s3cli
|
||||
# yunion.io/x/sqlchemy v0.0.0-20201014101037-8fe75542e6d8
|
||||
# yunion.io/x/sqlchemy v0.0.0-20201029091740-cd5e77b56d4b
|
||||
yunion.io/x/sqlchemy
|
||||
# yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce
|
||||
yunion.io/x/structarg
|
||||
|
||||
+8
-4
@@ -97,8 +97,10 @@ func CompareSets(dbSet interface{}, extSet interface{}, removed interface{}, com
|
||||
i += 1
|
||||
j += 1
|
||||
} else if cmp < 0 {
|
||||
newVal := reflect.Append(removedValue, dbSetArray[i].value)
|
||||
removedValue.Set(newVal)
|
||||
if len(dbSetArray[i].key) > 0 {
|
||||
newVal := reflect.Append(removedValue, dbSetArray[i].value)
|
||||
removedValue.Set(newVal)
|
||||
}
|
||||
i += 1
|
||||
} else {
|
||||
newVal := reflect.Append(addedValue, extSetArray[j].value)
|
||||
@@ -110,8 +112,10 @@ func CompareSets(dbSet interface{}, extSet interface{}, removed interface{}, com
|
||||
addedValue.Set(newVal)
|
||||
j += 1
|
||||
} else if j >= len(extSetArray) {
|
||||
newVal := reflect.Append(removedValue, dbSetArray[i].value)
|
||||
removedValue.Set(newVal)
|
||||
if len(dbSetArray[i].key) > 0 {
|
||||
newVal := reflect.Append(removedValue, dbSetArray[i].value)
|
||||
removedValue.Set(newVal)
|
||||
}
|
||||
i += 1
|
||||
}
|
||||
}
|
||||
|
||||
+28
-11
@@ -416,23 +416,14 @@ const (
|
||||
multicastPrefix = "224.0.0.0/4"
|
||||
)
|
||||
|
||||
var privatePrefixes = []string{
|
||||
"10.0.0.0/8",
|
||||
"172.16.0.0/12",
|
||||
"192.168.0.0/16",
|
||||
}
|
||||
|
||||
var privateIPRanges []IPV4AddrRange
|
||||
var hostLocalIPRange IPV4AddrRange
|
||||
var linkLocalIPRange IPV4AddrRange
|
||||
var multicastIPRange IPV4AddrRange
|
||||
|
||||
func init() {
|
||||
privateIPRanges = make([]IPV4AddrRange, len(privatePrefixes))
|
||||
for i, prefix := range privatePrefixes {
|
||||
prefix, _ := NewIPV4Prefix(prefix)
|
||||
privateIPRanges[i] = prefix.ToIPRange()
|
||||
}
|
||||
updatePrivateIPRanges(nil)
|
||||
|
||||
prefix, _ := NewIPV4Prefix(hostlocalPrefix)
|
||||
hostLocalIPRange = prefix.ToIPRange()
|
||||
prefix, _ = NewIPV4Prefix(linklocalPrefix)
|
||||
@@ -441,6 +432,32 @@ func init() {
|
||||
multicastIPRange = prefix.ToIPRange()
|
||||
}
|
||||
|
||||
func updatePrivateIPRanges(prefs []string) {
|
||||
if len(prefs) == 0 {
|
||||
prefs = []string{
|
||||
"10.0.0.0/8",
|
||||
"172.16.0.0/12",
|
||||
"192.168.0.0/16",
|
||||
}
|
||||
}
|
||||
privateIPRanges = make([]IPV4AddrRange, len(prefs))
|
||||
for i, prefix := range prefs {
|
||||
prefix, err := NewIPV4Prefix(prefix)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
privateIPRanges[i] = prefix.ToIPRange()
|
||||
}
|
||||
}
|
||||
|
||||
func SetPrivatePrefixes(pref []string) {
|
||||
updatePrivateIPRanges(pref)
|
||||
}
|
||||
|
||||
func GetPrivateIPRanges() []IPV4AddrRange {
|
||||
return privateIPRanges
|
||||
}
|
||||
|
||||
func IsPrivate(addr IPV4Addr) bool {
|
||||
for _, ipRange := range privateIPRanges {
|
||||
if ipRange.Contains(addr) {
|
||||
|
||||
+5
@@ -19,6 +19,7 @@ import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"yunion.io/x/log"
|
||||
@@ -153,6 +154,10 @@ func (sq *SSubQuery) Expression() string {
|
||||
for k := range sq.referedFields {
|
||||
fields = append(fields, sq.referedFields[k])
|
||||
}
|
||||
// Make sure the order of the fields
|
||||
sort.Slice(fields, func(i, j int) bool {
|
||||
return fields[i].Name() < fields[j].Name()
|
||||
})
|
||||
return fmt.Sprintf("(%s)", sq.query.String(fields...))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user