Skip to content

Commit

Permalink
update vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
tangbin committed Jul 9, 2020
1 parent b921d99 commit 13f44de
Show file tree
Hide file tree
Showing 30 changed files with 543 additions and 202 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ require (
k8s.io/cluster-bootstrap v0.17.3
k8s.io/kubernetes v1.16.0
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
yunion.io/x/jsonutils v0.0.0-20200701074723-fea7ff9d66b6
yunion.io/x/jsonutils v0.0.0-20200708073651-8fe00d01c40a
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-20200615071345-60a252beb982
yunion.io/x/pkg v0.0.0-20200708071451-a663dc94e16b
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v0.0.0-20200608080702-9b6683aa048c
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7
yunion.io/x/sqlchemy v0.0.0-20200702064124-195445bc4b11
yunion.io/x/structarg v0.0.0-20200708124353-ea9a441ecaf8
)

replace (
Expand Down
19 changes: 8 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1123,12 +1123,9 @@ vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74 h1:A15C6VdVRWvmQ9pAJHrUs9yan5qKlYH7uaRxHg1kRbk=
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
yunion.io/x/jsonutils v0.0.0-20200615014624-f9c3576579c9 h1:s7sobXxn4ckRHdjIaA91Rnfy2kreV/+dN3P2pQLg7F0=
yunion.io/x/jsonutils v0.0.0-20200615014624-f9c3576579c9/go.mod h1:T7kxQJR13+t7z0TuT+Wzd7MTxBOk2H9c0pO1ONQSv90=
yunion.io/x/jsonutils v0.0.0-20200701074723-fea7ff9d66b6 h1:QoboWGwBpiZ3YhNAjuV3PwzGl2JTsawEQ69GpXlMKUM=
yunion.io/x/jsonutils v0.0.0-20200701074723-fea7ff9d66b6/go.mod h1:T7kxQJR13+t7z0TuT+Wzd7MTxBOk2H9c0pO1ONQSv90=
yunion.io/x/jsonutils v0.0.0-20200708073651-8fe00d01c40a h1:hhqz19Rto658JUSp5FGjOfTsepKVT8Rdt/zsFiRVM2Q=
yunion.io/x/jsonutils v0.0.0-20200708073651-8fe00d01c40a/go.mod h1:T7kxQJR13+t7z0TuT+Wzd7MTxBOk2H9c0pO1ONQSv90=
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d h1:59zrDL7Ft+hDukguJRmLr/Gdu/9V75x+yX99ovZwfaA=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3 h1:5Wc5hkB8PtMudmHuzCyok960RuOa9I55imIGrigSdjs=
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
Expand All @@ -1137,11 +1134,11 @@ yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7/go.mod h1:0vLkNEhlmA64HViPB
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 v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200615071345-60a252beb982 h1:VnE92PZ2DOBn7qOKHHHPrwo4tPsjrxET/xDyWfMFQHI=
yunion.io/x/pkg v0.0.0-20200615071345-60a252beb982/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200708071451-a663dc94e16b h1:wwPzH8iMRYjtaSM2pBN7nOqeZxR4XW5wdz2VE1KH/Ug=
yunion.io/x/pkg v0.0.0-20200708071451-a663dc94e16b/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-20200608080702-9b6683aa048c h1:/i93mWSKLYUq8RsaXGbMpwwnkGi09wL/HdCBiexL/+c=
yunion.io/x/sqlchemy v0.0.0-20200608080702-9b6683aa048c/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7 h1:HjWH0gG/5KzvCxItnzRxizfAnMOvGcxPfsEOFwOGBhQ=
yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
yunion.io/x/sqlchemy v0.0.0-20200702064124-195445bc4b11 h1:srrssomGJLh4OaDaY/1so+2FUBjZxdwQx/1pZ6403YU=
yunion.io/x/sqlchemy v0.0.0-20200702064124-195445bc4b11/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
yunion.io/x/structarg v0.0.0-20200708124353-ea9a441ecaf8 h1:35Q2ce/gI2cuVhsuLS7WsL2K9SxwMEtWTopt/99iYsk=
yunion.io/x/structarg v0.0.0-20200708124353-ea9a441ecaf8/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
2 changes: 1 addition & 1 deletion pkg/compute/models/loadbalanceragents.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ func (lbagent *SLoadbalancerAgent) PerformHb(ctx context.Context, userCred mccli
lbagent.HbLastSeen = time.Now()
if jVer, err := data.Get("version"); err == nil {
if jVerStr, ok := jVer.(*jsonutils.JSONString); ok {
lbagent.Version = jVerStr.Value()
lbagent.Version, _ = jVerStr.GetString()
}
}
if ipV.IP != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/compute/models/loadbalancerlistenerrules.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func ValidateListenerRuleConditions(condition string) error {
return httperrors.NewInputParameterError("condition values limit (5 per rule). %d given.", conditionArray.Length())
}

cs := conditionArray.Value()
cs, _ := conditionArray.GetArray()
for i := range cs {
err := validateListenerRuleCondition(cs[i], limitations)
if err != nil {
Expand All @@ -129,7 +129,7 @@ func validateListenerRuleCondition(condition jsonutils.JSONObject, limitations *
return fmt.Errorf("invalid condition fromat,required dict. %#v", condition)
}

dict := conditionDict.Value()
dict, _ := conditionDict.GetMap()
field, ok := dict["field"]
if !ok {
return fmt.Errorf("parseCondition invalid condition, missing field: %#v", condition)
Expand Down Expand Up @@ -315,7 +315,7 @@ func parseConditionStringArrayValues(values jsonutils.JSONObject, limitations *m
return fmt.Errorf("parseConditionStringArrayValues invalid values format, required array: %#v", values)
}

vs := objs.Value()
vs, _ := objs.GetArray()
for i := range vs {
(*limitations)["rules"] = (*limitations)["rules"] - 1
if (*limitations)["rules"] < 0 {
Expand All @@ -337,7 +337,7 @@ func parseConditionDictArrayValues(values jsonutils.JSONObject, limitations *map
return fmt.Errorf("parseConditionDictArrayValues invalid values format, required array: %#v", values)
}

vs := objs.Value()
vs, _ := objs.GetArray()
for i := range vs {
(*limitations)["rules"] = (*limitations)["rules"] - 1
if (*limitations)["rules"] < 0 {
Expand Down
7 changes: 6 additions & 1 deletion pkg/hostman/guestman/guesttasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,13 @@ func (d *SGuestDiskSyncTask) changeCdrom() {
}

func (d *SGuestDiskSyncTask) onGetBlockInfo(results *jsonutils.JSONArray) {
if results == nil {
return
}

var cdName string
for _, r := range results.Value() {
rs, _ := results.GetArray()
for _, r := range rs {
device, _ := r.GetString("device")
if regexp.MustCompile(`^ide\d+-cd\d+$`).MatchString(device) {
cdName = device
Expand Down
3 changes: 2 additions & 1 deletion pkg/hostman/guestman/qemu-kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ func (s *SKVMGuestInstance) MirrorJobStatus() MirrorJob {
case v := <-res:
if v != nil && v.Length() >= s.DiskCount() {
mirrorSuccCount := 0
for _, val := range v.Value() {
vs, _ := v.GetArray()
for _, val := range vs {
jobType, _ := val.GetString("type")
jobStatus, _ := val.GetString("status")
if jobType == "mirror" && jobStatus == "ready" {
Expand Down
16 changes: 11 additions & 5 deletions pkg/hostman/hostmetrics/hostmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,17 @@ func (s *SGuestMonitorCollector) CollectReportData() (ret string) {

func (s *SGuestMonitorCollector) toTelegrafReportData(data *jsonutils.JSONDict) string {
ret := []string{}
for guestId, report := range data.Value() {
vs, _ := data.GetMap()
for guestId, report := range vs {
var vmName, vmIp, scalingGroupId string
if gm, ok := s.monitors[guestId]; ok {
vmName = gm.Name
vmIp = gm.Ip
scalingGroupId = gm.ScalingGroupId
}
for metrics, stat := range report.(*jsonutils.JSONDict).Value() {

rs, _ := report.(*jsonutils.JSONDict).GetMap()
for metrics, stat := range rs {
tags := map[string]string{
"vm_id": guestId, "vm_name": vmName, "vm_ip": vmIp,
"is_vm": "true", "platform": "kvm",
Expand All @@ -241,7 +244,8 @@ func (s *SGuestMonitorCollector) toTelegrafReportData(data *jsonutils.JSONDict)
line := s.addTelegrafLine(metrics, tags, val)
ret = append(ret, line)
} else if val, ok := stat.(*jsonutils.JSONArray); ok {
for _, statItem := range val.Value() {
ss, _ := val.GetArray()
for _, statItem := range ss {
line := s.addTelegrafLine(metrics, tags, statItem.(*jsonutils.JSONDict))
ret = append(ret, line)
}
Expand All @@ -267,15 +271,17 @@ func (s *SGuestMonitorCollector) addTelegrafLine(
tagStr := strings.Join(tagArr, ",")

var statArr = []string{}
for k, v := range stat.Value() {
ss, _ := stat.GetMap()
for k, v := range ss {
statArr = append(statArr, fmt.Sprintf("%s=%s", k, v.String()))
}
statStr := strings.Join(statArr, ",")
return fmt.Sprintf("%s,%s %s", metrics, tagStr, statStr)
}

func (s *SGuestMonitorCollector) cleanedPrevData(gms map[string]*SGuestMonitor) {
for guestId := range s.prevReportData.Value() {
rs, _ := s.prevReportData.GetMap()
for guestId := range rs {
if gm, ok := gms[guestId]; !ok {
s.prevReportData.Remove(guestId)
delete(s.prevPids, guestId)
Expand Down
19 changes: 10 additions & 9 deletions pkg/monitor/models/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ func getAttributesOnMeasurement(database, tp string, output *monitor.InfluxMeasu
tmpDict := jsonutils.NewDict()
tmpArr := jsonutils.NewArray()
for i := range res.Values {
if filterTagKey(res.Values[i][0].(*jsonutils.JSONString).Value()) {
v, _ := res.Values[i][0].(*jsonutils.JSONString).GetString()
if filterTagKey(v) {
continue
}
tmpArr.Add(res.Values[i][0])
Expand All @@ -362,19 +363,19 @@ func getTagValue(database string, output *monitor.InfluxMeasurement, db *influxd
tagValue := make(map[string][]string, 0)
keys := strings.Join(output.TagKey, ",")
for i := range res.Values {
val := res.Values[i][0].(*jsonutils.JSONString)
if !strings.Contains(keys, val.Value()) {
val, _ := res.Values[i][0].(*jsonutils.JSONString).GetString()
if !strings.Contains(keys, val) {
continue
}
if _, ok := tagValue[val.Value()]; !ok {
tagValue[val.Value()] = make([]string, 0)
if _, ok := tagValue[val]; !ok {
tagValue[val] = make([]string, 0)
}
tag := res.Values[i][1].(*jsonutils.JSONString)
if filterTagValue(tag.Value()) {
delete(tagValue, val.Value())
tag, _ := res.Values[i][1].(*jsonutils.JSONString).GetString()
if filterTagValue(tag) {
delete(tagValue, val)
continue
}
tagValue[val.Value()] = append(tagValue[val.Value()], tag.Value())
tagValue[val] = append(tagValue[val], tag)
}
output.TagValue = tagValue
//TagKey == TagValue.keys
Expand Down
4 changes: 2 additions & 2 deletions pkg/monitor/suggestsysdrivers/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ func getResourceObjLogOfAction(param logInput) []jsonutils.JSONObject {
list, err := mod.Logs.List(session, jsonutils.Marshal(&param))
if err != nil {
log.Errorln("get Logs err", err)
return jsonutils.NewArray().Value()
return []jsonutils.JSONObject{}
}
if list == nil || len(list.Data) == 0 {
return jsonutils.NewArray().Value()
return []jsonutils.JSONObject{}
}
return list.Data
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/monitor/suggestsysdrivers/diskunused.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ func (rule *DiskUnused) Run(setting *monitor.SSuggestSysAlertSetting) {
log.Errorln(errors.Wrap(err, "DiskUnused getLatestAlerts error"))
return
}
DealAlertData(rule.GetType(), oldAlert, newAlerts.Value())

na, _ := newAlerts.GetArray()
DealAlertData(rule.GetType(), oldAlert, na)
}

func (rule *DiskUnused) getLatestAlerts(instance *monitor.SSuggestSysAlertSetting) (*jsonutils.JSONArray, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/monitor/suggestsysdrivers/eipunused.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ func (rule *EIPUnused) Run(instance *monitor.SSuggestSysAlertSetting) {
return
}

DealAlertData(rule.GetType(), oldAlert, newAlert.Value())
na, _ := newAlert.GetArray()
DealAlertData(rule.GetType(), oldAlert, na)
}

func (rule *EIPUnused) getEIPUnused(instance *monitor.SSuggestSysAlertSetting) (*jsonutils.JSONArray, error) {
Expand Down
4 changes: 3 additions & 1 deletion pkg/monitor/suggestsysdrivers/lbunused.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func (rule *LBUnused) Run(instance *monitor.SSuggestSysAlertSetting) {
log.Errorln(errors.Wrap(err, "getEIPUnused error"))
return
}
DealAlertData(rule.GetType(), oldAlert, newAlert.Value())

na, _ := newAlert.GetArray()
DealAlertData(rule.GetType(), oldAlert, na)
}

func (rule *LBUnused) getLatestAlerts(instance *monitor.SSuggestSysAlertSetting) (*jsonutils.JSONArray, error) {
Expand Down
5 changes: 4 additions & 1 deletion pkg/monitor/suggestsysdrivers/scaledown.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func (rule *ScaleDown) Run(instance *monitor.SSuggestSysAlertSetting) {
log.Errorln(err)
return
}
DealAlertData(rule.GetType(), oldAlert, newAlert.Value())

na, _ := newAlert.GetArray()
DealAlertData(rule.GetType(), oldAlert, na)
}

func (rule *ScaleDown) getLatestAlerts(instance *monitor.SSuggestSysAlertSetting) (*jsonutils.JSONArray, error) {
Expand Down Expand Up @@ -205,6 +207,7 @@ func (rule *ScaleDown) getResourcesByEvalMatchsMap(evalMatchsMap map[string][]*m
suggestSysAlert.Problem = describeEvalResultTojson(evalMatchsMap, mappingId, mappingVal)
serverArr.Add(jsonutils.Marshal(suggestSysAlert))
}

return serverArr, nil
}

Expand Down
13 changes: 7 additions & 6 deletions pkg/multicloud/aws/loadbalancerlistenerrule.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func parseConditions(conditions string) ([]*elbv2.RuleCondition, error) {
}

ret := []*elbv2.RuleCondition{}
cs := conditionArray.Value()
cs, _ := conditionArray.GetArray()
for i := range cs {
c, err := parseCondition(cs[i])
if err != nil {
Expand All @@ -253,7 +253,7 @@ func parseCondition(condition jsonutils.JSONObject) (*elbv2.RuleCondition, error
return nil, fmt.Errorf("parseCondition invalid condition fromat.")
}

dict := conditionDict.Value()
dict, _ := conditionDict.GetMap()
field, ok := dict["field"]
if !ok {
return nil, fmt.Errorf("parseCondition invalid condition, missing field: %#v", condition)
Expand Down Expand Up @@ -297,8 +297,9 @@ func parseHttpHeaderCondition(conditon *jsonutils.JSONDict) (*elbv2.RuleConditio
return nil, fmt.Errorf("parseHttpHeaderCondition missing invalid data %#v", name)
}

headname, _ := nameObj.GetString()
config := &elbv2.HttpHeaderConditionConfig{}
config.SetHttpHeaderName(nameObj.Value())
config.SetHttpHeaderName(headname)

vs, ok := values["values"]
if !ok {
Expand Down Expand Up @@ -440,14 +441,14 @@ func parseConditionStringArrayValues(values jsonutils.JSONObject) ([]*string, er
}

ret := []*string{}
vs := objs.Value()
vs, _ := objs.GetArray()
for i := range vs {
v, ok := vs[i].(*jsonutils.JSONString)
if !ok {
return nil, fmt.Errorf("parseConditionStringArrayValues invalid value, required string: %#v", v)
}

_v := v.Value()
_v, _ := v.GetString()
ret = append(ret, &_v)
}

Expand All @@ -461,7 +462,7 @@ func parseConditionDictArrayValues(values jsonutils.JSONObject) ([]*elbv2.QueryS
}

ret := []*elbv2.QueryStringKeyValuePair{}
vs := objs.Value()
vs, _ := objs.GetArray()
for i := range vs {
v, ok := vs[i].(*jsonutils.JSONDict)
if !ok {
Expand Down
9 changes: 5 additions & 4 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ sigs.k8s.io/yaml
yunion.io/x/executor/apis
yunion.io/x/executor/client
yunion.io/x/executor/server
# yunion.io/x/jsonutils v0.0.0-20200701074723-fea7ff9d66b6
# yunion.io/x/jsonutils v0.0.0-20200708073651-8fe00d01c40a
yunion.io/x/jsonutils
# yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3
yunion.io/x/log
Expand All @@ -1016,10 +1016,11 @@ 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-20200615071345-60a252beb982
# yunion.io/x/pkg v0.0.0-20200708071451-a663dc94e16b
yunion.io/x/pkg/errors
yunion.io/x/pkg/gotypes
yunion.io/x/pkg/prettytable
yunion.io/x/pkg/sortedmap
yunion.io/x/pkg/trace
yunion.io/x/pkg/tristate
yunion.io/x/pkg/util/cache
Expand Down Expand Up @@ -1048,7 +1049,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-20200608080702-9b6683aa048c
# yunion.io/x/sqlchemy v0.0.0-20200702064124-195445bc4b11
yunion.io/x/sqlchemy
# yunion.io/x/structarg v0.0.0-20200619020316-f93fbe32ffc7
# yunion.io/x/structarg v0.0.0-20200708124353-ea9a441ecaf8
yunion.io/x/structarg

0 comments on commit 13f44de

Please sign in to comment.