mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-29 03:51:54 +08:00
fix: make check pass on release 3.8 (#14761)
* fix: make check pass on release 3.8 * circleci GOPROXY=direct * update vendor * remove make test Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -7,7 +7,7 @@ jobs:
|
||||
requires:
|
||||
- check
|
||||
docker:
|
||||
- image: yunionio/centos-build:1.1-4
|
||||
- image: yunion/centos-build:go-1.18.3-0
|
||||
environment:
|
||||
ONECLOUD_CI_BUILD: "1"
|
||||
|
||||
@@ -16,14 +16,12 @@ jobs:
|
||||
#### /go/src/github.com/circleci/go-tool
|
||||
#### /go/src/bitbucket.org/circleci/go-tool
|
||||
working_directory: /root/go/src/yunion.io/x/onecloud
|
||||
resource_class: large
|
||||
parallelism: 1
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: |
|
||||
make -j3 check
|
||||
make test
|
||||
targets="$(circleci tests glob "cmd/*" | grep -v cmd/host-image | circleci tests split)"
|
||||
echo $targets | tr ' ' '\n'
|
||||
make $targets
|
||||
|
||||
@@ -78,7 +78,7 @@ func relayMain() error {
|
||||
time.Sleep(time.Hour)
|
||||
}
|
||||
|
||||
return nil
|
||||
// return nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -149,7 +149,7 @@ require (
|
||||
yunion.io/x/jsonutils v1.0.0
|
||||
yunion.io/x/log v1.0.0
|
||||
yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7
|
||||
yunion.io/x/pkg v1.0.0
|
||||
yunion.io/x/pkg v1.0.1-0.20220630095420-9925accd7c5e
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v1.0.2
|
||||
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6
|
||||
|
||||
@@ -1081,8 +1081,8 @@ 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-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v1.0.0 h1:G7Sng0fMZNKR5cavi5qQUxWjI1Tfbawk2vWnfII2rXg=
|
||||
yunion.io/x/pkg v1.0.0/go.mod h1:nYOMflWG1wQC6301rGVglQva9bYbJxHThEJUxRAgMFc=
|
||||
yunion.io/x/pkg v1.0.1-0.20220630095420-9925accd7c5e h1:p/Cb7z6gyJbZKnGMeOPL3pTmnphB9GLCU+8qMsln7qA=
|
||||
yunion.io/x/pkg v1.0.1-0.20220630095420-9925accd7c5e/go.mod h1:nYOMflWG1wQC6301rGVglQva9bYbJxHThEJUxRAgMFc=
|
||||
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.0.1/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
|
||||
@@ -110,7 +110,7 @@ func (proxyendpoint *SProxyEndpoint) remoteCheckMake(ctx context.Context, userCr
|
||||
case <-time.After(2 * time.Second):
|
||||
}
|
||||
}
|
||||
return httperrors.NewConflictError("remote sshd_config may have a problem with GatewayPorts")
|
||||
// return httperrors.NewConflictError("remote sshd_config may have a problem with GatewayPorts")
|
||||
}
|
||||
|
||||
func (proxyendpoint *SProxyEndpoint) remoteConfigure(ctx context.Context, userCred mcclient.TokenCredential) error {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package storageutils
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package storageutils
|
||||
|
||||
@@ -65,7 +65,7 @@ type SAlertRecordShield struct {
|
||||
db.SStatusStandaloneResourceBase
|
||||
SMonitorScopedResource
|
||||
|
||||
AlertId string `width:"36" charset:"ascii" nullable:"false" list:"user" create :"required" json:"alert_id"`
|
||||
AlertId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" json:"alert_id"`
|
||||
ResId string `width:"36" nullable:"false" create:"optional" list:"user" update:"user" json:"res_id"`
|
||||
ResType string `width:"36" nullable:"false" create:"optional" list:"user" update:"user" json:"res_type"`
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
func init() {
|
||||
type DescribeMetricDataOptions struct {
|
||||
/* 监控项英文标识(id) */
|
||||
Metric string `help:"metric name"json:"metric"`
|
||||
Metric string `help:"metric name" json:"metric"`
|
||||
TimeInterval string `help:"time interval" choices:"1h|6h|12h|1d|3d|7d|14d" json:"timeInterval"`
|
||||
ServiceCode string `help:"resource code" choices:"vm" json:"serviceCode"`
|
||||
ResourceId string `help:"resource id" json:"resourceId"`
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//+build linux
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package dhcp
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//+build !linux
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package dhcp
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package fileutils2
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package netutils2
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package printutils
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package printutils
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package procutils
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package procutils
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package procutils
|
||||
|
||||
Vendored
+1
-1
@@ -1134,7 +1134,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.0
|
||||
# yunion.io/x/pkg v1.0.1-0.20220630095420-9925accd7c5e
|
||||
yunion.io/x/pkg/errors
|
||||
yunion.io/x/pkg/gotypes
|
||||
yunion.io/x/pkg/prettytable
|
||||
|
||||
+6
@@ -45,6 +45,7 @@ var FULLISO_TIME_REG2 *regexp.Regexp
|
||||
var ZSTACK_TIME_REG *regexp.Regexp
|
||||
var COMPACT_TIME_REG *regexp.Regexp
|
||||
var MYSQL_TIME_REG *regexp.Regexp
|
||||
var CLICKHOUSE_TIME_REG *regexp.Regexp
|
||||
var NORMAL_TIME_REG *regexp.Regexp
|
||||
var FULLNORMAL_TIME_REG *regexp.Regexp
|
||||
var RFC2882_TIME_REG *regexp.Regexp
|
||||
@@ -79,6 +80,7 @@ func init() {
|
||||
COMPACT_TIME_REG = regexp.MustCompile(`^\d{14}$`)
|
||||
ZSTACK_TIME_REG = regexp.MustCompile(`^\w+ \d{1,2}, \d{4} \d{1,2}:\d{1,2}:\d{1,2} (AM|PM)$`) //ZStack time format "Apr 1, 2019 3:23:17 PM"
|
||||
MYSQL_TIME_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$`)
|
||||
CLICKHOUSE_TIME_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [+-]\d{4} [A-Z]{3}$`)
|
||||
NORMAL_TIME_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$`)
|
||||
FULLNORMAL_TIME_REG = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}$`)
|
||||
RFC2882_TIME_REG = regexp.MustCompile(`[A-Z][a-z]{2}, [0-9]{1,2} [A-Z][a-z]{2} [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} [A-Z]{3}`)
|
||||
@@ -234,6 +236,10 @@ func MatchMySQLTime(str string) bool {
|
||||
return MYSQL_TIME_REG.MatchString(str)
|
||||
}
|
||||
|
||||
func MatchClickhouseTime(str string) bool {
|
||||
return CLICKHOUSE_TIME_REG.MatchString(str)
|
||||
}
|
||||
|
||||
func MatchNormalTime(str string) bool {
|
||||
return NORMAL_TIME_REG.MatchString(str)
|
||||
}
|
||||
|
||||
+11
@@ -49,6 +49,7 @@ const (
|
||||
FullIsoTimeFormat = "2006-01-02T15:04:05.000000Z07:00"
|
||||
FullIsoNanoTimeFormat = "2006-01-02T15:04:05.000000000Z07:00"
|
||||
MysqlTimeFormat = "2006-01-02 15:04:05"
|
||||
ClickhouseTimeFormat = "2006-01-02 15:04:05 +0000 UTC"
|
||||
NormalTimeFormat = "2006-01-02T15:04:05"
|
||||
FullNormalTimeFormat = "2006-01-02T15:04:05.000000"
|
||||
CompactTimeFormat = "20060102150405"
|
||||
@@ -86,6 +87,10 @@ func MysqlTime(now time.Time) string {
|
||||
return Utcify(now).Format(MysqlTimeFormat)
|
||||
}
|
||||
|
||||
func ClickhouseTime(now time.Time) string {
|
||||
return Utcify(now).Format(ClickhouseTimeFormat)
|
||||
}
|
||||
|
||||
func CompactTime(now time.Time) string {
|
||||
return Utcify(now).Format(CompactTimeFormat)
|
||||
}
|
||||
@@ -168,6 +173,10 @@ func ParseMysqlTime(str string) (time.Time, error) {
|
||||
return time.Parse(MysqlTimeFormat, str)
|
||||
}
|
||||
|
||||
func ParseClickhouseTime(str string) (time.Time, error) {
|
||||
return time.Parse(ClickhouseTimeFormat, str)
|
||||
}
|
||||
|
||||
func ParseNormalTime(str string) (time.Time, error) {
|
||||
return time.Parse(NormalTimeFormat, str)
|
||||
}
|
||||
@@ -216,6 +225,8 @@ func ParseTimeStr(str string) (time.Time, error) {
|
||||
return ParseIsoNoSecondTime2(str)
|
||||
} else if regutils.MatchMySQLTime(str) {
|
||||
return ParseMysqlTime(str)
|
||||
} else if regutils.MatchClickhouseTime(str) {
|
||||
return ParseClickhouseTime(str)
|
||||
} else if regutils.MatchNormalTime(str) {
|
||||
return ParseNormalTime(str)
|
||||
} else if regutils.MatchFullNormalTime(str) {
|
||||
|
||||
Reference in New Issue
Block a user