diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index 440d3ed0a0b..df111cda786 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.13.15 + go-version: 1.18.1 - uses: actions/checkout@v2 - run: make clean build_linux working-directory: src/agent/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32a90e6448d..64f0426bc66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.13.15 + go-version: 1.18.1 - uses: actions/checkout@v2 - run: make clean build_linux working-directory: src/agent/ @@ -179,11 +179,10 @@ jobs: ${{ runner.os }}-codecc-gradle- - name: Gradle Build id: codecc-backend - uses: eskatos/gradle-command-action@v1 - with: - gradle-version: 4.6 - build-root-directory: src/backend/codecc - arguments: clean copyToRelease -DmavenRepoUrl="https://maven.aliyun.com/nexus/content/groups/public/" + working-directory: src/backend/codecc + run: | + chmod +x gradlew + ./gradlew clean copyToRelease -DmavenRepoUrl="https://maven.aliyun.com/nexus/content/groups/public/" - name: frontend id: codecc-frontend diff --git a/scripts/deploy-codecc/bk-codecc-start.sh b/scripts/deploy-codecc/bk-codecc-start.sh index c51d431745a..f136fe2dc4c 100755 --- a/scripts/deploy-codecc/bk-codecc-start.sh +++ b/scripts/deploy-codecc/bk-codecc-start.sh @@ -84,7 +84,7 @@ detect_main (){ # 检查服务启动成功. health接口为格式化后的, 要求整行匹配. check_springboot_up (){ local port="$1" - curl -m 1 -sf "http://127.0.0.1:$port/management/health" 2>/dev/null | grep -qx ' "status" : "UP",' + curl -m 1 -sf "http://127.0.0.1:$port/management/health" 2>/dev/null | grep -qx ' "status" : "UP"' } # 等待服务启动成功. wait_springboot_up (){ diff --git a/src/agent/Makefile b/src/agent/Makefile index f840577893d..fb22a64eb6a 100644 --- a/src/agent/Makefile +++ b/src/agent/Makefile @@ -1,23 +1,58 @@ BINDIR := $(CURDIR)/bin CMDDIR := $(CURDIR)/src/cmd -all: build_linux +all: build_linux build_linux_arm64 build_linux_mips64 build_macos build_macos_arm64 build_windows + +linux: build_linux build_linux_arm64 build_linux_mips64 + +windows: build_windows + build_linux: mkdir -p $(BINDIR) - go env - GO111MODULE=on go build -o $(BINDIR)/devopsDaemon_linux $(CMDDIR)/daemon - GO111MODULE=on go build -o $(BINDIR)/devopsAgent_linux $(CMDDIR)/agent - GO111MODULE=on go build -o $(BINDIR)/upgrader_linux $(CMDDIR)/upgrader - GO111MODULE=on go build -o $(BINDIR)/installer_linux $(CMDDIR)/installer + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BINDIR)/devopsDaemon_linux $(CMDDIR)/daemon/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BINDIR)/devopsAgent_linux $(CMDDIR)/agent/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BINDIR)/upgrader_linux $(CMDDIR)/upgrader/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BINDIR)/installer_linux $(CMDDIR)/installer/main.go + ls -la $(BINDIR) +build_linux_arm64: + mkdir -p $(BINDIR) + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BINDIR)/devopsDaemon_linux_arm64 $(CMDDIR)/daemon/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BINDIR)/devopsAgent_linux_arm64 $(CMDDIR)/agent/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BINDIR)/upgrader_linux_arm64 $(CMDDIR)/upgrader/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BINDIR)/installer_linux_arm64 $(CMDDIR)/installer/main.go + ls -la $(BINDIR) +build_linux_mips64: + mkdir -p $(BINDIR) + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -o $(BINDIR)/devopsDaemon_linux_mips64 $(CMDDIR)/daemon/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -o $(BINDIR)/devopsAgent_linux_mips64 $(CMDDIR)/agent/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -o $(BINDIR)/upgrader_linux_mips64 $(CMDDIR)/upgrader/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -o $(BINDIR)/installer_linux_mips64 $(CMDDIR)/installer/main.go ls -la $(BINDIR) + +# Telegraf 的 cpu和diskio 插件采集使用的 shirou 包需要开启cgo才可以在darwin情况下采集成功 build_macos: mkdir -p $(BINDIR) - go env - GO111MODULE=on go build -o $(BINDIR)/devopsDaemon_macos $(CMDDIR)/daemon - GO111MODULE=on go build -o $(BINDIR)/devopsAgent_macos $(CMDDIR)/agent - GO111MODULE=on go build -o $(BINDIR)/upgrader_macos $(CMDDIR)/upgrader - GO111MODULE=on go build -o $(BINDIR)/installer_macos $(CMDDIR)/installer + GO111MODULE=on CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o $(BINDIR)/devopsDaemon_macos $(CMDDIR)/daemon/main.go + GO111MODULE=on CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o $(BINDIR)/devopsAgent_macos $(CMDDIR)/agent/main.go + GO111MODULE=on CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o $(BINDIR)/upgrader_macos $(CMDDIR)/upgrader/main.go + GO111MODULE=on CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o $(BINDIR)/installer_macos $(CMDDIR)/installer/main.go + ls -la $(BINDIR) +build_macos_arm64: + mkdir -p $(BINDIR) + GO111MODULE=on CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o $(BINDIR)/devopsDaemon_macos_arm64 $(CMDDIR)/daemon/main.go + GO111MODULE=on CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o $(BINDIR)/devopsAgent_macos_arm64 $(CMDDIR)/agent/main.go + GO111MODULE=on CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o $(BINDIR)/upgrader_macos_arm64 $(CMDDIR)/upgrader/main.go + GO111MODULE=on CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o $(BINDIR)/installer_macos_arm64 $(CMDDIR)/installer/main.go ls -la $(BINDIR) + +build_windows: + mkdir -p $(BINDIR) + GO111MODULE=on CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -o $(BINDIR)/devopsDaemon.exe $(CMDDIR)/daemon/main_win.go + GO111MODULE=on CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -o $(BINDIR)/devopsAgent.exe $(CMDDIR)/agent/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -o $(BINDIR)/upgrader.exe $(CMDDIR)/upgrader/main.go + GO111MODULE=on CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -o $(BINDIR)/installer.exe $(CMDDIR)/installer/main.go + ls -la $(BINDIR) + clean: mkdir -p $(BINDIR) rm -f $(BINDIR)/* diff --git a/src/agent/README.md b/src/agent/README.md index e0aaffe12dc..c5153d9b99b 100644 --- a/src/agent/README.md +++ b/src/agent/README.md @@ -3,6 +3,7 @@ 构建Agent是指包含了agent进程监控和调度部分逻辑的代码,不包含与流水线交互的构建类业务逻辑代码,需要与另外一个worker(kotlin) 一起整合才能是完整的Agent包。 ## Agent二进制程序编译 + > 以下命令请在本目录执行 linux系统,执行命令 `make clean build_linux` @@ -23,10 +24,10 @@ windows编译,执行脚本 `build_windows.bat` 举例Linux, 其他系统依此类推。 -- scripts/linux/install.sh: agent安装脚本 -- scripts/linux/start.sh: agent启动脚本 -- scripts/linux/stop.sh: agent停止脚本 -- scripts/linux/uninstall.sh: agent卸载脚本 +- scripts/linux/install.sh: agent安装脚本 +- scripts/linux/start.sh: agent启动脚本 +- scripts/linux/stop.sh: agent停止脚本 +- scripts/linux/uninstall.sh: agent卸载脚本 diff --git a/src/agent/go.mod b/src/agent/go.mod index dd8586b48ab..2a5a07ac0d0 100644 --- a/src/agent/go.mod +++ b/src/agent/go.mod @@ -1,14 +1,72 @@ module github.com/Tencent/bk-ci/src/agent -go 1.13 +go 1.18 require ( - github.com/astaxie/beego v1.12.1 - github.com/gofrs/flock v0.7.1 - github.com/influxdata/telegraf v1.14.3 - github.com/kardianos/service v1.0.0 - github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect + github.com/gofrs/flock v0.8.1 + github.com/influxdata/telegraf v1.22.3 + github.com/kardianos/service v1.2.1 + github.com/pkg/errors v0.9.1 + github.com/sirupsen/logrus v1.8.1 + gopkg.in/ini.v1 v1.66.4 + gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) -replace github.com/influxdata/telegraf => github.com/ci-plugins/telegraf v1.99.0 -replace golang.zx2c4.com/wireguard v0.0.20200121 => golang.zx2c4.com/wireguard v0.0.0-20200121152719-05b03c675090 +require ( + collectd.org v0.5.0 // indirect + github.com/alecthomas/participle v0.4.1 // indirect + github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15 // indirect + github.com/antchfx/jsonquery v1.1.5 // indirect + github.com/antchfx/xmlquery v1.3.9 // indirect + github.com/antchfx/xpath v1.2.0 // indirect + github.com/benbjohnson/clock v1.3.0 // indirect + github.com/caio/go-tdigest v3.1.0+incompatible // indirect + github.com/coreos/go-semver v0.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/doclambda/protobufquery v0.0.0-20210317203640-88ffabe06a60 // indirect + github.com/fatih/color v1.10.0 // indirect + github.com/go-logfmt/logfmt v0.5.0 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/gobwas/glob v0.2.3 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/gosnmp/gosnmp v1.34.0 // indirect + github.com/influxdata/line-protocol/v2 v2.2.1 // indirect + github.com/influxdata/toml v0.0.0-20190415235208-270119a8ce65 // indirect + github.com/influxdata/wlog v0.0.0-20160411224016-7c63b0a71ef8 // indirect + github.com/jhump/protoreflect v1.8.3-0.20210616212123-6cc1efa697ca // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/mattn/go-colorable v0.1.8 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/naoina/go-stringutil v0.1.0 // indirect + github.com/philhofer/fwd v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/prometheus v1.8.2-0.20210430082741-2a4b8e12bbf2 // indirect + github.com/shirou/gopsutil/v3 v3.22.3 // indirect + github.com/sleepinggenius2/gosmi v0.4.4 // indirect + github.com/stretchr/objx v0.2.0 // indirect + github.com/stretchr/testify v1.7.1 // indirect + github.com/tidwall/gjson v1.10.2 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/tinylib/msgp v1.1.6 // indirect + github.com/tklauser/go-sysconf v0.3.10 // indirect + github.com/tklauser/numcpus v0.4.0 // indirect + github.com/vjeantet/grok v1.0.1 // indirect + github.com/wavefronthq/wavefront-sdk-go v0.9.10 // indirect + github.com/yusufpapurcu/wmi v1.2.2 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) diff --git a/src/agent/go.sum b/src/agent/go.sum index e35210148f6..e5b0e9be8b4 100644 --- a/src/agent/go.sum +++ b/src/agent/go.sum @@ -1,603 +1,1096 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.100.2 h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= +cloud.google.com/go/compute v0.1.0 h1:rSUBvAyVwNJ5uQCKNJFMwPtTvJkfN38b6Pvb9zZoqJ8= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/iam v0.1.1 h1:4CapQyNFjiksks1/x7jsvsygFPhihslYk5GptIrlX68= +cloud.google.com/go/monitoring v1.2.0 h1:fEvQITrhVcPM6vuDQcgPMbU5kZFeQFwZmE7v6+S8BPo= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.18.0 h1:f5HKj3RCujL2zm2cT/Op1mHG1bIDj2fYQ2NDbiAuNAU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0 h1:RPUcBvDeYgQFMfQu1eBMq6piD1SXmLH+vK3qjewZPus= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= code.cloudfoundry.org/clock v1.0.0 h1:kFXWQM4bxYvdBw2X8BbBeXwQNgfoWv1vqAk2ZZyBN2o= -code.cloudfoundry.org/clock v1.0.0/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= -collectd.org v0.3.0 h1:iNBHGw1VvPJxH2B6RiFWFZ+vsjo1lCdRszBeOuwGi00= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= +collectd.org v0.5.0 h1:y4uFSAuOmeVhG3GCRa3/oH+ysePfO/+eGJNfd0Qa3d8= +collectd.org v0.5.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-amqp-common-go/v3 v3.0.0 h1:j9tjcwhypb/jek3raNrwlCIl7iKQYOug7CLpSyBBodc= -github.com/Azure/azure-amqp-common-go/v3 v3.0.0/go.mod h1:SY08giD/XbhTz07tJdpw1SoxQXHPN30+DI3Z04SYqyg= -github.com/Azure/azure-event-hubs-go/v3 v3.2.0 h1:CQlxKH5a4NX1ZmbdqXUPRwuNGh2XvtgmhkZvkEuWzhs= -github.com/Azure/azure-event-hubs-go/v3 v3.2.0/go.mod h1:BPIIJNH/l/fVHYq3Rm6eg4clbrULrQ3q7+icmqHyyLc= -github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= -github.com/Azure/azure-pipeline-go v0.1.9 h1:u7JFb9fFTE6Y/j8ae2VK33ePrRqJqoCM/IWkQdAZ+rg= -github.com/Azure/azure-pipeline-go v0.1.9/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= -github.com/Azure/azure-sdk-for-go v37.1.0+incompatible h1:aFlw3lP7ZHQi4m1kWCpcwYtczhDkGhDoRaMTaxcOf68= -github.com/Azure/azure-sdk-for-go v37.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-storage-blob-go v0.6.0/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= -github.com/Azure/azure-storage-queue-go v0.0.0-20181215014128-6ed74e755687 h1:7MiZ6Th+YTmwUdrKmFg5OMsGYz7IdQwjqL0RPxkhhOQ= -github.com/Azure/azure-storage-queue-go v0.0.0-20181215014128-6ed74e755687/go.mod h1:K6am8mT+5iFXgingS9LUc7TmbsW6XBw3nxaRyaMyWc8= -github.com/Azure/go-amqp v0.12.6 h1:34yItuwhA/nusvq2sPSNPQxZLCf/CtaogYH8n578mnY= -github.com/Azure/go-amqp v0.12.6/go.mod h1:qApuH6OFTSKZFmCOxccvAv5rLizBQf4v8pRmG138DPo= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.3 h1:OZEIaBbMdUE/Js+BQKlpO81XlISgipr6yDJ+PSwsgi4= -github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.1 h1:pZdL8o72rK+avFWl+p9nE8RWi1JInZrWJYlnpfXJwHk= -github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= -github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= -github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U= -github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8= -github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4= -github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= -github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/Azure/azure-amqp-common-go/v3 v3.2.3 h1:uDF62mbd9bypXWi19V1bN5NZEO84JqgmI5G73ibAmrk= +github.com/Azure/azure-event-hubs-go/v3 v3.3.17 h1:9k2yRMBJWgcIlSNBuKVja2af/oR3oMowqFPpHDV5Kl4= +github.com/Azure/azure-kusto-go v0.6.0 h1:sAK4LE2emd7ZumN/HNJF6t1d/K8bjXe0MD5D1VsgKRE= +github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U= +github.com/Azure/azure-sdk-for-go v52.5.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v61.2.0+incompatible h1:sSormXkfW0ov1vh6ihTBRQxdfg73fPqkccl50GbR9iM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 h1:qoVeMsc9/fh/yhxVaA0obYjVH/oI/ihrOoMwsLS9KSA= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 h1:Px2UA+2RvSSvv+RvJNuUB6n7rs5Wsel4dXLe90Um2n4= +github.com/Azure/azure-storage-blob-go v0.14.0 h1:1BCg74AmVdYwO3dlKwtFU1V0wU2PZdREkXvAmZJRUlM= +github.com/Azure/azure-storage-queue-go v0.0.0-20191125232315-636801874cdd h1:b3wyxBl3vvr15tUAziPBPK354y+LSdfPCpex5oBttHo= +github.com/Azure/go-amqp v0.17.0 h1:HHXa3149nKrI0IZwyM7DRcRy5810t9ZICDutn4BYzj4= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest v0.11.24 h1:1fIGgHKqVm54KIPT+q8Zmd1QlVsmHqeUGso5qm2BqqE= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ= +github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 h1:P6bYXFoao05z5uhOQzbC3Qd8JqF3jUoocoTeIxkp2cA= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 h1:0W/yGmFdTIT77fvdlGZ0LMISoLHFJ7Tx4U0yeB+uFs4= +github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= +github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= +github.com/Azure/go-autorest/autorest/validation v0.3.1 h1:AgyqjAd94fwNAoTjl/WQXg4VvFeRFpO+UhNyRXqF1ac= +github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0= +github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnloDp7xxV0YvstAE7nKTaM= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Mellanox/rdmamap v0.0.0-20191106181932-7c3c4763a6ee h1:atI/FFjXh6hIVlPE1Jup9m8N4B9q/OSbMUe2EBahs+w= -github.com/Mellanox/rdmamap v0.0.0-20191106181932-7c3c4763a6ee/go.mod h1:jDA6v0TUYrFEIAE5uGJ29LQOeONIgMdP4Rkqb8HUnPM= -github.com/Microsoft/ApplicationInsights-Go v0.4.2 h1:HIZoGXMiKNwAtMAgCSSX35j9mP+DjGF9ezfBvxMDLLg= -github.com/Microsoft/ApplicationInsights-Go v0.4.2/go.mod h1:CukZ/G66zxXtI+h/VcVn3eVVDGDHfXM2zVILF7bMmsg= -github.com/Microsoft/go-winio v0.4.9 h1:3RbgqgGVqmcpbOiwrjbVtDHLlJBGF6aE+yHmNtBNsFQ= -github.com/Microsoft/go-winio v0.4.9/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.4.17 h1:iT12IBVClFevaf8PuVyi3UmZOVh4OqnaLxDTW2O6j3w= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/OwnLocal/goes v1.0.0/go.mod h1:8rIFjBGTue3lCU0wplczcUgt9Gxgrkkrw7etMIcn8TM= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/sarama v1.24.1 h1:svn9vfN3R1Hz21WR2Gj0VW9ehaDGkiOS+VqlIcZOkMI= -github.com/Shopify/sarama v1.24.1/go.mod h1:fGP8eQ6PugKEI0iUETYYtnP6d1pH/bdDMTel1X5ajsU= -github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= +github.com/Shopify/sarama v1.32.0 h1:P+RUjEaRU0GMMbYexGMDyrMkLhbbBVUVISDywi+IlFU= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/aerospike/aerospike-client-go v1.27.0 h1:VC6/Wqqm3Qlp4/utM7Zts3cv4A2HPn8rVFp/XZKTWgE= -github.com/aerospike/aerospike-client-go v1.27.0/go.mod h1:zj8LBEnWBDOVEIJt8LvaRvDG5ARAoa5dBeHaB472NRc= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/aerospike/aerospike-client-go/v5 v5.7.0 h1:Olgq011scnhKlGxo4AcGSXI8JRLF0aSEdl1PhjmKTUo= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/go-thrift v0.0.0-20170109061633-7914173639b2/go.mod h1:CxCgO+NdpMdi9SsTlGbc0W+/UNxO3I0AabOEJZ3w61w= +github.com/alecthomas/kong v0.2.1/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= +github.com/alecthomas/participle v0.4.1 h1:P2PJWzwrSpuCWXKnzqvw0b0phSfH1kJo4p2HvLynVsI= +github.com/alecthomas/participle v0.4.1/go.mod h1:T8u4bQOSMwrkTWOSyt8/jSFPEnRtd0FKFMjVfYBlqPs= +github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= +github.com/alecthomas/repr v0.0.0-20210301060118-828286944d6a/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15 h1:AUNCr9CiJuwrRYS3XieqF+Z9B9gNxo/eANAJCF2eiN4= +github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.1529 h1:qAt5MZ3Ukwx/JMAiaagQhNQMBZLcmJbnweBoK3EeHxI= github.com/amir/raidman v0.0.0-20170415203553-1ccc43bfb9c9 h1:FXrPTd8Rdlc94dKccl7KPmdmIbVh/OjelJ8/vgMRzcQ= -github.com/amir/raidman v0.0.0-20170415203553-1ccc43bfb9c9/go.mod h1:eliMa/PW+RDr2QLWRmLH1R1ZA4RInpmvOzDDXtaIZkc= -github.com/apache/thrift v0.12.0 h1:pODnxUFNcjP9UTLZGTdeh+j16A8lJbRvD3rOtrk/7bs= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/antchfx/jsonquery v1.1.5 h1:1YWrNFYCcIuJPIjFeOP5b6TXbLSUYY8qqxWbuZOB1qE= +github.com/antchfx/jsonquery v1.1.5/go.mod h1:RtMzTHohKaAerkfslTNjr3Y9MdxjKlSgIgaVjVKNiug= +github.com/antchfx/xmlquery v1.3.9 h1:Y+zyMdiUZ4fasTQTkDb3DflOXP7+obcYEh80SISBmnQ= +github.com/antchfx/xmlquery v1.3.9/go.mod h1:wojC/BxjEkjJt6dPiAqUzoXO5nIMWtxHS8PD8TmN4ks= +github.com/antchfx/xpath v1.1.7/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= +github.com/antchfx/xpath v1.2.0 h1:mbwv7co+x0RwgeGAOHdrKy89GvHaGvxxBtPK0uF9Zr8= +github.com/antchfx/xpath v1.2.0/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= +github.com/apache/arrow/go/arrow v0.0.0-20211006091945-a69884db78f4 h1:nPUln5QTzhftSpmld3xcXw/GOJ3z1E8fR8tUrrc0YWk= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.15.0 h1:aGvdaR0v1t9XLgjtBYwxcBvBOTMqClzwE26CHOgjW1Y= github.com/aristanetworks/glog v0.0.0-20191112221043-67e8567f59f3 h1:Bmjk+DjIi3tTAU0wxGaFbfjGUqlxxSXARq9A96Kgoos= -github.com/aristanetworks/glog v0.0.0-20191112221043-67e8567f59f3/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA= github.com/aristanetworks/goarista v0.0.0-20190325233358-a123909ec740 h1:FD4/ikKOFxwP8muWDypbmBWc634+YcAs3eBrYAmRdZY= -github.com/aristanetworks/goarista v0.0.0-20190325233358-a123909ec740/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.0 h1:B7AQgHi8QSEi4uHu7Sbsga+IJDU+CENgjxoo81vDUqU= -github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= -github.com/astaxie/beego v1.12.1 h1:dfpuoxpzLVgclveAXe4PyNKqkzgm5zF4tgF2B3kkM2I= -github.com/astaxie/beego v1.12.1/go.mod h1:kPBWpSANNbSdIqOc8SUL9h+1oyBMZhROeYsXQDbidWQ= -github.com/aws/aws-sdk-go v1.19.41 h1:veutzvQP/lOmYmtX26S9mTFJLO6sp7/UsxFcCjglu4A= -github.com/aws/aws-sdk-go v1.19.41/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ= -github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU= +github.com/armon/go-metrics v0.3.3 h1:a9F4rlj7EWWrbj7BYw8J8+x+ZZkJeqzNyRk8hdPF+ro= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/aws/aws-sdk-go v1.38.3/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.16.2 h1:fqlCk6Iy3bnCumtrLz9r3mJ/2gUT0pJ0wLFVIdWh+JA= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.2.0 h1:scBthy70MB3m4LCMFaBcmYCyR2XWOz6MxSfdSu/+fQo= +github.com/aws/aws-sdk-go-v2/config v1.15.3 h1:5AlQD0jhVXlGzwo+VORKiUuogkG7pQcLJNzIzK7eodw= +github.com/aws/aws-sdk-go-v2/credentials v1.11.2 h1:RQQ5fzclAKJyY5TvF+fkjJEwzK4hnxQCLOu5JXzDmQo= +github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.2.0 h1:8kvinmbIDObqsWegKP0JjeanYPiA4GUVpAtciNWE+jw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.3 h1:LWPg5zjHV9oz/myQr4wMs0gi4CjnDN/ILmyZUFYXZsU= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.3 h1:0O72494cCsazjpsGfo+LXezru6PMSp0HUB1m5UfpaRU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.9 h1:onz/VaaxZ7Z4V+WIN9Txly9XLTmoOh1oJ8XcAC3pako= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.3 h1:9stUQR/u2KXU6HkFJYlqnZEjBnbgrVbG6I5HN09xZh0= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.10 h1:by9P+oy3P/CwggN4ClnW2D4oL91QV7pBzBICi1chZvQ= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.7.0 h1:vXZPcDQg7e5z2IKz0huei6zhfAxDoZdXej2o3jUbjCI= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.15.4 h1:mBqjBKtZzvAc9j7gU+FEHbhTKSr02iqMOdQIL/7GZ78= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.15.3 h1:b5+OInu1LyoF4uhFT453MOhbXXaM0YmQsqkxMjFl1dc= +github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.4.0 h1:QbFWJr2SAyVYvyoOHvJU6sCGLnqNT94ZbWElJMEI1JY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.1 h1:T4pFel53bkHjL2mMo+4DKE6r6AuoZnM0fg7k1/ratr4= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.3 h1:JUbFrnq5mEeM2anIJ2PUkaHpKPW/D+RYAQVv5HXYQg4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.3 h1:Gh1Gpyh01Yvn7ilO/b/hr01WgNpaszfbKMUgqM186xQ= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.1 h1:YEz2KMyqK2zyG3uOa0l2xBc/H6NUVJir8FhwHQHF3rc= +github.com/aws/aws-sdk-go-v2/service/kinesis v1.13.0 h1:wqLvwC4qdrrGikudu8Z9X2sb79BYUYWAgMF5BGFQJY8= +github.com/aws/aws-sdk-go-v2/service/s3 v1.16.0 h1:dt1JQFj/135ozwGIWeCM3aQ8N/kB3Xu3Uu4r9zuOIyc= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.3 h1:frW4ikGcxfAEDfmQqWgMLp+F1n4nRo9sF39OcIb5BkQ= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.3 h1:cJGRyzCSVwZC7zZZ1xbx9m32UnrKydRYhOvcD1NYP9Q= +github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.3.2 h1:1s/RRA5Owuz4/G/eWCdCKgC+9zaz2vxFsRSwe7R3cPY= +github.com/aws/smithy-go v1.11.2 h1:eG/N+CcUMAvsdffgMvjMKwfyDzIkjM6pfxMJ8Mzc6mE= +github.com/awslabs/kinesis-aggregation/go v0.0.0-20210630091500-54e17340d32f h1:Pf0BjJDga7C98f0vhw+Ip5EaiE07S3lTKpIYPNS0nMo= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bitly/go-hostpool v0.1.0 h1:XKmsF6k5el6xHG3WPJ8U0Ku/ye7njX7W81Ng7O2ioR0= -github.com/bitly/go-hostpool v0.1.0/go.mod h1:4gOCgp6+NZnVqlKyZ/iBZFTAJKembaVENUpMkpg42fw= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= -github.com/caio/go-tdigest v2.3.0+incompatible h1:zP6nR0nTSUzlSqqr7F/LhslPlSZX/fZeGmgmwj2cxxY= -github.com/caio/go-tdigest v2.3.0+incompatible/go.mod h1:sHQM/ubZStBUmF1WbB8FAm8q9GjDajLC5T7ydxE3JHI= -github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE= -github.com/cenkalti/backoff v2.0.0+incompatible h1:5IIPUHhlnUZbcHQsQou5k1Tn58nJkeJL9U+ig5CHJbY= -github.com/cenkalti/backoff v2.0.0+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bmatcuk/doublestar/v3 v3.0.0 h1:TQtVPlDnAYwcrVNB2JiGuMc++H5qzWZd9PhkNo5WyHI= +github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/caio/go-tdigest v3.1.0+incompatible h1:uoVMJ3Q5lXmVLCCqaMGHLBWnbGoN6Lpu7OAUPR60cds= +github.com/caio/go-tdigest v3.1.0+incompatible/go.mod h1:sHQM/ubZStBUmF1WbB8FAm8q9GjDajLC5T7ydxE3JHI= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= +github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/ci-plugins/telegraf v1.99.0 h1:3ICig9K38owWdFpb2ETH8qWe3e6Ar/JMQxZqh9ZN4go= -github.com/ci-plugins/telegraf v1.99.0/go.mod h1:GkxyfGk0O6GXR4Md4jwrZM4fGSxXDen7+tYikre0EPM= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/cisco-ie/nx-telemetry-proto v0.0.0-20190531143454-82441e232cf6 h1:57RI0wFkG/smvVTcz7F43+R0k+Hvci3jAVQF9lyMoOo= -github.com/cisco-ie/nx-telemetry-proto v0.0.0-20190531143454-82441e232cf6/go.mod h1:ugEfq4B8T8ciw/h5mCkgdiDRFS4CkqqhH2dymDB4knc= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/couchbase/go-couchbase v0.0.0-20180501122049-16db1f1fe037/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U= -github.com/couchbase/go-couchbase v0.0.0-20181122212707-3e9b6e1258bb h1:w3RapLhkA5+km9Z8vUkC6VCaskduJXvXwJg5neKnfDU= -github.com/couchbase/go-couchbase v0.0.0-20181122212707-3e9b6e1258bb/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U= -github.com/couchbase/gomemcached v0.0.0-20180502221210-0da75df14530/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c= -github.com/couchbase/gomemcached v0.0.0-20181122193126-5125a94a666c h1:K4FIibkr4//ziZKOKmt4RL0YImuTjLLBtwElf+F2lSQ= -github.com/couchbase/gomemcached v0.0.0-20181122193126-5125a94a666c/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c= -github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a h1:Y5XsLCEhtEI8qbD9RP3Qlv5FXdTDHxZM9UPUnMRgBp8= -github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs= -github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.5.11 h1:+biZCY9Kns9t2J8L9hOqubjvNQBr1ULdmR7kL+omKoY= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/couchbase/go-couchbase v0.1.1 h1:ClFXELcKj/ojyoTYbsY34QUrrYCBi/1G749sXSCkdhk= +github.com/couchbase/gomemcached v0.1.3 h1:HIc5qMYNbuhB7zNaiEtj61DCYkquAwrQlf64q7JzdEY= +github.com/couchbase/goutils v0.1.0 h1:0WLlKJilu7IBm98T8nS9+J36lBFVLRUSIUtyD/uWpAE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADGYw5LqMnHqSkyIELsHCGF6PkrmM31V8rF7o= -github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= +github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA= github.com/devigned/tab v0.1.1 h1:3mD6Kb1mUOYeLpJvTVSDwSg5ZsfSxfvxGRTxRsJsITA= -github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/docker/distribution v2.6.0-rc.1.0.20170726174610-edc3ab29cdff+incompatible h1:357nGVUC8gSpeSc2Axup8HfrfTLLUfWfCsCUhiQSKIg= -github.com/docker/distribution v2.6.0-rc.1.0.20170726174610-edc3ab29cdff+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20180327123150-ed7b6428c133 h1:Kus8nU6ctI/u/l86ljUJl6GpUtmO7gtD/krn4u5dr0M= -github.com/docker/docker v1.4.2-0.20180327123150-ed7b6428c133/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.3.0 h1:3lOnM9cSzgGwx8VfK/NGOW5fLQ0GjIlCkaktF+n1M6o= -github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk= +github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= +github.com/dgryski/go-sip13 v0.0.0-20200911182023-62edffca9245/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/digitalocean/godo v1.58.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= +github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= +github.com/djherbis/times v1.5.0 h1:79myA211VwPhFTqUk8xehWrsEO+zcIZj0zT8mXPVARU= +github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v20.10.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.14+incompatible h1:+T9/PRYWNDo5SZl5qS1r9Mo/0Q8AwxKKPtu9S1yxM0w= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libnetwork v0.8.0-dev.2.0.20181012153825-d7b61745d166 h1:KgEcrKF0NWi9GT/OvDp9ioXZIrHRbP8S5o+sot9gznQ= -github.com/docker/libnetwork v0.8.0-dev.2.0.20181012153825-d7b61745d166/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU= +github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/doclambda/protobufquery v0.0.0-20210317203640-88ffabe06a60 h1:27379cxrsKlr7hAnW/xrusefspUPjqHVRW1K/bZgfGw= +github.com/doclambda/protobufquery v0.0.0-20210317203640-88ffabe06a60/go.mod h1:8Ia4zp86glrUhC29AAdK9hwTYh8RB6v0WRCtpplYqEg= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dynatrace-oss/dynatrace-metric-utils-go v0.3.0 h1:q2Ayh9s6Cr75bS5URiOUAoyFXemgKQaBJphbhAaJHCY= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eclipse/paho.mqtt.golang v1.2.0 h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t2y2qayIX0= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/eclipse/paho.mqtt.golang v1.3.5 h1:sWtmgNxYM9P2sP+xEItMozsR3w0cqZFlqnNN1bdl41Y= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ericchiang/k8s v1.2.0 h1:vxrMwEzY43oxu8aZyD/7b1s8tsBM+xoUoxjWECWFbPI= -github.com/ericchiang/k8s v1.2.0/go.mod h1:/OmBgSq2cd9IANnsGHGlEz27nwMZV2YxlpXuQtU3Bz4= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.4.1 h1:Wv2VwvNn73pAdFIVUQRXYDFp31lXKbqblIXo/Q5GPSg= -github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.5+incompatible h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.11.0/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= +github.com/frankban/quicktest v1.11.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= +github.com/frankban/quicktest v1.13.0 h1:yNZif1OkDfNoDfb9zZa9aXIpejNR4F23Wely0c+Qdqk= +github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew= -github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= -github.com/glinton/ping v0.1.4-0.20200311211934-5ac87da8cd96 h1:YpooqMW354GG47PXNBiaCv6yCQizyP3MXD9NUPrCEQ8= -github.com/glinton/ping v0.1.4-0.20200311211934-5ac87da8cd96/go.mod h1:uY+1eqFUyotrQxF1wYFNtMeHp/swbYRsoGzfcPZ8x3o= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= +github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= +github.com/go-asn1-ber/asn1-ber v1.5.1 h1:pDbRAunXzIUXfx4CB2QJFv5IuPiuoW+sWvr/Us009o8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-ldap/ldap/v3 v3.4.1 h1:fU/0xli6HY02ocbMuozHAYsaHLcnkLjvho2r5a34BUU= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-redis/redis v6.12.0+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-redis/redis v6.14.2+incompatible h1:UE9pLhzmWf+xHNmZsoccjXosPicuiNaInPgym8nzfg0= -github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= +github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= +github.com/go-openapi/analysis v0.19.16/go.mod h1:GLInF007N83Ad3m8a/CbQ5TPzdnGT7workfHwuVjNVk= +github.com/go-openapi/analysis v0.20.0/go.mod h1:BMchjvaHDykmRMsK40iPtvyOfFdMMxlOmQr9FBZk+Og= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.4/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= +github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= +github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= +github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= +github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc= +github.com/go-openapi/loads v0.20.0/go.mod h1:2LhKquiE513rN5xC6Aan6lYOSddlL8Mp20AW9kpviM4= +github.com/go-openapi/loads v0.20.2/go.mod h1:hTVUotJ+UonAMMZsvakEgmWKgtulweO9vYP2bQYKA/o= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= +github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= +github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.15/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= +github.com/go-openapi/spec v0.20.0/go.mod h1:+81FIL1JwC5P3/Iuuozq3pPE9dXdIEGxFutcFKaVbmU= +github.com/go-openapi/spec v0.20.1/go.mod h1:93x7oh+d+FQsmsieroS4cmR3u0p/ywH649a3qwC9OsQ= +github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= +github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= +github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= +github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4= +github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= +github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= +github.com/go-openapi/validate v0.20.2/go.mod h1:e7OJoKNgd0twXZwIn0A43tHbvIcr/rZIVCbJBpTUoY0= +github.com/go-ping/ping v0.0.0-20210201095549-52eed920f98c h1:fWdhUpCuoeNIPiQ+pkAmmERYEjhVx5/cbVGK7T99OkI= +github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/goburrow/modbus v0.1.0 h1:DejRZY73nEM6+bt5JSP6IsFolJ9dVcqxsYbpLbeW/ro= -github.com/goburrow/modbus v0.1.0/go.mod h1:Kx552D5rLIS8E7TyUwQ/UdHEqvX5T8tyiGBTlzMcZBg= -github.com/goburrow/serial v0.1.0 h1:v2T1SQa/dlUqQiYIT8+Cu7YolfqAi3K96UmhwYyuSrA= -github.com/goburrow/serial v0.1.0/go.mod h1:sAiqG0nRVswsm1C97xsttiYCzSLBmUZ/VSlVLZJ8haA= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gofrs/flock v0.7.1 h1:DP+LD/t0njgoPBvT5MJLeliUIVQR03hiKR6vezdwHlc= -github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v2.1.0+incompatible h1:8oEj3gioPmmDAOLQUZdnW+h4FZu9aSE/SQIas1E9pzA= -github.com/gofrs/uuid v2.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v2.0.0+incompatible h1:dicJ2oXwypfwUGnB2/TYWYEKiuk9eYQlQO/AnOHl5mI= +github.com/google/gnxi v0.0.0-20220411075422-cd6b043b7fd0 h1:Ef2sJA0zQvsviQ13sXiidv+SIkE68t3oy4wfXAV66j0= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210323184331-8eee2492667d/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= +github.com/googleapis/gax-go/v2 v2.1.1 h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= +github.com/gopcua/opcua v0.3.3 h1:tu1t/mx9fJybry1KYljqDdzxmik+BZk6410LJ4QzM2E= +github.com/gophercloud/gophercloud v0.16.0/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= +github.com/gophercloud/gophercloud v0.24.0 h1:jDsIMGJ1KZpAjYfQgGI2coNQj5Q83oPzuiGJRFWgMzw= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gosnmp/gosnmp v1.34.0 h1:p96iiNTTdL4ZYspPC3leSKXiHfE1NiIYffMu9100p5E= +github.com/gosnmp/gosnmp v1.34.0/go.mod h1:QWTRprXN9haHFof3P96XTDYc46boCGAh5IXp0DniEx4= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grid-x/modbus v0.0.0-20211113184042-7f2251c342c9 h1:Q7e9kXS3sRbTjsNDKazbcbDSGAKjFdk096M3qYbwNpE= +github.com/grid-x/serial v0.0.0-20211107191517-583c7356b3aa h1:Rsn6ARgNkXrsXJIzhkE4vQr5Gbx2LvtEMv4BJOK4LyU= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/gwos/tcg/sdk v0.0.0-20211223101342-35fbd1ae683c h1:befb5xGUwNCoBuN/akLFCKekUzr0ixyws3aAX/7TaOk= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/harlow/kinesis-consumer v0.3.1-0.20181230152818-2f58b136fee0 h1:U0KvGD9CJIl1nbgu9yLsfWxMT6WqL8fG0IBB7RvOZZQ= -github.com/harlow/kinesis-consumer v0.3.1-0.20181230152818-2f58b136fee0/go.mod h1:dk23l2BruuUzRP8wbybQbPn3J7sZga2QHICCeaEy5rQ= -github.com/hashicorp/consul v1.2.1 h1:66MuuTfV4aOXTQM7cjAIKUWFOITSk4XZlMhE09ymVbg= -github.com/hashicorp/consul v1.2.1/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/harlow/kinesis-consumer v0.3.6-0.20210911031324-5a873d6e9fec h1:ya+kv1eNnd5QhcHuaj5g5eMq5Ra3VCNaPY2ZI7Aq91o= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.8.1/go.mod h1:sDjTOq0yUyv5G4h+BqSea7Fn6BU+XbolEz1952UB+mk= +github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.7.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.2.0 h1:l6UW37iCXwZkZoAbEYnptSHVE/cQ5bOTPYG5W3vf9+8= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= -github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90 h1:VBj0QYQ0u2MCJzBfeYXGexnAl17GsH1yidnoxCqqD9E= -github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90/go.mod h1:o4zcYY1e0GEZI6eSEr+43QDYmuGglw1qSO6qdHUHCgg= -github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/memberlist v0.1.5 h1:AYBsgJOW9gab/toO5tEB8lWetVgDKZycqkebJ8xxpqM= -github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.1 h1:mYs6SMzu72+90OcPa5wr3nfznA4Dw9UyR791ZFNOIf4= -github.com/hashicorp/serf v0.8.1/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hashicorp/serf v0.9.6 h1:uuEX1kLR6aoda1TBttmJQKDLZE1Ob7KN0NPdE7EtCDc= +github.com/hetznercloud/hcloud-go v1.24.0/go.mod h1:3YmyK8yaZZ48syie6xpm3dt26rtB6s65AisBHylXYFA= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/influxdata/go-syslog/v2 v2.0.1 h1:l44S4l4Q8MhGQcoOxJpbo+QQYxJqp0vdgIVHh4+DO0s= -github.com/influxdata/go-syslog/v2 v2.0.1/go.mod h1:hjvie1UTaD5E1fTnDmxaCw8RRDrT4Ve+XHr5O2dKSCo= -github.com/influxdata/tail v1.0.1-0.20180327235535-c43482518d41 h1:HxQo1NpNXQDpvEBzthbQLmePvTLFTa5GzSFUjL03aEs= -github.com/influxdata/tail v1.0.1-0.20180327235535-c43482518d41/go.mod h1:xTFF2SILpIYc5N+Srb0d5qpx7d+f733nBrbasb13DtQ= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= +github.com/influxdata/go-syslog/v3 v3.0.0 h1:jichmjSZlYK0VMmlz+k4WeOQd7z745YLsvGMqwtYt4I= +github.com/influxdata/influxdb v1.8.4/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= +github.com/influxdata/influxdb-observability/common v0.2.18 h1:M+49hbNmZ5/bbUDMgtsbY4qqR/xtWEc3VnNAw/oa+Pk= +github.com/influxdata/influxdb-observability/influx2otel v0.2.18 h1:4pWyw6Jan9TTlSnc7N/sgfOSCSD/5fDtd/FP12uw7lE= +github.com/influxdata/influxdb-observability/otel2influx v0.2.18 h1:x1o5C36t6KBkx0//mRl3nMLBIJKLOe463kWhTRh12Uo= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= +github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= +github.com/influxdata/line-protocol-corpus v0.0.0-20210519164801-ca6fa5da0184/go.mod h1:03nmhxzZ7Xk2pdG+lmMd7mHDfeVOYFyhOgwO61qWU98= +github.com/influxdata/line-protocol-corpus v0.0.0-20210922080147-aa28ccfb8937 h1:MHJNQ+p99hFATQm6ORoLmpUCF7ovjwEFshs/NHzAbig= +github.com/influxdata/line-protocol-corpus v0.0.0-20210922080147-aa28ccfb8937/go.mod h1:BKR9c0uHSmRgM/se9JhFHtTT7JTO67X23MtKMHtZcpo= +github.com/influxdata/line-protocol/v2 v2.0.0-20210312151457-c52fdecb625a/go.mod h1:6+9Xt5Sq1rWx+glMgxhcg2c0DUaehK+5TDcPZ76GypY= +github.com/influxdata/line-protocol/v2 v2.1.0/go.mod h1:QKw43hdUBg3GTk2iC3iyCxksNj7PX9aUSeYOYE/ceHY= +github.com/influxdata/line-protocol/v2 v2.2.1 h1:EAPkqJ9Km4uAxtMRgUubJyqAr6zgWM0dznKMLRauQRE= +github.com/influxdata/line-protocol/v2 v2.2.1/go.mod h1:DmB3Cnh+3oxmG6LOBIxce4oaL4CPj3OmMPgvauXh+tM= +github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= +github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= +github.com/influxdata/tail v1.0.1-0.20210707231403-b283181d1fa7 h1:0rQOs1VHLVFpAAOIR0mJEvVOIaMYFgYdreeVbgI9sII= +github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= +github.com/influxdata/telegraf v1.22.3 h1:2RiUMCJWXSE5UENwPTuhen4ZUovFpFFdaT5hLHdY7Ms= +github.com/influxdata/telegraf v1.22.3/go.mod h1:44GEp0cI5irU72TtSxqfnbyHhlBDBRc+WoO0wS15bq8= github.com/influxdata/toml v0.0.0-20190415235208-270119a8ce65 h1:vvyMtD5LTJc1W9sQKjDkAWdcg0478CszSdzlHtiAXCY= github.com/influxdata/toml v0.0.0-20190415235208-270119a8ce65/go.mod h1:zApaNFpP/bTpQItGZNNUMISDMDAnTXu9UqJ4yT3ocz8= +github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/influxdata/wlog v0.0.0-20160411224016-7c63b0a71ef8 h1:W2IgzRCb0L9VzMujq/QuTaZUKcH8096jWwP519mHN6Q= github.com/influxdata/wlog v0.0.0-20160411224016-7c63b0a71ef8/go.mod h1:/2NMgWB1DHM1ti/gqhOlg+LJeBVk6FqR5aVGYY0hlwI= -github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 h1:vr3AYkKovP8uR8AvSGGUK1IDqRa5lAAvEkZG1LKaCRc= -github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= -github.com/jackc/pgx v3.6.0+incompatible h1:bJeo4JdVbDAW8KB2m8XkFeo8CPipREoG37BwEoKGz+Q= -github.com/jackc/pgx v3.6.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= -github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/intel/iaevents v1.0.0 h1:J8lETV13FMImV0VbOrKhkA790z7+cAHQ/28gbiefu7E= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/pgconn v1.11.0 h1:HiHArx4yFbwl91X3qqIHtUFoiIfLNJXCQRsnzkiwwaQ= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgproto3/v2 v2.2.0 h1:r7JypeP2D3onoQTCxWdTpCtJ4D+qpKr0TxvoyMhZ5ns= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= +github.com/jackc/pgtype v1.10.0 h1:ILnBWrRMSXGczYvmkYD6PsYyVFUNLTnIUJHHDLmqk38= +github.com/jackc/pgx/v4 v4.15.0 h1:B7dTkXsdILD3MF987WGGCcg+tvLW6bZJdEcqVFeU//w= +github.com/jaegertracing/jaeger v1.26.0 h1:4LbUdb9l/Mx83zYvjLbkrayheX+Aga26NEI+feo3xzA= +github.com/james4k/rcon v0.0.0-20120923215419-8fbb8268b60a h1:JxcWget6X/VfBMKxPIc28Jel37LGREut2fpV+ObkwJ0= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= -github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= +github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA= +github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.8.3-0.20210616212123-6cc1efa697ca h1:a0GZUdb+qnutF8shJxr2qs2qT3fnF+ptxTxPB8+oIvk= +github.com/jhump/protoreflect v1.8.3-0.20210616212123-6cc1efa697ca/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7 h1:K//n/AqR5HjG3qxbrBCL4vJPW0MVFSs9CPK1OOJdRME= -github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= -github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= -github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4 h1:nwOc1YaOrYJ37sEBrtWZrdqzK22hiJs3GpDmP3sR2Yw= -github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/josharian/native v0.0.0-20200817173448-b6b71def0850 h1:uhL5Gw7BINiiPAo24A2sxkcDI0Jt/sqp1v5xQCniEFA= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/kardianos/service v1.0.0 h1:HgQS3mFfOlyntWX8Oke98JcJLqt1DBcHR4kxShpYef0= -github.com/kardianos/service v1.0.0/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo= -github.com/karrick/godirwalk v1.12.0 h1:nkS4xxsjiZMvVlazd0mFyiwD4BR9f3m6LXGhM2TUx3Y= -github.com/karrick/godirwalk v1.12.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= +github.com/kardianos/service v1.2.1 h1:AYndMsehS+ywIS6RB9KOlcXzteWUzxgMgBymJD7+BYk= +github.com/kardianos/service v1.2.1/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.2 h1:LfVyl+ZlLlLDeQ/d2AqfGIIH4qEDu0Ed2S5GyhCWIWY= -github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= +github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kubernetes/apimachinery v0.0.0-20190119020841-d41becfba9ee h1:MB75LRhfeLER2RF7neSVpYuX/lL8aPi3yPtv5vdOJmk= -github.com/kubernetes/apimachinery v0.0.0-20190119020841-d41becfba9ee/go.mod h1:Pe/YBTPc3vqoMkbuIWPH8CF9ehINdvNyS0dP3J6HC0s= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353 h1:X/79QL0b4YJVO5+OsPH9rF2u428CIrGL/jLmPsoOQQ4= -github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353/go.mod h1:N0SVk0uhy+E1PZ3C9ctsPRlvOPAFPkCNlcPBDkt0N3U= github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 h1:bCiVCRCs1Heq84lurVinUPy19keqGEe4jh5vtK37jcg= -github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20180717111219-efc7eb8984d6 h1:8/+Y8SKf0xCZ8cCTfnrMdY7HNzlEjPAt3bPjalNb6CA= -github.com/mailru/easyjson v0.0.0-20180717111219-efc7eb8984d6/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mdlayher/apcupsd v0.0.0-20190314144147-eb3dd99a75fe h1:yMrL+YorbzaBpj/h3BbLMP+qeslPZYMbzcpHFBNy1Yk= -github.com/mdlayher/apcupsd v0.0.0-20190314144147-eb3dd99a75fe/go.mod h1:y3mw3VG+t0m20OMqpG8RQqw8cDXvShVb+L8Z8FEnebw= -github.com/mdlayher/genetlink v1.0.0 h1:OoHN1OdyEIkScEmRgxLEe2M9U8ClMytqA5niynLtfj0= -github.com/mdlayher/genetlink v1.0.0/go.mod h1:0rJ0h4itni50A86M2kHcgS85ttZazNt7a8H2a2cw0Gc= -github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= -github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= -github.com/mdlayher/netlink v1.1.0 h1:mpdLgm+brq10nI9zM1BpX1kpDbh3NLl3RSnVq6ZSkfg= -github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= -github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mdlayher/apcupsd v0.0.0-20200608131503-2bf01da7bf1b h1:Kcr+kPbkWZHFHXwl87quXUAmavS4/IMgu2zck3aiE7k= +github.com/mdlayher/genetlink v1.1.0 h1:k2YQT3959rJOF7gOvhdfQ0lut7QMIZiuVlJANheoZ+E= +github.com/mdlayher/netlink v1.4.2 h1:3sbnJWe/LETovA7yRZIX3f9McVOWV3OySH6iIBxiFfI= +github.com/mdlayher/socket v0.0.0-20211102153432-57e3fa563ecb h1:2dC7L10LmTqlyMVzFJ00qM25lqESg9Z4u3GuEXN5iHY= +github.com/microsoft/ApplicationInsights-Go v0.4.4 h1:G4+H9WNs6ygSCe6sUyxRc2U81TI5Es90b2t/MwX5KqY= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721 h1:RlZweED6sbSArvlE924+mUcZuXKLBHA35U7LN621Bws= -github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/miekg/dns v1.1.48 h1:Ucfr7IIVyMBz4lRE8qmGUuZ4Wt3/ZGu9hmcMT3Uu4tQ= +github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/ipvs v1.0.1 h1:aoZ7fhLTXgDbzVrAnvV+XbKOU8kOET7B3+xULDF/1o0= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/multiplay/go-ts3 v1.0.0 h1:loxtEFqvYtpoGh1jOqEt6aDzctYuQsi3vb3dMpvWiWw= -github.com/multiplay/go-ts3 v1.0.0/go.mod h1:14S6cS3fLNT3xOytrA/DkRyAFNuQLMLEqOYAsf87IbQ= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= +github.com/multiplay/go-ts3 v1.0.1 h1:Ja8ho7UzUDNvNCwcDzPEPimLRub7MUqbD+sgMWkcR0A= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.4 h1:BILRnsJ2Yb/fefiFbBWADpViGF69uh4sxe8poVDQ06g= -github.com/nats-io/nats-server/v2 v2.1.4/go.mod h1:Jw1Z28soD/QasIA2uWjXyM9El1jly3YwyFOuR8tH1rg= -github.com/nats-io/nats.go v1.9.1 h1:ik3HbLhZ0YABLto7iX80pZLPw/6dx3T+++MZJwLnMrQ= +github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296 h1:vU9tpM3apjYlLLeY23zRWJ9Zktr5jp+mloR942LEOpY= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats-server/v2 v2.7.4 h1:c+BZJ3rGzUKCBIM4IXO8uNT2u1vajGbD1kPA6wqCEaM= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d h1:zJf4l8Kp67RIZhoVeniSLZs69SHNgjLHz0aNsqPPlx8= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3 h1:6JrEfig+HzTH85yxzhSVbjHRJv9cn0p6n3IngIcM5/k= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nsqio/go-nsq v1.0.7 h1:O0pIZJYTf+x7cZBA0UMY8WxFG79lYTURmWzAAh48ljY= -github.com/nsqio/go-nsq v1.0.7/go.mod h1:XP5zaUs3pqf+Q71EqUJs3HYfBIqfK6G83WQMdNN+Ito= +github.com/newrelic/newrelic-telemetry-sdk-go v0.8.1 h1:6OX5VXMuj2salqNBc41eXKz6K+nV6OB/hhlGnAKCbwU= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= +github.com/nsqio/go-nsq v1.1.0 h1:PQg+xxiUjA7V+TLdXw7nVrJ5Jbl3sN86EhGCQj4+FYE= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olivere/elastic v6.2.37+incompatible h1:UfSGJem5czY+x/LqxgeCBgjDn6St+z8OnsCuxwD3L0U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/openconfig/gnmi v0.0.0-20180912164834-33a1865c3029 h1:lXQqyLroROhwR2Yq/kXbLzVecgmVeZh2TFLg6OxCd+w= -github.com/openconfig/gnmi v0.0.0-20180912164834-33a1865c3029/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= -github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/openconfig/gnmi v0.0.0-20200617225440-d2b4e6a45802 h1:WXFwJlWOJINlwlyAZuNo4GdYZS6qPX36+rRUncLmN8Q= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go-opentracing v0.3.4 h1:x/pBv/5VJNWkcHF1G9xqhug8Iw7X1y1zOMzDmyuvP2g= -github.com/openzipkin/zipkin-go-opentracing v0.3.4/go.mod h1:js2AbwmHW0YD9DwIw2JhQWmbfFi/UnWyYwdVhqbCDOE= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= +github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.2.6+incompatible h1:6aCX4/YZ9v8q69hTyiR7dNLnTA3fgtKHVVW5BCd5Znw= -github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= +github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4= +github.com/pion/dtls/v2 v2.0.13 h1:toLgXzq42/MEmfgkXDfzdnwLHMi4tfycaQPGkv9tzRE= +github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= +github.com/pion/transport v0.13.0 h1:KWTA5ZrQogizzYwPEciGtHPLwpAjE91FgXnyu+Hv2uY= +github.com/pion/udp v0.1.1 h1:8UAPvyqmsxK8oOjloDk4wUt63TzFe9WEJkg5lChlj7o= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/alertmanager v0.21.0/go.mod h1:h7tJ81NA0VLWvWEayi1QltevFkLF3KxmC/malTcT8Go= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.5.1 h1:bdHYieyGlH+6OLEk2YQha8THib30KP0/yD0YH9m6xcA= -github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.23.0/go.mod h1:H6QK/N6XVT42whUeIdI3dp36w49c+/iMDk7UAI2qm7Q= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/exporter-toolkit v0.5.1/go.mod h1:OCkM4805mmisBhLmVFw858QYi3v0wKdY6/UxrT0pZVg= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ= +github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/prometheus v1.8.2-0.20210430082741-2a4b8e12bbf2 h1:AHi2TGs09Mv4v688/bjcY2PfAcu9+p4aPvsgVQ4nYDk= +github.com/prometheus/prometheus v1.8.2-0.20210430082741-2a4b8e12bbf2/go.mod h1:5aBj+GpLB+V5MCnrKm5+JAqEJwzDiLugOmDhgt7sDec= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= +github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= +github.com/riemann/riemann-go-client v0.5.0 h1:yPP7tz1vSYJkSZvZFCsMiDsHHXX57x8/fEX3qyEXuAA= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/safchain/ethtool v0.0.0-20200218184317-f459e2d13664 h1:gvolwzuDhul9qK6/oHqxCHD5TEYfsWNBGidOeG6kvpk= -github.com/safchain/ethtool v0.0.0-20200218184317-f459e2d13664/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec h1:6ncX5ko6B9LntYM0YBRXkiSaZMmLYeZ/NWcmeB43mMY= -github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= -github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/samuel/go-zookeeper v0.0.0-20200724154423-2164a8ac840e h1:CGjiMQ0wMH4wtNWrlj6kiTbkPt2F3rbYnhGX6TWLfco= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210223165440-c65ae3540d44/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo= -github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= -github.com/shirou/gopsutil v2.20.2+incompatible h1:ucK79BhBpgqQxPASyS2cu9HX8cfDVljBN1WWFvbNvgY= -github.com/shirou/gopsutil v2.20.2+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114 h1:Pm6R878vxWWWR+Sa3ppsLce/Zq+JNTs6aVvRu13jv9A= -github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= -github.com/siddontang/ledisdb v0.0.0-20181029004158-becf5f38d373/go.mod h1:mF1DpOSOUiJRMR+FDqaqu3EBqrybQtrDDszLUZ6oxPg= -github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA= +github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shirou/gopsutil/v3 v3.22.3 h1:UebRzEomgMpv61e3hgD1tGooqX5trFbdU/ehphbHd00= +github.com/shirou/gopsutil/v3 v3.22.3/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= +github.com/showwin/speedtest-go v1.1.4 h1:pcY1W5LYZu44lH6Fuu80nu/Pj67n//VArlZudbAgR6E= +github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +github.com/signalfx/com_signalfx_metrics_protobuf v0.0.2 h1:X886QgwZH5qr9HIQkk3mWcNEhUxx6D8rUZumzLV4Wiw= +github.com/signalfx/gohistogram v0.0.0-20160107210732-1ccfd2ff5083 h1:WsShHmu12ZztYPfh9b+I+VjYD1o8iOHhB67WZCMEEE8= +github.com/signalfx/golib/v3 v3.3.43 h1:GvzjE2WaYU3oPhoek52/5zYZ5tPnt05EXUmszSZct+E= +github.com/signalfx/sapm-proto v0.7.2 h1:iM/y3gezQm1/j7JBS0gXhEJ8ROeneb6DY7n0OcnvLks= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/soniah/gosnmp v1.22.0 h1:jVJi8+OGvR+JHIaZKMmnyNP0akJd2vEgNatybwhZvxg= -github.com/soniah/gosnmp v1.22.0/go.mod h1:DuEpAS0az51+DyVBQwITDsoq4++e3LTNckp2GoasF2I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sleepinggenius2/gosmi v0.4.4 h1:xgu+Mt7CptuB10IPt3SVXBAA9tARToT4B9xGzjjxQX8= +github.com/sleepinggenius2/gosmi v0.4.4/go.mod h1:l8OniPmd3bJzw0MXP2/qh7AhP/e+bTY2CNivIhsnDT0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/snowflakedb/gosnowflake v1.6.2 h1:drZkX7Ve3qr3lLD/f0vxwesgJZfNerivknAvPRAMy88= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE= -github.com/streadway/amqp v0.0.0-20180528204448-e5adc2ada8b8 h1:l6epF6yBwuejBfhGkM5m8VSNM/QAm7ApGyH35ehA7eQ= -github.com/streadway/amqp v0.0.0-20180528204448-e5adc2ada8b8/go.mod h1:1WNBiOZtZQLpVAyu0iTduoJL9hEsMloAK5XWrtW0xdY= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271 h1:WhxRHzgeVGETMlmVfqhRn8RIeeNoPr2Czh33I4Zdccw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= -github.com/tbrandon/mbserver v0.0.0-20170611213546-993e1772cc62 h1:Oj2e7Sae4XrOsk3ij21QjjEgAcVSeo9nkp0dI//cD2o= -github.com/tbrandon/mbserver v0.0.0-20170611213546-993e1772cc62/go.mod h1:qUzPVlSj2UgxJkVbH0ZwuuiR46U8RBMDT5KLY78Ifpw= -github.com/tedsuo/ifrit v0.0.0-20191009134036-9a97d0632f00 h1:mujcChM89zOHwgZBBNr5WZ77mBXP1yR+gLThGCYZgAg= -github.com/tedsuo/ifrit v0.0.0-20191009134036-9a97d0632f00/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= -github.com/tidwall/gjson v1.3.0 h1:kfpsw1W3trbg4Xm6doUtqSl9+LhLB6qJ9PkltVAQZYs= -github.com/tidwall/gjson v1.3.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= -github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= -github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tidwall/gjson v1.10.2 h1:APbLGOM0rrEkd8WBw9C24nllro4ajFuJu0Sc9hRz8Bo= +github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/vishvananda/netlink v0.0.0-20171020171820-b2de5d10e38e h1:f1yevOHP+Suqk0rVc13fIkzcLULJbyQcXDba2klljD0= -github.com/vishvananda/netlink v0.0.0-20171020171820-b2de5d10e38e/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc h1:R83G5ikgLMxrBvLh22JhdfI8K6YXEPHx5P03Uu3DRs4= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vjeantet/grok v1.0.0 h1:uxMqatJP6MOFXsj6C1tZBnqqAThQEeqnizUZ48gSJQQ= -github.com/vjeantet/grok v1.0.0/go.mod h1:/FWYEVYekkm+2VjcFmO9PufDU5FgXHUz9oy2EGqmQBo= -github.com/vmware/govmomi v0.19.0 h1:CR6tEByWCPOnRoRyhLzuHaU+6o2ybF3qufNRWS/MGrY= -github.com/vmware/govmomi v0.19.0/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= -github.com/wavefronthq/wavefront-sdk-go v0.9.2 h1:/LvWgZYNjHFUg+ZUX+qv+7e+M8sEMi0lM15zPp681Gk= -github.com/wavefronthq/wavefront-sdk-go v0.9.2/go.mod h1:hQI6y8M9OtTCtc0xdwh+dCER4osxXdEAeCpacjpDZEU= -github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw= +github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw= +github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= +github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.4.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/vapourismo/knx-go v0.0.0-20211128234507-8198fa17db36 h1:JBj2CqnFwBhI3XsdMNn9MjKvehog+p5QZihotqq0Zuo= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 h1:cPXZWzzG0NllBLdjWoD1nDfaqu98YMv+OneaKc8sPOA= +github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae h1:4hwBBUfQCFe3Cym0ZtKyq7L16eZUtYKs+BaHDN6mAns= +github.com/vjeantet/grok v1.0.1 h1:2rhIR7J4gThTgcZ1m2JY4TrJZNgjn985U28kT2wQrJ4= +github.com/vjeantet/grok v1.0.1/go.mod h1:ax1aAchzC6/QMXMcyzHQGZWaW1l195+uMYIkCWPCNIo= +github.com/vmware/govmomi v0.27.3 h1:gwHHxKbMTNJON/3WPK3EsqZyQznTdHJAyRYPRSLm6R8= +github.com/wavefronthq/wavefront-sdk-go v0.9.10 h1:L4eiEdHpudHTGwrJaPYaCXSjCYDex8FEKVqaprU2sY0= +github.com/wavefronthq/wavefront-sdk-go v0.9.10/go.mod h1:ACJVXk0ksPHFkkTkXckqKEJGU3YDoAWjxTESkZlp+IE= +github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/wvanbergen/kafka v0.0.0-20171203153745-e2edea948ddf h1:TOV5PC6fIWwFOFra9xJfRXZcL2pLhMI8oNuDugNxg9Q= -github.com/wvanbergen/kafka v0.0.0-20171203153745-e2edea948ddf/go.mod h1:nxx7XRXbR9ykhnC8lXqQyJS0rfvJGxKyKw/sT1YOttg= github.com/wvanbergen/kazoo-go v0.0.0-20180202103751-f72d8611297a h1:ILoU84rj4AQ3q6cjQvtb9jBjx4xzR/Riq/zYhmDQiOk= -github.com/wvanbergen/kazoo-go v0.0.0-20180202103751-f72d8611297a/go.mod h1:vQQATAGxVK20DC1rRubTJbZDDhhpA4QfU02pMdPxGO4= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/scram v1.1.0 h1:d70R37I0HrDLsafRrMBXyrD4lmQbCHE873t00Vr0gm0= +github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xdg/scram v1.0.5 h1:TuS0RFmt5Is5qm9Tm2SoD89OPqe4IRiFtyFY4iwWXsw= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xdg/stringprep v1.0.3 h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/xlab/treeprint v1.0.0/go.mod h1:IoImgRak9i3zJyuxOKUP1v4UZd1tMoKkq/Cimt1uhCg= +github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/gopher-lua v0.0.0-20180630135845-46796da1b0b4 h1:f6CCNiTjQZ0uWK4jPwhwYB8QIGGfn0ssD9kVzRUUUpk= -github.com/yuin/gopher-lua v0.0.0-20180630135845-46796da1b0b4/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.9.0 h1:f3aLGJvQmBl8d9S40IL+jEyBC6hfLPbJjv9t5hEM9ck= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/collector/model v0.49.0 h1:mbUSNgpaBE3GWmzGsRb5t0xILpXIVYv7scPTTfoMt6c= +go.opentelemetry.io/collector/pdata v0.49.0 h1:aYj5rOlRC0x7lGXbc185LMsMMoY/pjOTXr5s1O2SzXs= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72 h1:+ELyKg6m8UBf0nPFSqD0mi7zUfwPyXo23HNjMnXPz7w= -golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -610,7 +1103,6 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -624,27 +1116,33 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -653,90 +1151,197 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210324051636-2c4c8ecb7826/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191003212358-c178f38b412c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 h1:sfkvUWPNGwSV+8/fNqctR5lS2AqCSqYwXdrjCxp/dXo= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210314195730-07df6a141424/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -744,27 +1349,52 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117065230-39095c1d176c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200317043434-63da46f3035e h1:8ogAbHWoJTPepnVbNRqXLOpzMkl0rtRsM7crbflc4XM= -golang.org/x/tools v0.0.0-20200317043434-63da46f3035e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200513201620-d5fe73897c97/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.zx2c4.com/wireguard v0.0.0-20200121152719-05b03c675090 h1:LJ5Rrj8y0yBul+KpB2v9dFhYuHRs1s9caVu4VK6MgMo= -golang.zx2c4.com/wireguard v0.0.0-20200121152719-05b03c675090/go.mod h1:P2HsVp8SKwZEufsnezXZA4GRX/T49/HlU7DGuelXsU4= -golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200205215550-e35592f146e4 h1:KTi97NIQGgSMaN0v/oxniJV0MEzfzmrDUOAWxombQVc= -golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200205215550-e35592f146e4/go.mod h1:UdS9frhv65KTfwxME1xE8+rHYoFpbm36gOud1GhBe9c= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.zx2c4.com/wireguard v0.0.0-20211209221555-9c9e7e272434 h1:3zl8RkJNQ8wfPRomwv/6DBbH2Ut6dgMaWTxM0ZunWnE= +golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211230205640-daad0b7ba671 h1:tJAYx7pB6b5bNqi7XatStqFT2zFAxhXcGDq1R6FqqjU= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.2 h1:4r+yNT0+8SWcOkXP+63H2zQbN+USnC73cjGUxnDF94Q= -gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= +gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= +gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= +gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= @@ -776,20 +1406,36 @@ google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsb google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0 h1:jz2KixHX7EcCPiQrySzPdnYT7DbINAypCqKZ1Z7GM40= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.42.0/go.mod h1:+Oj4s6ch2SEGtPjGqfUfZonBH0GjQH89gTeKKAEGZKI= +google.golang.org/api v0.67.0 h1:lYaaLa+x3VVUhtosaK9xihwQ9H9KRa557REHwwZ2orM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -797,83 +1443,163 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200317114155-1f3552e48f24 h1:IGPykv426z7LZSVPlaPufOyphngM4at5uZ7x5alaFvE= -google.golang.org/genproto v0.0.0-20200317114155-1f3552e48f24/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210312152112-fc591d9ea70f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00 h1:zmf8Yq9j+IyTpps+paSkmHkSu5fJlRKy69LxRzc17Q0= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fatih/pool.v2 v2.0.0 h1:xIFeWtxifuQJGk/IEPKsTduEKcKvPmhoiVDGpC40nKg= -gopkg.in/fatih/pool.v2 v2.0.0/go.mod h1:8xVGeu1/2jr2wm5V9SPuMht2H5AEmf5aFMGSQixtjTY= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/fsnotify/fsnotify.v1 v1.4.7/go.mod h1:Fyux9zXlo4rWoMSIzpn9fDAYjalPqJ/K1qJ27s+7ltE= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gorethink/gorethink.v3 v3.0.5 h1:e2Uc/Xe+hpcVQFsj6MuHlYog3r0JYpnTzwDj/y2O4MU= -gopkg.in/gorethink/gorethink.v3 v3.0.5/go.mod h1:+3yIIHJUGMBK+wyPH+iN5TP+88ikFDfZdqTlK3Y9q8I= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= -gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= -gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI= -gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= -gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/gokrb5.v7 v7.3.0 h1:0709Jtq/6QXEuWRfAm260XqlpcwL1vxtO1tUE2qK8Z4= -gopkg.in/jcmturner/gokrb5.v7 v7.3.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU= -gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= -gopkg.in/ldap.v3 v3.1.0 h1:DIDWEjI7vQWREh0S8X5/NFPCZ3MCVd55LmXKPW4XLGE= -gopkg.in/ldap.v3 v3.1.0/go.mod h1:dQjCc0R0kfyFjIlWNMH1DORwUASZyDxo2Ry1B51dXaQ= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/olivere/elastic.v5 v5.0.70 h1:DqFG2Odzs74JCz6SssgJjd6qpGnsOAzNc7+l5EnvsnE= -gopkg.in/olivere/elastic.v5 v5.0.70/go.mod h1:FylZT6jQWtfHsicejzOm3jIMVPOAksa80i3o+6qtQRk= +gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/olivere/elastic.v5 v5.0.86 h1:xFy6qRCGAmo5Wjx96srho9BitLhZl2fcnpuidPwduXM= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/apimachinery v0.17.1 h1:zUjS3szTxoUjTDYNvdFkYt2uMEXLcthcbp+7uZvWhYM= -k8s.io/apimachinery v0.17.1/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.2.2 h1:MNh1AVMyVX23VUHE2O27jm6lNj3vjO5DexS4A1xvnzk= +k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= +k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= +k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= +k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= +k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= +k8s.io/client-go v0.23.3 h1:23QYUmCQ/W6hW78xIwm3XqZrrKZM+LWDqW2zfo+szJs= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= +modernc.org/cc/v3 v3.33.5 h1:gfsIOmcv80EelyQyOHn/Xhlzex8xunhQxWiJRMYmPrI= +modernc.org/ccgo/v3 v3.9.4 h1:mt2+HyTZKxva27O6T4C9//0xiNQ/MornL3i8itM5cCs= +modernc.org/libc v1.9.5 h1:zv111ldxmP7DJ5mOIqzRbza7ZDl3kh4ncKfASB2jIYY= +modernc.org/mathutil v1.2.2 h1:+yFk8hBprV+4c0U9GjFtL+dV3N8hOJ8JCituQcMShFY= +modernc.org/memory v1.0.4 h1:utMBrFcpnQDdNsmM6asmyH/FM9TqLPS7XF7otpJmrwM= +modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A= +modernc.org/sqlite v1.10.8 h1:tZzV+/FwlSBddiJAHLR+qxsw2nx7jpLMKOCVu6NTjxI= +modernc.org/strutil v1.1.0 h1:+1/yCzZxY2pZwwrsbH+4T7BQMoLQ9QiBshRC9eicYsc= +modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= 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= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/src/agent/internal/third_party/dep/fs/fs.go b/src/agent/internal/third_party/dep/fs/fs.go new file mode 100644 index 00000000000..58a4e925634 --- /dev/null +++ b/src/agent/internal/third_party/dep/fs/fs.go @@ -0,0 +1,372 @@ +/* +Copyright (c) for portions of fs.go are held by The Go Authors, 2016 and are provided under +the BSD license. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package fs + +import ( + "github.com/pkg/errors" + "io" + "io/ioutil" + "os" + "path/filepath" + "runtime" + "syscall" +) + +// fs contains a copy of a few functions from dep tool code to avoid a dependency on golang/dep. +// This code is copied from https://github.com/golang/dep/blob/a5440af88cd9b4507810256f8845a297936868a2/internal/fs/fs.go +// No changes to the code were made other than removing some unused functions + +// RenameWithFallback attempts to rename a file or directory, but falls back to +// copying in the event of a cross-device link error. If the fallback copy +// succeeds, src is still removed, emulating normal rename behavior. +func RenameWithFallback(src, dst string) error { + _, err := os.Stat(src) + if err != nil { + return errors.Wrapf(err, "cannot stat %s", src) + } + + err = os.Rename(src, dst) + if err == nil { + return nil + } + + return renameFallback(err, src, dst) +} + +// renameByCopy attempts to rename a file or directory by copying it to the +// destination and then removing the src thus emulating the rename behavior. +func renameByCopy(src, dst string) error { + var cerr error + if dir, _ := IsDir(src); dir { + cerr = CopyDir(src, dst) + if cerr != nil { + cerr = errors.Wrap(cerr, "copying directory failed") + } + } else { + cerr = copyFile(src, dst) + if cerr != nil { + cerr = errors.Wrap(cerr, "copying file failed") + } + } + + if cerr != nil { + return errors.Wrapf(cerr, "rename fallback failed: cannot rename %s to %s", src, dst) + } + + return errors.Wrapf(os.RemoveAll(src), "cannot delete %s", src) +} + +// IsDir determines is the path given is a directory or not. +func IsDir(name string) (bool, error) { + fi, err := os.Stat(name) + if err != nil { + return false, err + } + if !fi.IsDir() { + return false, errors.Errorf("%q is not a directory", name) + } + return true, nil +} + +var ( + errSrcNotDir = errors.New("source is not a directory") + errDstExist = errors.New("destination already exists") +) + +// CopyDir recursively copies a directory tree, attempting to preserve permissions. +// Source directory must exist, destination directory must *not* exist. +func CopyDir(src, dst string) error { + src = filepath.Clean(src) + dst = filepath.Clean(dst) + + // We use os.Lstat() here to ensure we don't fall in a loop where a symlink + // actually links to a one of its parent directories. + fi, err := os.Lstat(src) + if err != nil { + return err + } + if !fi.IsDir() { + return errSrcNotDir + } + + _, err = os.Stat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + if err == nil { + return errDstExist + } + + if err = os.MkdirAll(dst, fi.Mode()); err != nil { + return errors.Wrapf(err, "cannot mkdir %s", dst) + } + + entries, err := ioutil.ReadDir(src) + if err != nil { + return errors.Wrapf(err, "cannot read directory %s", dst) + } + + for _, entry := range entries { + srcPath := filepath.Join(src, entry.Name()) + dstPath := filepath.Join(dst, entry.Name()) + + if entry.IsDir() { + if err = CopyDir(srcPath, dstPath); err != nil { + return errors.Wrap(err, "copying directory failed") + } + } else { + // This will include symlinks, which is what we want when + // copying things. + if err = copyFile(srcPath, dstPath); err != nil { + return errors.Wrap(err, "copying file failed") + } + } + } + + return nil +} + +// copyFile copies the contents of the file named src to the file named +// by dst. The file will be created if it does not already exist. If the +// destination file exists, all its contents will be replaced by the contents +// of the source file. The file mode will be copied from the source. +func copyFile(src, dst string) (err error) { + if sym, err := IsSymlink(src); err != nil { + return errors.Wrap(err, "symlink check failed") + } else if sym { + if err := cloneSymlink(src, dst); err != nil { + if runtime.GOOS == "windows" { + // If cloning the symlink fails on Windows because the user + // does not have the required privileges, ignore the error and + // fall back to copying the file contents. + // + // ERROR_PRIVILEGE_NOT_HELD is 1314 (0x522): + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681385(v=vs.85).aspx + if lerr, ok := err.(*os.LinkError); ok && lerr.Err != syscall.Errno(1314) { + return err + } + } else { + return err + } + } else { + return nil + } + } + + in, err := os.Open(src) + if err != nil { + return + } + defer in.Close() + + out, err := os.Create(dst) + if err != nil { + return + } + + if _, err = io.Copy(out, in); err != nil { + out.Close() + return + } + + // Check for write errors on Close + if err = out.Close(); err != nil { + return + } + + si, err := os.Stat(src) + if err != nil { + return + } + + // Temporary fix for Go < 1.9 + // + // See: https://github.com/golang/dep/issues/774 + // and https://github.com/golang/go/issues/20829 + if runtime.GOOS == "windows" { + dst = fixLongPath(dst) + } + err = os.Chmod(dst, si.Mode()) + + return +} + +// IsSymlink determines if the given path is a symbolic link. +func IsSymlink(path string) (bool, error) { + l, err := os.Lstat(path) + if err != nil { + return false, err + } + + return l.Mode()&os.ModeSymlink == os.ModeSymlink, nil +} + +// cloneSymlink will create a new symlink that points to the resolved path of sl. +// If sl is a relative symlink, dst will also be a relative symlink. +func cloneSymlink(sl, dst string) error { + resolved, err := os.Readlink(sl) + if err != nil { + return err + } + + return os.Symlink(resolved, dst) +} + +// fixLongPath returns the extended-length (\\?\-prefixed) form of +// path when needed, in order to avoid the default 260 character file +// path limit imposed by Windows. If path is not easily converted to +// the extended-length form (for example, if path is a relative path +// or contains .. elements), or is short enough, fixLongPath returns +// path unmodified. +// +// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath +func fixLongPath(path string) string { + // Do nothing (and don't allocate) if the path is "short". + // Empirically (at least on the Windows Server 2013 builder), + // the kernel is arbitrarily okay with < 248 bytes. That + // matches what the docs above say: + // "When using an API to create a directory, the specified + // path cannot be so long that you cannot append an 8.3 file + // name (that is, the directory name cannot exceed MAX_PATH + // minus 12)." Since MAX_PATH is 260, 260 - 12 = 248. + // + // The MSDN docs appear to say that a normal path that is 248 bytes long + // will work; empirically the path must be less then 248 bytes long. + if len(path) < 248 { + // Don't fix. (This is how Go 1.7 and earlier worked, + // not automatically generating the \\?\ form) + return path + } + + // The extended form begins with \\?\, as in + // \\?\c:\windows\foo.txt or \\?\UNC\server\share\foo.txt. + // The extended form disables evaluation of . and .. path + // elements and disables the interpretation of / as equivalent + // to \. The conversion here rewrites / to \ and elides + // . elements as well as trailing or duplicate separators. For + // simplicity it avoids the conversion entirely for relative + // paths or paths containing .. elements. For now, + // \\server\share paths are not converted to + // \\?\UNC\server\share paths because the rules for doing so + // are less well-specified. + if len(path) >= 2 && path[:2] == `\\` { + // Don't canonicalize UNC paths. + return path + } + if !isAbs(path) { + // Relative path + return path + } + + const prefix = `\\?` + + pathbuf := make([]byte, len(prefix)+len(path)+len(`\`)) + copy(pathbuf, prefix) + n := len(path) + r, w := 0, len(prefix) + for r < n { + switch { + case os.IsPathSeparator(path[r]): + // empty block + r++ + case path[r] == '.' && (r+1 == n || os.IsPathSeparator(path[r+1])): + // /./ + r++ + case r+1 < n && path[r] == '.' && path[r+1] == '.' && (r+2 == n || os.IsPathSeparator(path[r+2])): + // /../ is currently unhandled + return path + default: + pathbuf[w] = '\\' + w++ + for ; r < n && !os.IsPathSeparator(path[r]); r++ { + pathbuf[w] = path[r] + w++ + } + } + } + // A drive's root directory needs a trailing \ + if w == len(`\\?\c:`) { + pathbuf[w] = '\\' + w++ + } + return string(pathbuf[:w]) +} + +func isAbs(path string) (b bool) { + v := volumeName(path) + if v == "" { + return false + } + path = path[len(v):] + if path == "" { + return false + } + return os.IsPathSeparator(path[0]) +} + +func volumeName(path string) (v string) { + if len(path) < 2 { + return "" + } + // with drive letter + c := path[0] + if path[1] == ':' && + ('0' <= c && c <= '9' || 'a' <= c && c <= 'z' || + 'A' <= c && c <= 'Z') { + return path[:2] + } + // is it UNC + if l := len(path); l >= 5 && os.IsPathSeparator(path[0]) && os.IsPathSeparator(path[1]) && + !os.IsPathSeparator(path[2]) && path[2] != '.' { + // first, leading `\\` and next shouldn't be `\`. its server name. + for n := 3; n < l-1; n++ { + // second, next '\' shouldn't be repeated. + if os.IsPathSeparator(path[n]) { + n++ + // third, following something characters. its share name. + if !os.IsPathSeparator(path[n]) { + if path[n] == '.' { + break + } + for ; n < l; n++ { + if os.IsPathSeparator(path[n]) { + break + } + } + return path[:n] + } + break + } + } + } + return "" +} diff --git a/src/agent/internal/third_party/dep/fs/rename.go b/src/agent/internal/third_party/dep/fs/rename.go new file mode 100644 index 00000000000..277e9b72973 --- /dev/null +++ b/src/agent/internal/third_party/dep/fs/rename.go @@ -0,0 +1,59 @@ +//go:build !windows +// +build !windows + +/* +Copyright (c) for portions of rename.go are held by The Go Authors, 2016 and are provided under +the BSD license. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package fs + +import ( + "os" + "syscall" + + "github.com/pkg/errors" +) + +// renameFallback attempts to determine the appropriate fallback to failed rename +// operation depending on the resulting error. +func renameFallback(err error, src, dst string) error { + // Rename may fail if src and dst are on different devices; fall back to + // copy if we detect that case. syscall.EXDEV is the common name for the + // cross device link error which has varying output text across different + // operating systems. + terr, ok := err.(*os.LinkError) + if !ok { + return err + } else if terr.Err != syscall.EXDEV { + return errors.Wrapf(terr, "link error: cannot rename %s to %s", src, dst) + } + + return renameByCopy(src, dst) +} diff --git a/src/agent/internal/third_party/dep/fs/rename_windows.go b/src/agent/internal/third_party/dep/fs/rename_windows.go new file mode 100644 index 00000000000..d8207cc5f7a --- /dev/null +++ b/src/agent/internal/third_party/dep/fs/rename_windows.go @@ -0,0 +1,70 @@ +//go:build windows +// +build windows + +/* +Copyright (c) for portions of rename_windows.go are held by The Go Authors, 2016 and are provided under +the BSD license. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package fs + +import ( + "os" + "syscall" + + "github.com/pkg/errors" +) + +// renameFallback attempts to determine the appropriate fallback to failed rename +// operation depending on the resulting error. +func renameFallback(err error, src, dst string) error { + // Rename may fail if src and dst are on different devices; fall back to + // copy if we detect that case. syscall.EXDEV is the common name for the + // cross device link error which has varying output text across different + // operating systems. + terr, ok := err.(*os.LinkError) + if !ok { + return err + } + + if terr.Err != syscall.EXDEV { + // In windows it can drop down to an operating system call that + // returns an operating system error with a different number and + // message. Checking for that as a fall back. + noerr, ok := terr.Err.(syscall.Errno) + + // 0x11 (ERROR_NOT_SAME_DEVICE) is the windows error. + // See https://msdn.microsoft.com/en-us/library/cc231199.aspx + if ok && noerr != 0x11 { + return errors.Wrapf(terr, "link error: cannot rename %s to %s", src, dst) + } + } + + return renameByCopy(src, dst) +} diff --git a/src/agent/src/cmd/agent/main.go b/src/agent/src/cmd/agent/main.go index 02b24d9b50a..2afcdd8e7fa 100644 --- a/src/agent/src/cmd/agent/main.go +++ b/src/agent/src/cmd/agent/main.go @@ -28,16 +28,16 @@ package main import ( - "encoding/json" "fmt" "os" + "path/filepath" "runtime" "strings" "github.com/Tencent/bk-ci/src/agent/src/pkg/agent" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) const ( @@ -45,6 +45,14 @@ const ( ) func main() { + // 初始化日志 + logFilePath := filepath.Join(systemutil.GetWorkDir(), "logs", "devopsAgent.log") + err := logs.Init(logFilePath) + if err != nil { + fmt.Printf("init agent log error %v\n", err) + systemutil.ExitProcess(1) + } + if len(os.Args) == 2 && os.Args[1] == "version" { fmt.Println(config.AgentVersion) systemutil.ExitProcess(0) @@ -55,13 +63,12 @@ func main() { // 以agent安装目录为工作目录 workDir := systemutil.GetExecutableDir() - err := os.Chdir(workDir) + err = os.Chdir(workDir) if err != nil { logs.Info("change work dir failed, err: ", err.Error()) systemutil.ExitProcess(1) } - initLog() defer func() { if err := recover(); err != nil { logs.Error("panic: ", err) @@ -84,14 +91,6 @@ func main() { agent.Run() } -func initLog() { - logConfig := make(map[string]string) - logConfig["filename"] = systemutil.GetWorkDir() + "/logs/devopsAgent.log" - logConfig["perm"] = "0666" - jsonConfig, _ := json.Marshal(logConfig) - logs.SetLogger(logs.AdapterFile, string(jsonConfig)) -} - func logEnv() { logs.Info("agent envs: ") for _, v := range os.Environ() { diff --git a/src/agent/src/cmd/daemon/main.go b/src/agent/src/cmd/daemon/main.go index 4158e41d281..9c9bca3f242 100644 --- a/src/agent/src/cmd/daemon/main.go +++ b/src/agent/src/cmd/daemon/main.go @@ -34,16 +34,15 @@ import ( "fmt" "os" "os/exec" + "path/filepath" "runtime" "time" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" "github.com/gofrs/flock" - - "encoding/json" ) const ( @@ -52,6 +51,14 @@ const ( ) func main() { + // 初始化日志 + logFilePath := filepath.Join(systemutil.GetWorkDir(), "logs", "devopsDaemon.log") + err := logs.Init(logFilePath) + if err != nil { + fmt.Printf("init daemon log error %v\n", err) + systemutil.ExitProcess(1) + } + if len(os.Args) == 2 && os.Args[1] == "version" { fmt.Println(config.AgentVersion) systemutil.ExitProcess(0) @@ -61,13 +68,12 @@ func main() { runtime.GOMAXPROCS(4) workDir := systemutil.GetExecutableDir() - err := os.Chdir(workDir) + err = os.Chdir(workDir) if err != nil { logs.Info("change work dir failed, err: ", err.Error()) systemutil.ExitProcess(1) } - initLog() defer func() { if err := recover(); err != nil { logs.Error("panic: ", err) @@ -87,14 +93,6 @@ func main() { systemutil.KeepProcessAlive() } -func initLog() { - logConfig := make(map[string]string) - logConfig["filename"] = systemutil.GetWorkDir() + "/logs/devopsDaemon.log" - logConfig["perm"] = "0666" - jsonConfig, _ := json.Marshal(logConfig) - logs.SetLogger(logs.AdapterFile, string(jsonConfig)) -} - func watch() { totalLock := flock.New(fmt.Sprintf("%s/%s.lock", systemutil.GetRuntimeDir(), systemutil.TotalLock)) @@ -121,15 +119,22 @@ func doCheckAndLaunchAgent() { workDir := systemutil.GetWorkDir() agentLock := flock.New(fmt.Sprintf("%s/agent.lock", systemutil.GetRuntimeDir())) - defer func() { _ = agentLock.Unlock() }() // #1613 fix open too many files - ok, err := agentLock.TryLock() + locked, err := agentLock.TryLock() + if err == nil && locked { + // #1613 fix open too many files + defer func() { + err = agentLock.Unlock() + logs.Error("try to unlock agent.lock failed: %v", err) + }() + } if err != nil { logs.Error("try to get agent.lock failed: %v", err) return } - if !ok { + if !locked { return } + logs.Warn("agent is not available, will launch it") process, err := launch(workDir + "/" + config.AgentFileClientLinux) diff --git a/src/agent/src/cmd/daemon/main_win.go b/src/agent/src/cmd/daemon/main_win.go index df57aab37cf..d1e77c7b9d7 100644 --- a/src/agent/src/cmd/daemon/main_win.go +++ b/src/agent/src/cmd/daemon/main_win.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows /* @@ -30,23 +31,31 @@ package main import ( - "encoding/json" "fmt" "os" "os/exec" + "path/filepath" "runtime" "time" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" "github.com/kardianos/service" ) const daemonProcess = "daemon" func main() { + // 初始化日志 + logFilePath := filepath.Join(systemutil.GetWorkDir(), "logs", "devopsDaemon.log") + err := logs.Init(logFilePath) + if err != nil { + fmt.Printf("init daemon log error %v\n", err) + systemutil.ExitProcess(1) + } + if len(os.Args) == 2 && os.Args[1] == "version" { fmt.Println(config.AgentVersion) systemutil.ExitProcess(0) @@ -55,13 +64,12 @@ func main() { runtime.GOMAXPROCS(4) workDir := systemutil.GetExecutableDir() - err := os.Chdir(workDir) + err = os.Chdir(workDir) if err != nil { logs.Info("change work dir failed, err: ", err.Error()) systemutil.ExitProcess(1) } - initLog() defer func() { if err := recover(); err != nil { logs.Error("panic: ", err) @@ -102,13 +110,6 @@ func main() { var GAgentProcess *os.Process = nil -func initLog() { - logConfig := make(map[string]string) - logConfig["filename"] = systemutil.GetWorkDir() + "/logs/devopsDaemon.log" - jsonConfig, _ := json.Marshal(logConfig) - logs.SetLogger(logs.AdapterFile, string(jsonConfig)) -} - func watch() { workDir := systemutil.GetExecutableDir() var agentPath = systemutil.GetWorkDir() + "/devopsAgent.exe" diff --git a/src/agent/src/cmd/installer/main.go b/src/agent/src/cmd/installer/main.go index 026165164c9..f2485a1c6ae 100644 --- a/src/agent/src/cmd/installer/main.go +++ b/src/agent/src/cmd/installer/main.go @@ -28,26 +28,35 @@ package main import ( - "encoding/json" "flag" + "fmt" "os" + "path/filepath" "runtime" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" "github.com/Tencent/bk-ci/src/agent/src/pkg/installer" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) const ( installerProcess = "installer" - agentProcess = "agent" - daemonProcess = "daemon" + agentProcess = "agent" + daemonProcess = "daemon" ) func main() { + // 初始化日志 + logFilePath := filepath.Join(systemutil.GetWorkDir(), "logs", "devopsInstaller.log") + err := logs.Init(logFilePath) + if err != nil { + fmt.Printf("init installer log error %v\n", err) + systemutil.ExitProcess(1) + } + runtime.GOMAXPROCS(4) - initLog() + defer func() { if err := recover(); err != nil { logs.Error("panic: ", err) @@ -84,11 +93,3 @@ func main() { } systemutil.ExitProcess(0) } - -func initLog() { - logConfig := make(map[string]string) - logConfig["filename"] = systemutil.GetWorkDir() + "/logs/devopsInstaller.log" - logConfig["perm"] = "0666" - jsonConfig, _ := json.Marshal(logConfig) - logs.SetLogger(logs.AdapterFile, string(jsonConfig)) -} diff --git a/src/agent/src/cmd/upgrader/main.go b/src/agent/src/cmd/upgrader/main.go index 590ff91a57e..41b9db1d7a9 100644 --- a/src/agent/src/cmd/upgrader/main.go +++ b/src/agent/src/cmd/upgrader/main.go @@ -28,15 +28,16 @@ package main import ( - "encoding/json" "flag" + "fmt" "os" + "path/filepath" "runtime" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/upgrader" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) const ( @@ -44,8 +45,16 @@ const ( ) func main() { + // 初始化日志 + logFilePath := filepath.Join(systemutil.GetWorkDir(), "logs", "devopsUpgrader.log") + err := logs.Init(logFilePath) + if err != nil { + fmt.Printf("init upgrader log error %v\n", err) + systemutil.ExitProcess(1) + } + runtime.GOMAXPROCS(4) - initLog() + defer func() { if err := recover(); err != nil { logs.Error("panic: ", err) @@ -82,11 +91,3 @@ func main() { } systemutil.ExitProcess(0) } - -func initLog() { - logConfig := make(map[string]string) - logConfig["filename"] = systemutil.GetWorkDir() + "/logs/devopsUpgrader.log" - logConfig["perm"] = "0666" - jsonConfig, _ := json.Marshal(logConfig) - logs.SetLogger(logs.AdapterFile, string(jsonConfig)) -} diff --git a/src/agent/src/pkg/agent/agent.go b/src/agent/src/pkg/agent/agent.go index d73741b80c9..dfcc38b5f85 100644 --- a/src/agent/src/pkg/agent/agent.go +++ b/src/agent/src/pkg/agent/agent.go @@ -33,9 +33,9 @@ import ( "github.com/Tencent/bk-ci/src/agent/src/pkg/cron" "github.com/Tencent/bk-ci/src/agent/src/pkg/heartbeat" "github.com/Tencent/bk-ci/src/agent/src/pkg/job" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/pipeline" "github.com/Tencent/bk-ci/src/agent/src/pkg/upgrade" - "github.com/astaxie/beego/logs" ) func Run() { diff --git a/src/agent/src/pkg/collector/collector.go b/src/agent/src/pkg/collector/collector.go index 3b5a866cfa0..94b13499958 100644 --- a/src/agent/src/pkg/collector/collector.go +++ b/src/agent/src/pkg/collector/collector.go @@ -30,16 +30,19 @@ package collector import ( "context" "fmt" + "github.com/influxdata/telegraf/logger" "time" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/influxdata/telegraf/cmd/bktelegraf" + + "github.com/influxdata/telegraf/agent" + telegrafConfig "github.com/influxdata/telegraf/config" "io/ioutil" "strings" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" - "github.com/astaxie/beego/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" ) const ( @@ -212,7 +215,7 @@ func DoAgentCollect() { writeTelegrafConfig() - tAgent, err := bktelegraf.GetTelegrafAgent( + tAgent, err := getTelegrafAgent( fmt.Sprintf("%s/%s", systemutil.GetWorkDir(), telegrafConfigFile), fmt.Sprintf("%s/logs/telegraf.log", systemutil.GetWorkDir()), ) @@ -230,6 +233,23 @@ func DoAgentCollect() { } } +func getTelegrafAgent(configFile, logFile string) (*agent.Agent, error) { + // get a new config and parse configuration from file. + c := telegrafConfig.NewConfig() + if err := c.LoadConfig(configFile); err != nil { + return nil, err + } + + logConfig := logger.LogConfig{ + Logfile: logFile, + LogTarget: logger.LogTargetFile, + RotationMaxArchives: -1, + } + + logger.SetupLogging(logConfig) + return agent.NewAgent(c) +} + func writeTelegrafConfig() { var configTemplate string if systemutil.IsWindows() { diff --git a/src/agent/src/pkg/collector/telegraf_plugins.go b/src/agent/src/pkg/collector/telegraf_plugins.go new file mode 100644 index 00000000000..36859360469 --- /dev/null +++ b/src/agent/src/pkg/collector/telegraf_plugins.go @@ -0,0 +1,17 @@ +package collector + +import ( + _ "github.com/influxdata/telegraf/plugins/inputs/cpu" + _ "github.com/influxdata/telegraf/plugins/inputs/disk" + _ "github.com/influxdata/telegraf/plugins/inputs/diskio" + _ "github.com/influxdata/telegraf/plugins/inputs/kernel" + _ "github.com/influxdata/telegraf/plugins/inputs/mem" + _ "github.com/influxdata/telegraf/plugins/inputs/net" + _ "github.com/influxdata/telegraf/plugins/inputs/processes" + _ "github.com/influxdata/telegraf/plugins/inputs/system" + _ "github.com/influxdata/telegraf/plugins/inputs/win_perf_counters" + + _ "github.com/influxdata/telegraf/plugins/outputs/influxdb" +) + +// 将生成telegraf需要用到的插件依赖,这些插件会执行响应的 init() 函数来加入到 telegraf.config 中,才能生成相关的 telegraf agent diff --git a/src/agent/src/pkg/config/config.go b/src/agent/src/pkg/config/config.go index b4bd9537913..fb9a5f27862 100644 --- a/src/agent/src/pkg/config/config.go +++ b/src/agent/src/pkg/config/config.go @@ -33,18 +33,19 @@ import ( "crypto/x509" "errors" "fmt" + "gopkg.in/ini.v1" "io/ioutil" "net/http" "os" + "path/filepath" "strconv" "strings" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/command" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - bconfig "github.com/astaxie/beego/config" - "github.com/astaxie/beego/logs" ) const ( @@ -210,68 +211,68 @@ func BuildAgentJarPath() string { func LoadAgentConfig() error { GAgentConfig = new(AgentConfig) - conf, err := bconfig.NewConfig("ini", systemutil.GetWorkDir()+"/.agent.properties") + conf, err := ini.Load(filepath.Join(systemutil.GetWorkDir(), ".agent.properties")) if err != nil { logs.Error("load agent config failed, ", err) return errors.New("load agent config failed") } - parallelTaskCount, err := conf.Int(KeyTaskCount) + parallelTaskCount, err := conf.Section("").Key(KeyTaskCount).Int() if err != nil || parallelTaskCount < 0 { return errors.New("invalid parallelTaskCount") } - projectId := strings.TrimSpace(conf.String(KeyProjectId)) + projectId := strings.TrimSpace(conf.Section("").Key(KeyProjectId).String()) if len(projectId) == 0 { return errors.New("invalid projectId") } - agentId := conf.String(KeyAgentId) + agentId := conf.Section("").Key(KeyAgentId).String() if len(agentId) == 0 { return errors.New("invalid agentId") } - secretKey := strings.TrimSpace(conf.String(KeySecretKey)) + secretKey := strings.TrimSpace(conf.Section("").Key(KeySecretKey).String()) if len(secretKey) == 0 { return errors.New("invalid secretKey") } - landunGateway := strings.TrimSpace(conf.String(KeyDevopsGateway)) + landunGateway := strings.TrimSpace(conf.Section("").Key(KeyDevopsGateway).String()) if len(landunGateway) == 0 { return errors.New("invalid landunGateway") } - landunFileGateway := strings.TrimSpace(conf.String(KeyDevopsFileGateway)) + landunFileGateway := strings.TrimSpace(conf.Section("").Key(KeyDevopsFileGateway).String()) if len(landunFileGateway) == 0 { logs.Warn("fileGateway is empty") } - envType := strings.TrimSpace(conf.String(KeyEnvType)) + envType := strings.TrimSpace(conf.Section("").Key(KeyEnvType).String()) if len(envType) == 0 { return errors.New("invalid envType") } - slaveUser := strings.TrimSpace(conf.String(KeySlaveUser)) + slaveUser := strings.TrimSpace(conf.Section("").Key(KeySlaveUser).String()) if len(slaveUser) == 0 { slaveUser = systemutil.GetCurrentUser().Username } - collectorOn, err := conf.Bool(KeyCollectorOn) + collectorOn, err := conf.Section("").Key(KeyCollectorOn).Bool() if err != nil { collectorOn = true } - timeout, err := conf.Int64(KeyRequestTimeoutSec) + timeout, err := conf.Section("").Key(KeyRequestTimeoutSec).Int64() if err != nil { timeout = 5 } - detectShell := conf.DefaultBool(KeyDetectShell, false) + detectShell := conf.Section("").Key(KeyDetectShell).MustBool(false) - ignoreLocalIps := strings.TrimSpace(conf.String(KeyIgnoreLocalIps)) + ignoreLocalIps := strings.TrimSpace(conf.Section("").Key(KeyIgnoreLocalIps).String()) if len(ignoreLocalIps) == 0 { ignoreLocalIps = "127.0.0.1" } - GAgentConfig.BatchInstallKey = strings.TrimSpace(conf.String(KeyBatchInstall)) + GAgentConfig.BatchInstallKey = strings.TrimSpace(conf.Section("").Key(KeyBatchInstall).String()) GAgentConfig.Gateway = landunGateway systemutil.DevopsGateway = landunGateway @@ -370,7 +371,7 @@ func initCert() { logs.Warn("Reading server certificate: %s", err) return } - logs.Informational("Cert content is: %s", string(caCert)) + logs.Info("Cert content is: %s", string(caCert)) caCertPool, err := x509.SystemCertPool() // Windows 下 SystemCertPool 返回 nil if err != nil || caCertPool == nil { @@ -380,6 +381,6 @@ func initCert() { caCertPool.AppendCertsFromPEM(caCert) tlsConfig := &tls.Config{RootCAs: caCertPool} http.DefaultTransport.(*http.Transport).TLSClientConfig = tlsConfig - logs.Informational("load cert success") + logs.Info("load cert success") UseCert = true } diff --git a/src/agent/src/pkg/config/version.go b/src/agent/src/pkg/config/version.go index 24791ad9cc3..12eb42c680d 100644 --- a/src/agent/src/pkg/config/version.go +++ b/src/agent/src/pkg/config/version.go @@ -27,4 +27,4 @@ package config -const AgentVersion = "v1.8.5" +const AgentVersion = "v1.9.0" diff --git a/src/agent/src/pkg/cron/cron.go b/src/agent/src/pkg/cron/cron.go index 595f760464c..4d434348d10 100644 --- a/src/agent/src/pkg/cron/cron.go +++ b/src/agent/src/pkg/cron/cron.go @@ -34,9 +34,9 @@ import ( "strings" "time" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) func CleanJob() { diff --git a/src/agent/src/pkg/heartbeat/heartbeat.go b/src/agent/src/pkg/heartbeat/heartbeat.go index d65b306d8ac..13a857f1c89 100644 --- a/src/agent/src/pkg/heartbeat/heartbeat.go +++ b/src/agent/src/pkg/heartbeat/heartbeat.go @@ -28,90 +28,90 @@ package heartbeat import ( - "errors" - "time" + "errors" + "time" - "github.com/Tencent/bk-ci/src/agent/src/pkg/api" - "github.com/Tencent/bk-ci/src/agent/src/pkg/config" - "github.com/Tencent/bk-ci/src/agent/src/pkg/job" - "github.com/Tencent/bk-ci/src/agent/src/pkg/upgrade" - "github.com/Tencent/bk-ci/src/agent/src/pkg/util" - "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/api" + "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/job" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/upgrade" + "github.com/Tencent/bk-ci/src/agent/src/pkg/util" + "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" ) func DoAgentHeartbeat() { - for { - agentHeartbeat() - time.Sleep(10 * time.Second) - } + for { + agentHeartbeat() + time.Sleep(10 * time.Second) + } } func agentHeartbeat() error { - result, err := api.Heartbeat(job.GBuildManager.GetInstances()) - if err != nil { - logs.Error("agent heartbeat failed: ", err.Error()) - return errors.New("agent heartbeat failed") - } - if result.IsNotOk() { - logs.Error("agent heartbeat failed: ", result.Message) - return errors.New("agent heartbeat failed") - } + result, err := api.Heartbeat(job.GBuildManager.GetInstances()) + if err != nil { + logs.Error("agent heartbeat failed: ", err.Error()) + return errors.New("agent heartbeat failed") + } + if result.IsNotOk() { + logs.Error("agent heartbeat failed: ", result.Message) + return errors.New("agent heartbeat failed") + } - heartbeatResponse := new(api.AgentHeartbeatResponse) - err = util.ParseJsonToData(result.Data, &heartbeatResponse) - if err != nil { - logs.Error("agent heartbeat failed: ", err.Error()) - return errors.New("agent heartbeat failed") - } + heartbeatResponse := new(api.AgentHeartbeatResponse) + err = util.ParseJsonToData(result.Data, &heartbeatResponse) + if err != nil { + logs.Error("agent heartbeat failed: ", err.Error()) + return errors.New("agent heartbeat failed") + } - if heartbeatResponse.AgentStatus == config.AgentStatusDelete { - upgrade.UninstallAgent() - return nil - } + if heartbeatResponse.AgentStatus == config.AgentStatusDelete { + upgrade.UninstallAgent() + return nil + } - // agent配置 - configChanged := false - if config.GAgentConfig.ParallelTaskCount != heartbeatResponse.ParallelTaskCount { - config.GAgentConfig.ParallelTaskCount = heartbeatResponse.ParallelTaskCount - configChanged = true - } - if heartbeatResponse.Gateway != "" && heartbeatResponse.Gateway != config.GAgentConfig.Gateway { - config.GAgentConfig.Gateway = heartbeatResponse.Gateway - systemutil.DevopsGateway = heartbeatResponse.Gateway - configChanged = true - } - if heartbeatResponse.FileGateway != "" && heartbeatResponse.FileGateway != config.GAgentConfig.FileGateway { - config.GAgentConfig.FileGateway = heartbeatResponse.FileGateway - configChanged = true - } - if configChanged { - config.GAgentConfig.SaveConfig() - } + // agent配置 + configChanged := false + if config.GAgentConfig.ParallelTaskCount != heartbeatResponse.ParallelTaskCount { + config.GAgentConfig.ParallelTaskCount = heartbeatResponse.ParallelTaskCount + configChanged = true + } + if heartbeatResponse.Gateway != "" && heartbeatResponse.Gateway != config.GAgentConfig.Gateway { + config.GAgentConfig.Gateway = heartbeatResponse.Gateway + systemutil.DevopsGateway = heartbeatResponse.Gateway + configChanged = true + } + if heartbeatResponse.FileGateway != "" && heartbeatResponse.FileGateway != config.GAgentConfig.FileGateway { + config.GAgentConfig.FileGateway = heartbeatResponse.FileGateway + configChanged = true + } + if configChanged { + config.GAgentConfig.SaveConfig() + } - // agent环境变量 - config.GEnvVars = heartbeatResponse.Envs + // agent环境变量 + config.GEnvVars = heartbeatResponse.Envs - /* - 忽略一些在Windows机器上VPN代理软件所产生的虚拟网卡(有Mac地址)的IP,一般这类IP - 更像是一些路由器的192开头的IP,属于干扰IP,安装了这类软件的windows机器IP都会变成相同,所以需要忽略掉 - */ - if len(config.GAgentConfig.IgnoreLocalIps) > 0 { - splitIps := util.SplitAndTrimSpace(config.GAgentConfig.IgnoreLocalIps, ",") - if util.Contains(splitIps, config.GAgentEnv.AgentIp) { // Agent检测到的IP与要忽略的本地VPN IP相同,则更换真正IP - config.GAgentEnv.AgentIp = systemutil.GetAgentIp(splitIps) - } - } + /* + 忽略一些在Windows机器上VPN代理软件所产生的虚拟网卡(有Mac地址)的IP,一般这类IP + 更像是一些路由器的192开头的IP,属于干扰IP,安装了这类软件的windows机器IP都会变成相同,所以需要忽略掉 + */ + if len(config.GAgentConfig.IgnoreLocalIps) > 0 { + splitIps := util.SplitAndTrimSpace(config.GAgentConfig.IgnoreLocalIps, ",") + if util.Contains(splitIps, config.GAgentEnv.AgentIp) { // Agent检测到的IP与要忽略的本地VPN IP相同,则更换真正IP + config.GAgentEnv.AgentIp = systemutil.GetAgentIp(splitIps) + } + } - // 检测agent版本与agent文件是否匹配 - if config.AgentVersion != heartbeatResponse.MasterVersion { - agentFileVersion := config.DetectAgentVersion() - if agentFileVersion != "" && config.AgentVersion != agentFileVersion { - logs.Warn("agent version mismatch, exiting agent process") - systemutil.ExitProcess(1) - } - } + // 检测agent版本与agent文件是否匹配 + if config.AgentVersion != heartbeatResponse.MasterVersion { + agentFileVersion := config.DetectAgentVersion() + if agentFileVersion != "" && config.AgentVersion != agentFileVersion { + logs.Warn("agent version mismatch, exiting agent process") + systemutil.ExitProcess(1) + } + } - logs.Info("agent heartbeat done") - return nil + logs.Info("agent heartbeat done") + return nil } diff --git a/src/agent/src/pkg/installer/installer.go b/src/agent/src/pkg/installer/installer.go index ca71ecf3508..d4e2762f11c 100644 --- a/src/agent/src/pkg/installer/installer.go +++ b/src/agent/src/pkg/installer/installer.go @@ -33,10 +33,10 @@ import ( "github.com/Tencent/bk-ci/src/agent/src/pkg/api" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/command" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" "github.com/gofrs/flock" ) diff --git a/src/agent/src/pkg/installer/installer_test.go b/src/agent/src/pkg/installer/installer_test.go index da71b84a432..085aa38c6f5 100644 --- a/src/agent/src/pkg/installer/installer_test.go +++ b/src/agent/src/pkg/installer/installer_test.go @@ -29,7 +29,6 @@ package installer import ( "testing" - "github.com/Tencent/bk-ci/src/agent/src/pkg/installer" ) func Test_DoInstallAgent_01(t *testing.T) { diff --git a/src/agent/src/pkg/job/build.go b/src/agent/src/pkg/job/build.go index 97c789c134f..512428b1fd7 100644 --- a/src/agent/src/pkg/job/build.go +++ b/src/agent/src/pkg/job/build.go @@ -39,12 +39,12 @@ import ( "github.com/Tencent/bk-ci/src/agent/src/pkg/api" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/command" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/httputil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) const buildIntervalInSeconds = 5 @@ -86,7 +86,7 @@ func DoPollAndBuild() { time.Sleep(buildIntervalInSeconds * time.Second) agentStatus, err := getAgentStatus() if err != nil { - logs.Warning("get agent status err: ", err.Error()) + logs.Warn("get agent status err: ", err.Error()) continue } if agentStatus != config.AgentStatusImportOk { diff --git a/src/agent/src/pkg/job/build_manager.go b/src/agent/src/pkg/job/build_manager.go index e9bfbf1a90e..27654b82385 100644 --- a/src/agent/src/pkg/job/build_manager.go +++ b/src/agent/src/pkg/job/build_manager.go @@ -31,9 +31,9 @@ import ( "encoding/json" "fmt" "github.com/Tencent/bk-ci/src/agent/src/pkg/api" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" "os" ) diff --git a/src/agent/src/pkg/logs/logs.go b/src/agent/src/pkg/logs/logs.go new file mode 100644 index 00000000000..f513e3b29fe --- /dev/null +++ b/src/agent/src/pkg/logs/logs.go @@ -0,0 +1,115 @@ +package logs + +import ( + "bytes" + "fmt" + "github.com/sirupsen/logrus" + "gopkg.in/natefinch/lumberjack.v2" + "path/filepath" + "strings" +) + +var logs *logrus.Logger + +func Init(filepath string) error { + logInfo := logrus.New() + + logInfo.Out = &lumberjack.Logger{ + Filename: filepath, + MaxAge: 7, + LocalTime: true, + } + + logInfo.SetFormatter(&MyFormatter{}) + + logs = logInfo + + return nil +} + +type MyFormatter struct{} + +func (m *MyFormatter) Format(entry *logrus.Entry) ([]byte, error) { + var b *bytes.Buffer + if entry.Buffer != nil { + b = entry.Buffer + } else { + b = &bytes.Buffer{} + } + + timestamp := entry.Time.Format("2006/01/02 15:04:01.002") + var newLog string + + //HasCaller()为true才会有调用信息 + if entry.HasCaller() { + fName := filepath.Base(entry.Caller.File) + newLog = fmt.Sprintf("%s [%s] [%s:%d %s] %s\n", + timestamp, entry.Level, fName, entry.Caller.Line, entry.Caller.Function, entry.Message) + } else { + level, err := parseLevel(entry.Level) + if err != nil { + return nil, err + } + newLog = fmt.Sprintf("%s [%s] %s\n", timestamp, level, entry.Message) + } + + b.WriteString(newLog) + return b.Bytes(), nil +} + +func parseLevel(l logrus.Level) (string, error) { + switch strings.ToLower(fmt.Sprintf("%s", l)) { + case "panic": + return "P", nil + case "fatal": + return "F", nil + case "error": + return "E", nil + case "warn", "warning": + return "W", nil + case "info": + return "I", nil + case "debug": + return "D", nil + case "trace": + return "T", nil + } + + return "U", fmt.Errorf("not a valid logrus Level: %q", l) +} + +func Info(f interface{}, v ...interface{}) { + logs.Info(formatLog(f, v...)) +} + +func Warn(f interface{}, v ...interface{}) { + logs.Warn(formatLog(f, v...)) +} + +func Error(f interface{}, v ...interface{}) { + logs.Error(formatLog(f, v...)) +} + +func formatLog(f interface{}, v ...interface{}) string { + var msg string + switch f.(type) { + case string: + msg = f.(string) + if len(v) == 0 { + return msg + } + if strings.Contains(msg, "%") && !strings.Contains(msg, "%%") { + //format string + } else { + //do not contain format char + msg += strings.Repeat(" %v", len(v)) + } + default: + msg = fmt.Sprint(f) + if len(v) == 0 { + return msg + } + msg += strings.Repeat(" %v", len(v)) + } + return fmt.Sprintf(msg, v...) +} diff --git a/src/agent/src/pkg/pipeline/pipeline.go b/src/agent/src/pkg/pipeline/pipeline.go index ffc8d8cdd77..6d5bce01302 100644 --- a/src/agent/src/pkg/pipeline/pipeline.go +++ b/src/agent/src/pkg/pipeline/pipeline.go @@ -37,10 +37,10 @@ import ( "time" "github.com/Tencent/bk-ci/src/agent/src/pkg/api" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/command" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) func Start() { diff --git a/src/agent/src/pkg/upgrade/download/download_darwin.go b/src/agent/src/pkg/upgrade/download/download_darwin.go new file mode 100644 index 00000000000..b06e3933a26 --- /dev/null +++ b/src/agent/src/pkg/upgrade/download/download_darwin.go @@ -0,0 +1,38 @@ +//go:build darwin +// +build darwin + +package download + +import ( + "github.com/Tencent/bk-ci/src/agent/src/pkg/api" + "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "runtime" +) + +func getServerFileArch() string { + var osArch string + if runtime.GOARCH == "arm64" { + osArch = "_macos_arm64" + } else { + osArch = "_macos" + } + return osArch +} + +func DownloadUpgradeFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/upgrader"+getServerFileArch(), saveDir+"/"+config.UpgraderFileClientLinux, + ) +} + +func DownloadDaemonFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/devopsDaemon"+getServerFileArch(), saveDir+"/"+config.DaemonFileClientLinux, + ) +} + +func DownloadAgentFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/devopsAgent"+getServerFileArch(), saveDir+"/"+config.AgentFileClientLinux, + ) +} diff --git a/src/agent/src/pkg/upgrade/download/download_unix.go b/src/agent/src/pkg/upgrade/download/download_unix.go new file mode 100644 index 00000000000..327358e9dbd --- /dev/null +++ b/src/agent/src/pkg/upgrade/download/download_unix.go @@ -0,0 +1,40 @@ +//go:build !windows && !darwin +// +build !windows,!darwin + +package download + +import ( + "github.com/Tencent/bk-ci/src/agent/src/pkg/api" + "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "runtime" +) + +func getServerFileArch() string { + var osArch string + if runtime.GOARCH == "arm64" { + osArch = "_linux_arm64" + } else if runtime.GOARCH == "mips64" { + osArch = "_linux_mips64" + } else { + osArch = "_linux" + } + return osArch +} + +func DownloadUpgradeFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/upgrader"+getServerFileArch(), saveDir+"/"+config.UpgraderFileServerMacOs, + ) +} + +func DownloadDaemonFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/devopsDaemon"+getServerFileArch(), saveDir+"/"+config.DaemonFileClientLinux, + ) +} + +func DownloadAgentFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/devopsAgent"+getServerFileArch(), saveDir+"/"+config.AgentFileClientLinux, + ) +} diff --git a/src/agent/src/pkg/upgrade/download/download_win.go b/src/agent/src/pkg/upgrade/download/download_win.go new file mode 100644 index 00000000000..f4b0ce8a58b --- /dev/null +++ b/src/agent/src/pkg/upgrade/download/download_win.go @@ -0,0 +1,27 @@ +//go:build windows +// +build windows + +package download + +import ( + "github.com/Tencent/bk-ci/src/agent/src/pkg/api" + "github.com/Tencent/bk-ci/src/agent/src/pkg/config" +) + +func DownloadUpgradeFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/upgrader.exe", saveDir+"/"+config.UpgraderFileClientWindows, + ) +} + +func DownloadDaemonFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/devopsDaemon.exe", saveDir+"/"+config.DaemonFileClientWindows, + ) +} + +func DownloadAgentFile(saveDir string) (string, error) { + return api.DownloadUpgradeFile( + "upgrade/devopsAgent.exe", saveDir+"/"+config.AgentFileClientWindows, + ) +} diff --git a/src/agent/src/pkg/upgrade/operation.go b/src/agent/src/pkg/upgrade/operation.go index e1ffb70bc92..d91ae70eaf4 100644 --- a/src/agent/src/pkg/upgrade/operation.go +++ b/src/agent/src/pkg/upgrade/operation.go @@ -32,11 +32,12 @@ import ( "os" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/command" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) + // UninstallAgent 卸载 func UninstallAgent() { logs.Info("start uninstall agent") @@ -46,9 +47,10 @@ func UninstallAgent() { logs.Error("start upgrader failed") return } - logs.Warning("agent process exiting") + logs.Warn("agent process exiting") systemutil.ExitProcess(0) } + // runUpgrader 执行升级器 func runUpgrader(action string) error { logs.Info("[agentUpgrade]|start upgrader process") @@ -75,10 +77,11 @@ func runUpgrader(action string) error { } logs.Info("[agentUpgrade]|start process success, pid: ", pid) - logs.Warning("[agentUpgrade]|agent process exiting") + logs.Warn("[agentUpgrade]|agent process exiting") systemutil.ExitProcess(0) return nil } + // DoUpgradeOperation 调用升级程序 func DoUpgradeOperation(agentChanged bool, workAgentChanged bool) error { logs.Info("[agentUpgrade]|start upgrade, agent changed: ", agentChanged, ", work agent changed: ", workAgentChanged) diff --git a/src/agent/src/pkg/upgrade/upgrade.go b/src/agent/src/pkg/upgrade/upgrade.go index 7d97ce8d0ea..51067a50d58 100644 --- a/src/agent/src/pkg/upgrade/upgrade.go +++ b/src/agent/src/pkg/upgrade/upgrade.go @@ -29,14 +29,15 @@ package upgrade import ( "errors" + "github.com/Tencent/bk-ci/src/agent/src/pkg/upgrade/download" "os" "time" "github.com/Tencent/bk-ci/src/agent/src/pkg/api" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) // DoPollAndUpgradeAgent 循环,每20s一次执行升级 @@ -48,6 +49,7 @@ func DoPollAndUpgradeAgent() { logs.Info("upgrade done") } } + // agentUpgrade 升级主逻辑 func agentUpgrade() { // #5806 #5172 升级失败,保证重置回状态,防止一直处于升级状态 @@ -96,6 +98,7 @@ func agentUpgrade() { success = true } } + // downloadUpgradeFiles 下载升级文件 func downloadUpgradeFiles() (agentChanged bool, workAgentChanged bool, err error) { workDir := systemutil.GetWorkDir() @@ -103,8 +106,7 @@ func downloadUpgradeFiles() (agentChanged bool, workAgentChanged bool, err error _ = os.MkdirAll(upgradeDir, os.ModePerm) logs.Info("[agentUpgrade]|download upgrader start") - _, err = api.DownloadUpgradeFile( - "upgrade/"+config.GetServerUpgraderFile(), upgradeDir+"/"+config.GetClientUpgraderFile()) + _, err = download.DownloadUpgradeFile(upgradeDir) if err != nil { logs.Error("[agentUpgrade]|download upgrader failed", err) return false, false, errors.New("download upgrader failed") @@ -112,8 +114,7 @@ func downloadUpgradeFiles() (agentChanged bool, workAgentChanged bool, err error logs.Info("[agentUpgrade]|download upgrader done") logs.Info("[agentUpgrade]|download daemon start") - newDaemonMd5, err := api.DownloadUpgradeFile( - "upgrade/"+config.GetServerDaemonFile(), upgradeDir+"/"+config.GetClientDaemonFile()) + newDaemonMd5, err := download.DownloadDaemonFile(upgradeDir) if err != nil { logs.Error("[agentUpgrade]|download daemon failed", err) return false, false, errors.New("download daemon failed") @@ -121,8 +122,7 @@ func downloadUpgradeFiles() (agentChanged bool, workAgentChanged bool, err error logs.Info("[agentUpgrade]|download daemon done") logs.Info("[agentUpgrade]|download agent start") - newAgentMd5, err := api.DownloadUpgradeFile( - "upgrade/"+config.GetServerAgentFile(), upgradeDir+"/"+config.GetClienAgentFile()) + newAgentMd5, err := download.DownloadAgentFile(upgradeDir) if err != nil { logs.Error("[agentUpgrade]|download agent failed", err) return false, false, errors.New("download agent failed") diff --git a/src/agent/src/pkg/upgrader/upgrader.go b/src/agent/src/pkg/upgrader/upgrader.go index 8dff872f31c..bd0b6030375 100644 --- a/src/agent/src/pkg/upgrader/upgrader.go +++ b/src/agent/src/pkg/upgrader/upgrader.go @@ -35,10 +35,10 @@ import ( "time" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/command" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" "github.com/gofrs/flock" ) @@ -61,14 +61,14 @@ func DoUpgradeAgent() error { daemonChange, _ := checkUpgradeFileChange(config.GetClientDaemonFile()) /* - #4686 - 1、kill devopsDaemon进程的行为在 macos 下, 如果当前是由 launchd 启动的(比如mac重启之后,devopsDaemon会由launchd接管启动) - 当upgrader进程触发kill devopsDaemon时,会导致当前upgrader进程也被系统一并停掉,所以要排除macos的进程停止操作,否则会导致升级中断 - - 2、windows 因早期daemon缺失 pid文件,在安装多个agent的机器上无法很正确的寻找到正确的进程,并且windows的启动方式较多,早期用户会使用 - 直接双击devopsDaemon.exe文件来启动,以此来保证构建进程能够正确拉起带UI的程序,所以这块无法正确查找到进程,因此暂时也不考虑windows的 - devopsDaemon.exe文件升级。 windows需要手动升级 - */ + #4686 + 1、kill devopsDaemon进程的行为在 macos 下, 如果当前是由 launchd 启动的(比如mac重启之后,devopsDaemon会由launchd接管启动) + 当upgrader进程触发kill devopsDaemon时,会导致当前upgrader进程也被系统一并停掉,所以要排除macos的进程停止操作,否则会导致升级中断 + + 2、windows 因早期daemon缺失 pid文件,在安装多个agent的机器上无法很正确的寻找到正确的进程,并且windows的启动方式较多,早期用户会使用 + 直接双击devopsDaemon.exe文件来启动,以此来保证构建进程能够正确拉起带UI的程序,所以这块无法正确查找到进程,因此暂时也不考虑windows的 + devopsDaemon.exe文件升级。 windows需要手动升级 + */ if daemonChange && systemutil.IsLinux() { tryKillAgentProcess(daemonProcess) // macos 在升级后只能使用手动重启 } @@ -184,7 +184,6 @@ func StartDaemon() error { workDir := systemutil.GetWorkDir() startCmd := workDir + "/" + config.GetClientDaemonFile() - if err := fileutil.SetExecutable(startCmd); err != nil { logs.Warn(fmt.Errorf("chmod daemon file failed: %v", err)) return err diff --git a/src/agent/src/pkg/util/command/command.go b/src/agent/src/pkg/util/command/command.go index 3460f7a1b7b..12c4798c35a 100644 --- a/src/agent/src/pkg/util/command/command.go +++ b/src/agent/src/pkg/util/command/command.go @@ -30,7 +30,7 @@ package command import ( "errors" "fmt" - "github.com/astaxie/beego/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "os" "os/exec" ) diff --git a/src/agent/src/pkg/util/command/user.go b/src/agent/src/pkg/util/command/user.go index 723b6f677bc..9807967f1c5 100644 --- a/src/agent/src/pkg/util/command/user.go +++ b/src/agent/src/pkg/util/command/user.go @@ -1,3 +1,4 @@ +//go:build linux || darwin // +build linux darwin /* @@ -37,8 +38,8 @@ import ( "strconv" "syscall" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" - "github.com/astaxie/beego/logs" ) func setUser(cmd *exec.Cmd, runUser string) error { diff --git a/src/agent/src/pkg/util/command/user_win.go b/src/agent/src/pkg/util/command/user_win.go index 058851bf03a..4908d29a8d9 100644 --- a/src/agent/src/pkg/util/command/user_win.go +++ b/src/agent/src/pkg/util/command/user_win.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows /* @@ -30,7 +31,7 @@ package command import ( - "github.com/astaxie/beego/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "os/exec" ) diff --git a/src/agent/src/pkg/util/fileutil/fileutil.go b/src/agent/src/pkg/util/fileutil/fileutil.go index 3bb094aa42d..d4260cf7d47 100644 --- a/src/agent/src/pkg/util/fileutil/fileutil.go +++ b/src/agent/src/pkg/util/fileutil/fileutil.go @@ -38,7 +38,7 @@ import ( "path/filepath" "strconv" - "github.com/astaxie/beego/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" ) func Exists(file string) bool { @@ -184,7 +184,7 @@ func unzipFile(file *zip.File, path string) error { if err != nil { return err } - defer func() {_ = fileReader.Close() } () + defer func() { _ = fileReader.Close() }() targetFile, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, file.Mode()) if err != nil { diff --git a/src/agent/src/pkg/util/fileutil/fileutil_test.go b/src/agent/src/pkg/util/fileutil/fileutil_test.go index 05f46f74db5..211296132fb 100644 --- a/src/agent/src/pkg/util/fileutil/fileutil_test.go +++ b/src/agent/src/pkg/util/fileutil/fileutil_test.go @@ -57,8 +57,7 @@ func Test_SetExecutable_01(t *testing.T) { t.Log("md5: " + md5) } - -func Test_unzip(t*testing.T) { +func Test_unzip(t *testing.T) { err := fileutil.Unzip("/Users/xxx/Downloads/1/agent.zip", "/Users/xxx/Downloads/1/") if err != nil { t.Error("err: ", err.Error()) diff --git a/src/agent/src/pkg/util/httputil/devops.go b/src/agent/src/pkg/util/httputil/devops.go index c8300cb181b..02fe788c8ab 100644 --- a/src/agent/src/pkg/util/httputil/devops.go +++ b/src/agent/src/pkg/util/httputil/devops.go @@ -30,14 +30,16 @@ package httputil import ( "encoding/json" "errors" + "github.com/Tencent/bk-ci/src/agent/internal/third_party/dep/fs" "io" "io/ioutil" "net/http" "os" + "path/filepath" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" - "github.com/astaxie/beego/logs" ) type DevopsResult struct { @@ -174,7 +176,7 @@ func DownloadUpgradeFile(url string, headers map[string]string, filepath string) return "", errors.New("download upgrade file failed") } - err = writeToFile(filepath, resp.Body) + err = AtomicWriteFile(filepath, resp.Body, 0644) if err != nil { logs.Error("download upgrade file failed", err) return "", errors.New("download upgrade file failed") @@ -210,3 +212,26 @@ func writeToFile(file string, content io.Reader) error { } return nil } + +func AtomicWriteFile(filename string, reader io.Reader, mode os.FileMode) error { + tempFile, err := ioutil.TempFile(filepath.Split(filename)) + if err != nil { + return err + } + tempName := tempFile.Name() + + if _, err := io.Copy(tempFile, reader); err != nil { + tempFile.Close() // return value is ignored as we are already on error path + return err + } + + if err := tempFile.Close(); err != nil { + return err + } + + if err := os.Chmod(tempName, mode); err != nil { + return err + } + + return fs.RenameWithFallback(tempName, filename) +} diff --git a/src/agent/src/pkg/util/httputil/httputil.go b/src/agent/src/pkg/util/httputil/httputil.go index 55171ac5834..dd30b068f62 100644 --- a/src/agent/src/pkg/util/httputil/httputil.go +++ b/src/agent/src/pkg/util/httputil/httputil.go @@ -34,7 +34,7 @@ import ( "errors" "fmt" "github.com/Tencent/bk-ci/src/agent/src/pkg/config" - "github.com/astaxie/beego/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "io" "io/ioutil" "net/http" diff --git a/src/agent/src/pkg/util/systemutil/dir_operation.go b/src/agent/src/pkg/util/systemutil/dir_operation.go index 83dd49cf105..ef319584a21 100644 --- a/src/agent/src/pkg/util/systemutil/dir_operation.go +++ b/src/agent/src/pkg/util/systemutil/dir_operation.go @@ -32,7 +32,7 @@ package systemutil import ( "fmt" - "github.com/astaxie/beego/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "os" "syscall" ) diff --git a/src/agent/src/pkg/util/systemutil/dir_operation_win.go b/src/agent/src/pkg/util/systemutil/dir_operation_win.go index 6f5797b8f5d..20e3a55db5a 100644 --- a/src/agent/src/pkg/util/systemutil/dir_operation_win.go +++ b/src/agent/src/pkg/util/systemutil/dir_operation_win.go @@ -32,7 +32,7 @@ package systemutil import ( "fmt" - "github.com/astaxie/beego/logs" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "os" ) diff --git a/src/agent/src/pkg/util/systemutil/systemutil.go b/src/agent/src/pkg/util/systemutil/systemutil.go index 6e6dcad05f1..eefb3827912 100644 --- a/src/agent/src/pkg/util/systemutil/systemutil.go +++ b/src/agent/src/pkg/util/systemutil/systemutil.go @@ -30,9 +30,9 @@ package systemutil import ( "errors" "fmt" + "github.com/Tencent/bk-ci/src/agent/src/pkg/logs" "github.com/Tencent/bk-ci/src/agent/src/pkg/util" "github.com/Tencent/bk-ci/src/agent/src/pkg/util/fileutil" - "github.com/astaxie/beego/logs" "github.com/gofrs/flock" "net" "net/url" @@ -59,28 +59,34 @@ const ( TotalLock = "total-lock" ) + // IsWindows 是否是Windows OS func IsWindows() bool { return runtime.GOOS == osWindows } + // IsLinux IsLinux func IsLinux() bool { return runtime.GOOS == osLinux } + // IsMacos IsMacos func IsMacos() bool { return runtime.GOOS == osMacos } + // GetCurrentUser get current process user func GetCurrentUser() *user.User { currentUser, _ := user.Current() return currentUser } + // GetWorkDir get agent work dir func GetWorkDir() string { dir, _ := os.Getwd() return strings.Replace(dir, "\\", "/", -1) } + // GetUpgradeDir get upgrader dir func GetUpgradeDir() string { return GetWorkDir() + "/tmp" @@ -90,10 +96,12 @@ func GetUpgradeDir() string { func GetWorkerErrorMsgFile(buildId string, vmSeqId string) string { return fmt.Sprintf("%s/%s_%s_build_msg.log", fmt.Sprintf("%s/build_tmp", GetWorkDir()), buildId, vmSeqId) } + // GetLogDir get agent logs dir func GetLogDir() string { return GetWorkDir() + "/logs" } + // GetRuntimeDir get agent runtime dir func GetRuntimeDir() string { runDir := fmt.Sprintf("%s/runtime", GetWorkDir()) @@ -102,6 +110,7 @@ func GetRuntimeDir() string { } return GetWorkDir() } + // GetExecutableDir get excutable jar dir func GetExecutableDir() string { if len(GExecutableDir) == 0 { @@ -111,6 +120,7 @@ func GetExecutableDir() string { } return GExecutableDir } + // GetOsName GetOsName func GetOsName() string { switch runtime.GOOS { @@ -124,6 +134,7 @@ func GetOsName() string { return osNameOther } } + // GetOs get os func GetOs() string { switch runtime.GOOS { @@ -137,6 +148,7 @@ func GetOs() string { return osOther } } + // GetHostName GetHostName func GetHostName() string { name, _ := os.Hostname() @@ -195,16 +207,19 @@ func GetAgentIp(ignoreIps []string) string { return defaultIp } + // ExitProcess Exit by code func ExitProcess(exitCode int) { os.Exit(exitCode) } var processLock *flock.Flock + // KeepProcessAlive keep process alive func KeepProcessAlive() { runtime.KeepAlive(*processLock) } + // CheckProcess check process and lock func CheckProcess(name string) bool { processLockFile := fmt.Sprintf("%s/%s.lock", GetRuntimeDir(), name) diff --git a/src/agent/src/pkg/util/systemutil/systemutil_test.go b/src/agent/src/pkg/util/systemutil/systemutil_test.go index 20a5ccf113c..1759042c067 100644 --- a/src/agent/src/pkg/util/systemutil/systemutil_test.go +++ b/src/agent/src/pkg/util/systemutil/systemutil_test.go @@ -28,9 +28,9 @@ package systemutil import ( + "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" "net" "testing" - "github.com/Tencent/bk-ci/src/agent/src/pkg/util/systemutil" ) func Test_IP(t *testing.T) { diff --git a/src/agent/src/pkg/util/util.go b/src/agent/src/pkg/util/util.go index 366bf37beac..0e31a6a04f6 100644 --- a/src/agent/src/pkg/util/util.go +++ b/src/agent/src/pkg/util/util.go @@ -28,46 +28,46 @@ package util import ( - "encoding/json" - "strings" - "time" + "encoding/json" + "strings" + "time" ) func ParseJsonToData(jsonData interface{}, targetData interface{}) error { - dataStr, err := json.Marshal(jsonData) - if err != nil { - return err - } + dataStr, err := json.Marshal(jsonData) + if err != nil { + return err + } - err = json.Unmarshal([]byte(dataStr), targetData) - if err != nil { - return err - } else { - return nil - } + err = json.Unmarshal([]byte(dataStr), targetData) + if err != nil { + return err + } else { + return nil + } } func FormatTime(t time.Time) string { - return t.Format("2006-01-02 15:04:05") + return t.Format("2006-01-02 15:04:05") } func SplitAndTrimSpace(s string, sep string) []string { - split := strings.Split(s, sep) - result := make([]string, len(split)) - for i, sub := range split { - result[i] = strings.TrimSpace(sub) - } - return result + split := strings.Split(s, sep) + result := make([]string, len(split)) + for i, sub := range split { + result[i] = strings.TrimSpace(sub) + } + return result } func Contains(s []string, subs string) bool { - if len(s) <= 0 { - return false - } + if len(s) <= 0 { + return false + } - for _, a := range s { - if a == subs { - return true - } - } - return false + for _, a := range s { + if a == subs { + return true + } + } + return false } diff --git a/src/app/android/Gemfile.lock b/src/app/android/Gemfile.lock index 26aa88680b9..c16188eba4c 100644 --- a/src/app/android/Gemfile.lock +++ b/src/app/android/Gemfile.lock @@ -177,4 +177,4 @@ DEPENDENCIES fastlane BUNDLED WITH - 2.1.4 + 2.3.13 diff --git a/src/app/ios/Gemfile.lock b/src/app/ios/Gemfile.lock index 3a777e70c2f..c16188eba4c 100644 --- a/src/app/ios/Gemfile.lock +++ b/src/app/ios/Gemfile.lock @@ -2,7 +2,7 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.2) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) atomos (0.1.3) aws-eventstream (1.1.0) @@ -177,4 +177,4 @@ DEPENDENCIES fastlane BUNDLED WITH - 2.1.4 + 2.3.13 diff --git a/src/backend/ci/build.gradle.kts b/src/backend/ci/build.gradle.kts index 0037a33a49f..e39305b5852 100644 --- a/src/backend/ci/build.gradle.kts +++ b/src/backend/ci/build.gradle.kts @@ -1,8 +1,10 @@ plugins { - id("com.tencent.devops.boot") version "0.0.5" + id("com.tencent.devops.boot") version "0.0.6-SNAPSHOT" detektCheck } +apply(plugin = "org.owasp.dependencycheck") + allprojects { apply(plugin = "com.tencent.devops.boot") @@ -33,11 +35,9 @@ allprojects { dependency("com.cronutils:cron-utils:${Versions.CronUtils}") dependency("org.apache.commons:commons-collections4:${Versions.CommonCollections4}") dependency("net.coobird:thumbnailator:${Versions.Thumbnailator}") - dependency("com.vmware:vijava:${Versions.Vmware}") dependency("net.sf.json-lib:json-lib:${Versions.JsonLib}") dependency("com.googlecode.plist:dd-plist:${Versions.DdPlist}") dependency("net.dongliu:apk-parser:${Versions.ApkParser}") - dependency("dom4j:dom4j:${Versions.Dom4j}") dependency("org.apache.ant:ant:${Versions.Ant}") dependency("cglib:cglib:${Versions.Cglib}") dependency("org.fusesource:sigar:${Versions.Sigar}") @@ -51,6 +51,31 @@ allprojects { dependency("org.apache.pulsar:pulsar-client:${Versions.Pulsar}") dependency("com.github.oshi:oshi-core:${Versions.Oshi}") dependency("com.tencent.devops.leaf:leaf-boot-starter:${Versions.Leaf}") + dependency("org.reflections:reflections:${Versions.reflections}") + dependency("org.dom4j:dom4j:${Versions.Dom4j}") + dependency("org.apache.commons:commons-compress:${Versions.Compress}") + dependency("org.bouncycastle:bcprov-ext-jdk15on:${Versions.BouncyCastle}") + dependency("org.mybatis:mybatis:${Versions.MyBatis}") + dependency("commons-io:commons-io:${Versions.CommonIo}") + dependencySet("org.glassfish.jersey.containers:${Versions.Jersey}"){ + entry("jersey-container-servlet-core") + entry("jersey-container-servlet") + } + dependencySet("org.glassfish.jersey.core:${Versions.Jersey}"){ + entry("jersey-server") + entry("jersey-common") + entry("jersey-client") + } + dependencySet("org.glassfish.jersey.ext:${Versions.Jersey}"){ + entry("jersey-bean-validation") + entry("jersey-entity-filtering") + entry("jersey-spring5") + } + dependencySet("org.glassfish.jersey.media:${Versions.Jersey}"){ + entry("jersey-media-multipart") + entry("jersey-media-json-jackson") + } + dependency("org.glassfish.jersey.inject:jersey-hk2:${Versions.Jersey}") dependencySet("io.swagger:${Versions.Swagger}") { entry("swagger-annotations") entry("swagger-jersey2-jaxrs") @@ -89,5 +114,15 @@ allprojects { it.exclude("org.slf4j", "slf4j-log4j12") it.exclude("org.slf4j", "slf4j-nop") it.exclude("javax.ws.rs", "jsr311-api") + it.exclude("dom4j", "dom4j") + it.exclude("com.flipkart.zjsonpatch", "zjsonpatch") + } + // 兼容dom4j 的 bug : https://github.com/gradle/gradle/issues/13656 + dependencies { + components { + withModule("org.dom4j:dom4j") { + allVariants { withDependencies { clear() } } + } + } } } diff --git a/src/backend/ci/buildSrc/build.gradle.kts b/src/backend/ci/buildSrc/build.gradle.kts index 833d6eeebf4..00e610fe4b4 100644 --- a/src/backend/ci/buildSrc/build.gradle.kts +++ b/src/backend/ci/buildSrc/build.gradle.kts @@ -20,4 +20,5 @@ dependencies { implementation("nu.studer:gradle-jooq-plugin:5.2.1") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") implementation("org.apache.logging.log4j:log4j-core:2.17.1") + implementation("org.owasp:dependency-check-gradle:7.1.0.1") } diff --git a/src/backend/ci/buildSrc/src/main/kotlin/constants/Versions.kt b/src/backend/ci/buildSrc/src/main/kotlin/constants/Versions.kt index cd4c22aa211..1d6c4b9dea0 100644 --- a/src/backend/ci/buildSrc/src/main/kotlin/constants/Versions.kt +++ b/src/backend/ci/buildSrc/src/main/kotlin/constants/Versions.kt @@ -2,16 +2,19 @@ object Versions { const val HashIds = "1.0.3" const val Jaxrs = "2.0" const val CommonExec = "1.3" + const val CommonIo = "2.7" const val CommonText = "1.9" - const val Vmware = "5.1" const val BouncyCastle = "1.70" - const val Dom4j = "1.6.1" + const val Dom4j = "2.0.3" + const val Compress = "1.21" + const val MyBatis = "3.5.6" + const val Jersey = "2.34" const val JsonSchema = "2.2.6" const val Jasypt = "3.0.3" const val Swagger = "1.6.2" const val Mockito = "1.10.19" const val JsonLib = "2.4" - const val CronUtils = "7.0.1" + const val CronUtils = "9.1.6" const val Thumbnailator = "0.4.8" const val EmojiJava = "5.1.1" const val CommonCsv = "1.8" @@ -29,8 +32,8 @@ object Versions { const val AsyncHttpClient = "2.1.0" const val KtlintHtmlReport = "0.1.2" const val Ktlint = "0.29.0" - const val Elasticsearch = "7.4.0" - const val Lucene = "8.2.0" + const val Elasticsearch = "7.17.3" + const val Lucene = "8.11.1" const val PinyinPlus = "1.0" const val ShardingSphere = "5.0.0" const val Oshi = "5.8.3" @@ -39,4 +42,5 @@ object Versions { const val YamlSchema = "1.0.49" const val Pulsar = "2.7.2" const val JacksonDatatypeJsr = "2.11.4" + const val reflections = "0.10.2" } diff --git a/src/backend/ci/buildSrc/src/main/kotlin/plugins/detektCheck.gradle.kts b/src/backend/ci/buildSrc/src/main/kotlin/plugins/detektCheck.gradle.kts index 96bd2e1bba9..292e7ee7f79 100644 --- a/src/backend/ci/buildSrc/src/main/kotlin/plugins/detektCheck.gradle.kts +++ b/src/backend/ci/buildSrc/src/main/kotlin/plugins/detektCheck.gradle.kts @@ -14,7 +14,7 @@ tasks.register("detektCheck") { } dependencies { - detekt("io.gitlab.arturbosch.detekt:detekt-cli:1.16.0") + detekt("io.gitlab.arturbosch.detekt:detekt-cli:1.20.0") } // detekt1.16需要kotlin1.4的兼容方案 diff --git a/src/backend/ci/buildSrc/src/main/kotlin/plugins/task-gen-jooq.gradle.kts b/src/backend/ci/buildSrc/src/main/kotlin/plugins/task-gen-jooq.gradle.kts index 8b131153687..52f14b22544 100644 --- a/src/backend/ci/buildSrc/src/main/kotlin/plugins/task-gen-jooq.gradle.kts +++ b/src/backend/ci/buildSrc/src/main/kotlin/plugins/task-gen-jooq.gradle.kts @@ -35,7 +35,7 @@ val jooqGenerator by configurations val api by configurations dependencies { - jooqGenerator("mysql:mysql-connector-java:8.0.22") + jooqGenerator("mysql:mysql-connector-java:8.0.28") api("org.jooq:jooq") } diff --git a/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/ContainerPoolExecutor.kt b/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/ContainerPoolExecutor.kt index ff4f29e466b..1eaf686f161 100644 --- a/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/ContainerPoolExecutor.kt +++ b/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/ContainerPoolExecutor.kt @@ -92,8 +92,8 @@ class ContainerPoolExecutor @Autowired constructor( fun clearTimeoutContainers() { val containerList = buildLessContainerService.getDockerRunTimeoutContainers() containerList.forEach { - synchronized(stringPool.intern(CommonUtils.formatContainerId(it.id))) { - buildLessContainerService.stopContainer("clear timeout", "", it.id) + synchronized(stringPool.intern(CommonUtils.formatContainerId(it))) { + buildLessContainerService.stopContainer("clear timeout", "", it) } } } diff --git a/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/client/DispatchClient.kt b/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/client/DispatchClient.kt index 6a176a2d990..bc898ed0118 100644 --- a/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/client/DispatchClient.kt +++ b/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/client/DispatchClient.kt @@ -59,6 +59,16 @@ class DispatchClient @Autowired constructor( fun refreshStatus(containerRunningsCount: Int) { val dockerIp = CommonUtils.getHostIp() + + // 节点状态默认正常 + var enable = true + + // 容器为0时 节点可能异常,告警然后设置enable=false + if (containerRunningsCount <= 0) { + enable = false + logger.warn("Node: $dockerIp no running containers in containerPool.") + } + val dockerIpInfoVO = DockerIpInfoVO( id = 0L, dockerIp = dockerIp, @@ -69,7 +79,7 @@ class DispatchClient @Autowired constructor( averageMemLoad = SystemInfoUtil.getAverageMemLoad(), averageDiskLoad = SystemInfoUtil.getAverageDiskLoad(), averageDiskIOLoad = SystemInfoUtil.getAverageDiskIOLoad(), - enable = true, + enable = enable, grayEnv = isGary(), specialOn = null, createTime = null, diff --git a/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/service/BuildLessContainerService.kt b/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/service/BuildLessContainerService.kt index 3577a4b7823..ed053577456 100644 --- a/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/service/BuildLessContainerService.kt +++ b/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/service/BuildLessContainerService.kt @@ -32,7 +32,6 @@ import com.github.dockerjava.api.exception.NotModifiedException import com.github.dockerjava.api.model.AccessMode import com.github.dockerjava.api.model.Bind import com.github.dockerjava.api.model.Binds -import com.github.dockerjava.api.model.Container import com.github.dockerjava.api.model.HostConfig import com.github.dockerjava.api.model.Volume import com.github.dockerjava.core.DefaultDockerClientConfig @@ -52,10 +51,12 @@ import com.tencent.devops.buildless.utils.ENV_DOCKER_HOST_IP import com.tencent.devops.buildless.utils.ENV_DOCKER_HOST_PORT import com.tencent.devops.buildless.utils.ENV_JOB_BUILD_TYPE import com.tencent.devops.buildless.utils.ENV_KEY_GATEWAY +import com.tencent.devops.buildless.utils.ENV_KEY_PROJECT_ID import com.tencent.devops.buildless.utils.RandomUtil import com.tencent.devops.buildless.utils.RedisUtils import com.tencent.devops.common.api.util.ShaUtils import com.tencent.devops.common.service.config.CommonConfig +import com.tencent.devops.common.service.gray.Gray import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import java.io.File @@ -71,11 +72,11 @@ import kotlin.streams.toList @Service class BuildLessContainerService( + private val gray: Gray, private val redisUtils: RedisUtils, private val commonConfig: CommonConfig, private val buildLessConfig: BuildLessConfig ) { - private val config = DefaultDockerClientConfig.createDefaultConfigBuilder() .withDockerConfig(buildLessConfig.dockerConfig) .withApiVersion(buildLessConfig.apiVersion) @@ -100,7 +101,6 @@ class BuildLessContainerService( val volumeLogs = Volume(buildLessConfig.volumeLogs) val volumeWs = Volume(buildLessConfig.volumeWorkspace) - val gateway = buildLessConfig.gateway val containerName = "$BUILDLESS_POOL_PREFIX-${RandomUtil.randomString()}" val hostWorkspace = buildLessConfig.hostPathWorkspace + "/$containerName" @@ -123,8 +123,15 @@ class BuildLessContainerService( .withCmd("/bin/sh", ENTRY_POINT_CMD) .withEnv( listOf( - "$ENV_KEY_GATEWAY=$gateway", + "$ENV_KEY_GATEWAY=${buildLessConfig.gateway}", "TERM=xterm-256color", + "$ENV_KEY_PROJECT_ID=${ + if (gray.isGray()) { + "grayproject" + } else { + "" + } + }", "$ENV_DOCKER_HOST_IP=${CommonUtils.getHostIp()}", "$ENV_DOCKER_HOST_PORT=${commonConfig.serverPort}", "$BK_DISTCC_LOCAL_IP=${CommonUtils.getInnerIP()}", @@ -234,16 +241,16 @@ class BuildLessContainerService( return containerInfo.size } - fun getDockerRunTimeoutContainers(): MutableList { + fun getDockerRunTimeoutContainers(): MutableList { val containerInfo = httpDockerCli.listContainersCmd().withStatusFilter(setOf("running")).exec() - val timeoutContainerList = mutableListOf() + val timeoutContainerList = mutableListOf() for (container in containerInfo) { val startTime = httpDockerCli.inspectContainerCmd(container.id).exec().state.startedAt // 是否已运行超过12小时 - if (checkStartTime(startTime)) { - timeoutContainerList.add(container) - // logger.info("Clear 12h timeout container, containerId: ${container.id}") - // httpDockerCli.stopContainerCmd(container.id).withTimeout(15).exec() + val buildLessPoolInfo = redisUtils.getBuildLessPoolContainer(container.id) + if (checkStartTime(startTime) && + (buildLessPoolInfo == null || buildLessPoolInfo.status == ContainerStatus.IDLE)) { + timeoutContainerList.add(container.id) } } diff --git a/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/utils/RedisUtils.kt b/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/utils/RedisUtils.kt index 84fe504e491..efd106c78ce 100644 --- a/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/utils/RedisUtils.kt +++ b/src/backend/ci/core/buildless/biz-buildless/src/main/kotlin/com/tencent/devops/buildless/utils/RedisUtils.kt @@ -40,21 +40,28 @@ class RedisUtils @Autowired constructor( private val redisOperation: RedisOperation, private val objectMapper: ObjectMapper ) { + /** + * containerId 12位容器ID + */ fun setBuildLessPoolContainer( containerId: String, containerStatus: ContainerStatus, buildLessTask: BuildLessTask? = null ) { + val formatContainerId = CommonUtils.formatContainerId(containerId) val buildLessPoolInfo = BuildLessPoolInfo( status = containerStatus, buildLessTask = buildLessTask ) redisOperation.hset( key = buildLessPoolKey(), - hashKey = CommonUtils.formatContainerId(containerId), + hashKey = formatContainerId, values = JsonUtil.toJson(buildLessPoolInfo)) } + /** + * containerId 64位容器ID + */ fun deleteBuildLessPoolContainer(containerId: String) { logger.info("----> buildLessPoolKey hdelete $containerId") redisOperation.hdelete(buildLessPoolKey(), CommonUtils.formatContainerId(containerId)) @@ -64,8 +71,12 @@ class RedisUtils @Autowired constructor( return redisOperation.hentries(buildLessPoolKey()) ?: mutableMapOf() } + /** + * containerId 12位容器ID + */ fun getBuildLessPoolContainer(containerId: String): BuildLessPoolInfo? { - val result = redisOperation.hget(buildLessPoolKey(), containerId) + val formatContainerId = CommonUtils.formatContainerId(containerId) + val result = redisOperation.hget(buildLessPoolKey(), formatContainerId) return if (result != null) { return objectMapper.readValue(result, BuildLessPoolInfo::class.java) } else { diff --git a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/constant/CommonConstants.kt b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/constant/CommonConstants.kt index 8b861c7f286..71e6bc5ad07 100644 --- a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/constant/CommonConstants.kt +++ b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/constant/CommonConstants.kt @@ -114,5 +114,11 @@ const val KEY_DEFAULT = "default" const val KEY_INPUT = "vuex-input" const val KEY_TEXTAREA = "vuex-textarea" const val KEY_CODE_EDITOR = "atom-ace-editor" +const val KEY_OS = "os" +const val KEY_SUMMARY = "summary" +const val KEY_DOCSLINK = "docsLink" +const val KEY_DESCRIPTION = "description" +const val KEY_WEIGHT = "weight" +const val KEY_ALL = "all" const val API_ACCESS_TOKEN_PROPERTY = "access_token" const val TEMPLATE_ACROSS_INFO_ID = "devops_template_across_info_id" diff --git a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/constant/HttpStatus.kt b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/constant/HttpStatus.kt index 098ae96b372..0152b9eba61 100644 --- a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/constant/HttpStatus.kt +++ b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/constant/HttpStatus.kt @@ -35,3 +35,176 @@ const val HTTP_404 = 404 const val HTTP_405 = 405 const val HTTP_422 = 422 const val HTTP_500 = 500 + +enum class HttpStatus( + val value: Int, + val reasonPhrase: String +) { + CONTINUE(100, "Continue"), + + SWITCHING_PROTOCOLS(101, "Switching Protocols"), + + PROCESSING(102, "Processing"), + + CHECKPOINT(103, "Checkpoint"), + + OK(200, "OK"), + + CREATED(201, "Created"), + + ACCEPTED(202, "Accepted"), + + NON_AUTHORITATIVE_INFORMATION(203, "Non-Authoritative Information"), + + NO_CONTENT(204, "No Content"), + + RESET_CONTENT(205, "Reset Content"), + + PARTIAL_CONTENT(206, "Partial Content"), + + MULTI_STATUS(207, "Multi-Status"), + + ALREADY_REPORTED(208, "Already Reported"), + + IM_USED(226, "IM Used"), // 3xx Redirection + + MULTIPLE_CHOICES(300, "Multiple Choices"), + + MOVED_PERMANENTLY(301, "Moved Permanently"), + + FOUND(302, "Found"), + + MOVED_TEMPORARILY(302, "Moved Temporarily"), + + SEE_OTHER(303, "See Other"), + + NOT_MODIFIED(304, "Not Modified"), + + USE_PROXY(305, "Use Proxy"), + + TEMPORARY_REDIRECT(307, "Temporary Redirect"), + + PERMANENT_REDIRECT(308, "Permanent Redirect"), // --- 4xx Client Error --- + + BAD_REQUEST(400, "Bad Request"), + + UNAUTHORIZED(401, "Unauthorized"), + + PAYMENT_REQUIRED(402, "Payment Required"), + + FORBIDDEN(403, "Forbidden"), + + NOT_FOUND(404, "Not Found"), + + METHOD_NOT_ALLOWED(405, "Method Not Allowed"), + + NOT_ACCEPTABLE(406, "Not Acceptable"), + + PROXY_AUTHENTICATION_REQUIRED(407, "Proxy Authentication Required"), + + REQUEST_TIMEOUT(408, "Request Timeout"), + + CONFLICT(409, "Conflict"), + + GONE(410, "Gone"), + + LENGTH_REQUIRED(411, "Length Required"), + + PRECONDITION_FAILED(412, "Precondition Failed"), + + PAYLOAD_TOO_LARGE(413, "Payload Too Large"), + + REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"), + + URI_TOO_LONG(414, "URI Too Long"), + + REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"), + + UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"), + + REQUESTED_RANGE_NOT_SATISFIABLE(416, "Requested range not satisfiable"), + + EXPECTATION_FAILED(417, "Expectation Failed"), + + I_AM_A_TEAPOT(418, "I'm a teapot"), + + INSUFFICIENT_SPACE_ON_RESOURCE(419, "Insufficient Space On Resource"), + + METHOD_FAILURE(420, "Method Failure"), + + DESTINATION_LOCKED(421, "Destination Locked"), + + UNPROCESSABLE_ENTITY(422, "Unprocessable Entity"), + + LOCKED(423, "Locked"), + + FAILED_DEPENDENCY(424, "Failed Dependency"), + + TOO_EARLY(425, "Too Early"), + + UPGRADE_REQUIRED(426, "Upgrade Required"), + + PRECONDITION_REQUIRED(428, "Precondition Required"), + + TOO_MANY_REQUESTS(429, "Too Many Requests"), + + REQUEST_HEADER_FIELDS_TOO_LARGE(431, "Request Header Fields Too Large"), + + UNAVAILABLE_FOR_LEGAL_REASONS(451, "Unavailable For Legal Reasons"), // --- 5xx Server Error --- + + INTERNAL_SERVER_ERROR(500, "Internal Server Error"), + + NOT_IMPLEMENTED(501, "Not Implemented"), + + BAD_GATEWAY(502, "Bad Gateway"), + + SERVICE_UNAVAILABLE(503, "Service Unavailable"), + + GATEWAY_TIMEOUT(504, "Gateway Timeout"), + + HTTP_VERSION_NOT_SUPPORTED(505, "HTTP Version not supported"), + + VARIANT_ALSO_NEGOTIATES(506, "Variant Also Negotiates"), + + INSUFFICIENT_STORAGE(507, "Insufficient Storage"), + + LOOP_DETECTED(508, "Loop Detected"), + + BANDWIDTH_LIMIT_EXCEEDED(509, "Bandwidth Limit Exceeded"), + + NOT_EXTENDED(510, "Not Extended"), + + NETWORK_AUTHENTICATION_REQUIRED(511, "Network Authentication Required"); + + /** + * 是否为服务端错误,code >=500 + */ + fun isServerError(): Boolean { + return value >= INTERNAL_SERVER_ERROR.value + } + + companion object { + + /** + * 根据[statusCode]获取枚举类 + * @throws IllegalArgumentException 不存在对应枚举类时抛异常 + */ + @Throws(IllegalArgumentException::class) + fun valueOf(statusCode: Int): HttpStatus { + return resolve(statusCode) ?: throw IllegalArgumentException("No matching constant for [$statusCode]") + } + + /** + * 根据[statusCode]获取枚举类 + * 不存在对应枚举类时返回null + */ + fun resolve(statusCode: Int): HttpStatus? { + for (status in values()) { + if (status.value == statusCode) { + return status + } + } + return null + } + } +} diff --git a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/JsonUtil.kt b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/JsonUtil.kt index 2fe24d1e32f..37657c33824 100644 --- a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/JsonUtil.kt +++ b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/JsonUtil.kt @@ -46,9 +46,7 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer import com.fasterxml.jackson.module.kotlin.KotlinModule -import com.google.common.cache.CacheBuilder -import com.google.common.cache.CacheLoader -import com.google.common.cache.LoadingCache +import com.github.benmanes.caffeine.cache.Caffeine import com.tencent.devops.common.api.annotation.SkipLogField import java.time.LocalDate import java.time.LocalDateTime @@ -56,7 +54,6 @@ import java.time.LocalTime import java.time.format.DateTimeFormatter.ISO_DATE import java.time.format.DateTimeFormatter.ISO_DATE_TIME import java.time.format.DateTimeFormatter.ISO_TIME -import java.util.HashSet /** * @@ -77,7 +74,7 @@ object JsonUtil { */ fun skipLogFields(bean: T): String? { return try { - beanMapperCache.get(bean.javaClass).writeValueAsString(bean) + beanMapperCache.get(bean.javaClass)!!.writeValueAsString(bean) } catch (ignored: Throwable) { loadMapper(bean.javaClass).writeValueAsString(bean) } @@ -85,12 +82,8 @@ object JsonUtil { // 如果出现50000+以上的不同的数据类(不是对象)时。。。 // 系统性能一定会下降,永久代区可能会OOM了,但不会是在这里引起的。所以这里限制了一个几乎不可能达到的值 - private val beanMapperCache: LoadingCache, ObjectMapper> = - CacheBuilder.newBuilder().maximumSize(MAX_CLAZZ).build(object : CacheLoader, ObjectMapper>() { - override fun load(clazz: Class): ObjectMapper { - return loadMapper(clazz) - } - }) + private val beanMapperCache = Caffeine.newBuilder().maximumSize(MAX_CLAZZ) + .build, ObjectMapper> { clazz -> loadMapper(clazz) } private fun loadMapper(clazz: Class): ObjectMapper { val nonEmptyMapper = objectMapper() diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/Element.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/Element.kt index f81757372c4..10cec0e2677 100644 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/Element.kt +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/Element.kt @@ -58,7 +58,12 @@ import com.tencent.devops.common.pipeline.pojo.element.trigger.TimerTriggerEleme import com.tencent.devops.common.pipeline.utils.SkipElementUtils import io.swagger.annotations.ApiModelProperty -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type") +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@type", + defaultImpl = EmptyElement::class +) @JsonSubTypes( JsonSubTypes.Type(value = MatrixStatusElement::class, name = MatrixStatusElement.classType), JsonSubTypes.Type(value = CodeGitWebHookTriggerElement::class, name = CodeGitWebHookTriggerElement.classType), @@ -82,8 +87,10 @@ import io.swagger.annotations.ApiModelProperty JsonSubTypes.Type(value = QualityGateInElement::class, name = QualityGateInElement.classType), JsonSubTypes.Type(value = QualityGateOutElement::class, name = QualityGateOutElement.classType), JsonSubTypes.Type(value = CodeTGitWebHookTriggerElement::class, name = CodeTGitWebHookTriggerElement.classType), - JsonSubTypes.Type(value = CodeGitGenericWebHookTriggerElement::class, - name = CodeGitGenericWebHookTriggerElement.classType), + JsonSubTypes.Type( + value = CodeGitGenericWebHookTriggerElement::class, + name = CodeGitGenericWebHookTriggerElement.classType + ), JsonSubTypes.Type(value = CodeP4WebHookTriggerElement::class, name = CodeP4WebHookTriggerElement.classType) ) @Suppress("ALL") diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/EmptyElement.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/EmptyElement.kt new file mode 100644 index 00000000000..d6a5ab557fb --- /dev/null +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/EmptyElement.kt @@ -0,0 +1,8 @@ +package com.tencent.devops.common.pipeline.pojo.element + +class EmptyElement( + override val name: String = "unknownType", + override var id: String? = null +) : Element(name, id) { + override fun getClassType() = "unknownType" +} diff --git a/src/backend/ci/core/common/common-pipeline/src/test/kotlin/com/tencent/devops/common/pipeline/pojo/element/ElementTest.kt b/src/backend/ci/core/common/common-pipeline/src/test/kotlin/com/tencent/devops/common/pipeline/pojo/element/ElementTest.kt index 20dbd066263..ccae29aa8b6 100644 --- a/src/backend/ci/core/common/common-pipeline/src/test/kotlin/com/tencent/devops/common/pipeline/pojo/element/ElementTest.kt +++ b/src/backend/ci/core/common/common-pipeline/src/test/kotlin/com/tencent/devops/common/pipeline/pojo/element/ElementTest.kt @@ -27,6 +27,7 @@ package com.tencent.devops.common.pipeline.pojo.element +import com.tencent.devops.common.api.util.JsonUtil import com.tencent.devops.common.pipeline.enums.BuildStatus import com.tencent.devops.common.pipeline.enums.StartType import com.tencent.devops.common.pipeline.pojo.element.market.MarketBuildAtomElement @@ -45,6 +46,19 @@ import org.junit.Test class ElementTest { + @Test + fun unknownSubType() { + val json = """{ + "@type" : "not exist sub type", + "name" : "这个是不存在的Element,为了验证反序列化Json时不出错", + "id" : "e-e89bb10191344f6b84e42c358050dbea", + "atomCode" : "builder3Dunity" + } """ + val element = JsonUtil.to(json, Element::class.java) + println(JsonUtil.toJson(element)) + assertTrue(element is EmptyElement) + } + @Test fun takeStatus() { val element = ManualTriggerElement(id = "1") @@ -130,10 +144,12 @@ class ElementTest { } run WebHookTriggerElement@{ - val element = CodeGitWebHookTriggerElement(id = "3", + val element = CodeGitWebHookTriggerElement( + id = "3", branchName = "master", eventType = CodeEventType.MERGE_REQUEST, block = false, repositoryHashId = null, excludeBranchName = null, excludePaths = null, - excludeTagName = null, excludeUsers = null, includePaths = null) + excludeTagName = null, excludeUsers = null, includePaths = null + ) assertNotEquals(element.id, element.findFirstTaskIdByStartType(StartType.MANUAL)) assertNotEquals(element.id, element.findFirstTaskIdByStartType(StartType.SERVICE)) assertNotEquals(element.id, element.findFirstTaskIdByStartType(StartType.PIPELINE)) diff --git a/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/code/git/api/GitApi.kt b/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/code/git/api/GitApi.kt index 4dde5eb2f66..15b9ba4fa3e 100644 --- a/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/code/git/api/GitApi.kt +++ b/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/code/git/api/GitApi.kt @@ -47,6 +47,7 @@ import com.tencent.devops.scm.pojo.GitMember import com.tencent.devops.scm.pojo.GitMrChangeInfo import com.tencent.devops.scm.pojo.GitMrInfo import com.tencent.devops.scm.pojo.GitMrReviewInfo +import com.tencent.devops.scm.pojo.TapdWorkItem import okhttp3.MediaType import okhttp3.Request import okhttp3.RequestBody @@ -79,6 +80,7 @@ open class GitApi { private const val OPERATION_GET_CHANGE_FILE_LIST = "查询变更文件列表" private const val OPERATION_GET_MR_COMMIT_LIST = "获取合并请求中的提交" private const val OPERATION_PROJECT_USER_INFO = "获取项目中成员信息" + private const val OPERATION_TAPD_WORKITEMS = "查看绑定的TAPD单" } fun listBranches( @@ -517,6 +519,19 @@ open class GitApi { return JsonUtil.getObjectMapper().readValue(getBody(OPERATION_PROJECT_USER_INFO, request)) } + fun getTapdWorkitems( + host: String, + token: String, + id: String, + type: String, + iid: Long + ): List { + val url = "projects/$id/tapd_workitems" + val queryParam = "type=$type&iid=$iid" + val request = get(host, token, url, queryParam) + return JsonUtil.getObjectMapper().readValue(getBody(OPERATION_TAPD_WORKITEMS, request)) + } + private fun String.addParams(args: Map): String { val sb = StringBuilder(this) args.forEach { (name, value) -> diff --git a/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/pojo/GitMrReviewInfo.kt b/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/pojo/GitMrReviewInfo.kt index 2c0da2c2ba1..56b1a4e2932 100644 --- a/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/pojo/GitMrReviewInfo.kt +++ b/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/pojo/GitMrReviewInfo.kt @@ -83,6 +83,14 @@ import io.swagger.annotations.ApiModel @ApiModel("git mr reviewers信息") data class GitMrReviewInfo( + val author: GitMrInfoReviewer?, + @JsonProperty("project_id") + val projectId: Long?, + @JsonProperty("reviewable_id") + val reviewableId: Long?, + @JsonProperty("reviewable_type") + val reviewableType: String?, + val state: String?, @JsonProperty("created_at") val createTime: String? = "", @JsonProperty("updated_at") diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CoverityResult.kt b/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/pojo/TapdWorkItem.kt similarity index 70% rename from src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CoverityResult.kt rename to src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/pojo/TapdWorkItem.kt index df38780211e..735aaf94fcf 100644 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CoverityResult.kt +++ b/src/backend/ci/core/common/common-scm/src/main/kotlin/com/tencent/devops/scm/pojo/TapdWorkItem.kt @@ -25,14 +25,30 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.tencent.devops.plugin.codecc.pojo.coverity +package com.tencent.devops.scm.pojo import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonProperty +import io.swagger.annotations.ApiModel +@ApiModel("mr绑定的TAPD单") @JsonIgnoreProperties(ignoreUnknown = true) -data class CoverityResult( - val status: Int = 0, - val code: String = "", - val message: String? = "no need register", - val data: Any? = true +data class TapdWorkItem( + val id: Long, + @JsonProperty("workspace_id") + val workspaceId: Long, + @JsonProperty("source_project_id") + val sourceProjectId: Long, + @JsonProperty("source_id") + val sourceId: Long, + @JsonProperty("source_type") + val sourceType: String, + @JsonProperty("tapd_id") + val tapdId: Long, + @JsonProperty("tapd_type") + val tapdType: String, + val name: String, + val status: String, + @JsonProperty("status_zh") + val statusZh: String ) diff --git a/src/backend/ci/core/dispatch-docker/biz-dispatch-docker/src/main/kotlin/com/tencent/devops/dispatch/docker/service/PipelineAgentLessDispatchService.kt b/src/backend/ci/core/dispatch-docker/biz-dispatch-docker/src/main/kotlin/com/tencent/devops/dispatch/docker/service/PipelineAgentLessDispatchService.kt index 07c42dc51e6..32e9511f7a2 100644 --- a/src/backend/ci/core/dispatch-docker/biz-dispatch-docker/src/main/kotlin/com/tencent/devops/dispatch/docker/service/PipelineAgentLessDispatchService.kt +++ b/src/backend/ci/core/dispatch-docker/biz-dispatch-docker/src/main/kotlin/com/tencent/devops/dispatch/docker/service/PipelineAgentLessDispatchService.kt @@ -92,7 +92,7 @@ class PipelineAgentLessDispatchService @Autowired constructor( ) } - if (buildLessWhitelistService.checkBuildLessWhitelist(event.projectId)) { + if (!buildLessWhitelistService.checkBuildLessWhitelist(event.projectId)) { val agentLessDockerIp = dockerHostUtils.getAvailableDockerIpWithSpecialIps( projectId = event.projectId, pipelineId = event.pipelineId, diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildAgentVMResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildAgentVMResource.kt deleted file mode 100644 index 8c4a3084870..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildAgentVMResource.kt +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_AGENT_ID -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_BUILD_ID -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_PROJECT_ID -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.dispatch.pojo.VM -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.GET -import javax.ws.rs.HeaderParam -import javax.ws.rs.Path -import javax.ws.rs.Produces -import javax.ws.rs.QueryParam -import javax.ws.rs.core.MediaType - -@Api(tags = ["BUILD_AGENT_VM"], description = "VM 管理") -@Path("/buildAgent/builds/vms") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -interface BuildAgentVMResource { - - @ApiOperation("根据虚拟机ID获取虚拟机详情") - @GET - @Path("/getVmByPipeLine") - fun getVmByPipeLine( - @ApiParam("项目ID", required = true) - @HeaderParam(AUTH_HEADER_DEVOPS_PROJECT_ID) - projectId: String, - @ApiParam(value = "构建ID", required = true) - @HeaderParam(AUTH_HEADER_DEVOPS_BUILD_ID) - buildId: String, - @ApiParam("Agent ID", required = true) - @HeaderParam(AUTH_HEADER_DEVOPS_AGENT_ID) - agentId: String, - @ApiParam("秘钥", required = true) - @HeaderParam(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) - secretKey: String, - @ApiParam(value = "虚拟机Seq ID", required = true) - @QueryParam("vmSeqId") - vmSeqId: String - ): Result -} diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildCodeccToolResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildCodeccToolResource.kt deleted file mode 100644 index e2a9035d28f..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildCodeccToolResource.kt +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.enums.OSType -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import io.swagger.annotations.ApiResponse -import io.swagger.annotations.ApiResponses -import javax.ws.rs.Consumes -import javax.ws.rs.GET -import javax.ws.rs.Path -import javax.ws.rs.PathParam -import javax.ws.rs.Produces -import javax.ws.rs.QueryParam -import javax.ws.rs.core.MediaType -import javax.ws.rs.core.Response - -@Api(tags = ["BUILD_CODECC"], description = "构建-CODECC相关资源") -@Path("/build/codecc") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -interface BuildCodeccToolResource { - - @ApiOperation("下载toolName对应的tool") - @GET - @Path("/{toolName}") - @Produces(MediaType.APPLICATION_OCTET_STREAM) - @ApiResponses( - ApiResponse(code = 304, message = "tool已是最新,无需下载") - ) - fun downloadTool( - @ApiParam("工具类型", required = true) - @PathParam("toolName") - toolName: String, - @ApiParam("系统类型", required = true) - @QueryParam("osType") - osType: OSType, - @ApiParam("文件md5", required = true) - @QueryParam("fileMd5") - fileMd5: String, - @ApiParam("是否是32位操作系统", required = false) - @QueryParam("is32Bit") - is32Bit: Boolean? - ): Response - - @ApiOperation("下载coverity脚本") - @GET - @Path("/coverity/script") - @Produces(MediaType.APPLICATION_OCTET_STREAM) - @ApiResponses( - ApiResponse(code = 304, message = "本地的coverity script已是最新,无需下载") - ) - fun downloadCovScript( - @ApiParam("系统类型", required = true) - @QueryParam("osType") - osType: OSType, - @ApiParam("文件md5", required = true) - @QueryParam("fileMd5") - fileMd5: String - ): Response - - @ApiOperation("下载多工具脚本") - @GET - @Path("/tools/script") - @Produces(MediaType.APPLICATION_OCTET_STREAM) - @ApiResponses( - ApiResponse(code = 304, message = "本地的多工具script已是最新,无需下载") - ) - fun downloadToolsScript( - @ApiParam("系统类型", required = true) - @QueryParam("osType") - osType: OSType, - @ApiParam("文件md5", required = true) - @QueryParam("fileMd5") - fileMd5: String - ): Response -} diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildVMResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildVMResource.kt deleted file mode 100644 index 328e826117f..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/BuildVMResource.kt +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_BUILD_ID -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_VM_SEQ_ID -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.dispatch.pojo.VM -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.GET -import javax.ws.rs.HeaderParam -import javax.ws.rs.Path -import javax.ws.rs.Produces -import javax.ws.rs.core.MediaType - -@Api(tags = ["BUILD_VM"], description = "VM 管理") -@Path("/build/vms") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -interface BuildVMResource { - - @ApiOperation("根据虚拟机ID获取虚拟机详情") - @GET - @Path("/getVmByPipeLine") - fun getVmByPipeLine( - @ApiParam(value = "构建 ID", required = true) - @HeaderParam(AUTH_HEADER_DEVOPS_BUILD_ID) - buildId: String, - @ApiParam(value = "虚拟机Seq ID", required = true) - @HeaderParam(AUTH_HEADER_DEVOPS_VM_SEQ_ID) - vmSeqId: String - ): Result -} diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpMachineResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpMachineResource.kt deleted file mode 100644 index b18cc4e46a7..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpMachineResource.kt +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.dispatch.pojo.Machine -import com.tencent.devops.dispatch.pojo.MachineCreate -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.DELETE -import javax.ws.rs.GET -import javax.ws.rs.POST -import javax.ws.rs.PUT -import javax.ws.rs.Path -import javax.ws.rs.PathParam -import javax.ws.rs.Produces -import javax.ws.rs.QueryParam -import javax.ws.rs.core.MediaType - -@Api(tags = ["OP_MACHINE"], description = "VM 机器管理") -@Path("/op/machines") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -interface OpMachineResource { - - @ApiOperation("获取所有的虚拟机母机信息") - @GET - @Path("/") - fun list( - @ApiParam(value = "IP", required = false) - @QueryParam(value = "ip") - ip: String?, - @ApiParam(value = "主机名", required = false) - @QueryParam(value = "name") - name: String?, - @ApiParam(value = "用户名", required = false) - @QueryParam(value = "username") - username: String? - ): Result> - - @ApiOperation("虚拟机母机入库") - @POST - @Path("/") - fun add( - @ApiParam(value = "Machine 信息", required = true) - machine: MachineCreate - ): Result - - @ApiOperation("删除虚拟机母机") - @DELETE - @Path("/{id}") - fun delete( - @ApiParam(value = "Machine ID", required = true) - @PathParam("id") id: Int - ): Result - - @ApiOperation("更改虚拟机母机") - @PUT - @Path("/") - fun update( - @ApiParam(value = "Machine 信息", required = true) - machine: MachineCreate - ): Result -} diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpPipelineResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpPipelineResource.kt deleted file mode 100644 index 2f8b9c25438..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpPipelineResource.kt +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.pojo.Result -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.GET -import javax.ws.rs.POST -import javax.ws.rs.Path -import javax.ws.rs.PathParam -import javax.ws.rs.Produces -import javax.ws.rs.QueryParam -import javax.ws.rs.core.MediaType - -@Api(tags = ["OP_PIPELINE"], description = "PIPELINE 管理") -@Path("/op/pipelines") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -interface OpPipelineResource { - - @ApiOperation("设置构建机对应的虚拟机") - @POST - @Path("/{pipelineId}/setVMs") - fun setVMs( - @ApiParam(value = "pipelineId", required = true) - @PathParam("pipelineId") - pipelineId: String, - @ApiParam(value = "vmNames", required = true) - @QueryParam("vmNames") - vmNames: String, - @ApiParam(value = "vmSeqId", required = false) - @QueryParam("vmSeqId") - vmSeqId: Int? - ): Result - - @ApiOperation("获取构建机对应的虚拟机") - @GET - @Path("/{pipelineId}/getVMs") - fun getVMs( - @ApiParam(value = "pipelineId", required = true) - @PathParam("pipelineId") - pipelineId: String, - @ApiParam(value = "vmSeqId", required = false) - @QueryParam("vmSeqId") - vmSeqId: Int? - ): Result -} diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpPrivateVMResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpPrivateVMResource.kt deleted file mode 100644 index 7e402752094..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpPrivateVMResource.kt +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.dispatch.pojo.VMWithPrivateProject -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.DELETE -import javax.ws.rs.GET -import javax.ws.rs.POST -import javax.ws.rs.Path -import javax.ws.rs.PathParam -import javax.ws.rs.Produces -import javax.ws.rs.core.MediaType - -@Api(tags = ["OP_PRIVATE_VM"], description = "VM 专机管理") -@Path("/op/privateVMs") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -interface OpPrivateVMResource { - - @ApiOperation("获取所有的专机信息") - @GET - @Path("/") - fun list(): Result> - - @ApiOperation("绑定专机") - @POST - @Path("/{vmId}/projects/{projectId}") - fun bind( - @ApiParam(value = "虚拟机ID", required = true) - @PathParam("vmId") - vmId: Long, - @ApiParam(value = "项目ID", required = true) - @PathParam("projectId") - projectId: String - ): Result - - @ApiOperation("解绑专机") - @DELETE - @Path("/{vmId}/projects/{projectId}") - fun unbind( - @ApiParam(value = "虚拟机ID", required = true) - @PathParam("vmId") - vmId: Long, - @ApiParam(value = "项目ID", required = true) - @PathParam("projectId") - projectId: String - ): Result -} diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpVMResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpVMResource.kt deleted file mode 100644 index 787d1452362..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpVMResource.kt +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.dispatch.pojo.VM -import com.tencent.devops.dispatch.pojo.VMCreate -import com.tencent.devops.dispatch.pojo.VMWithPage -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.DELETE -import javax.ws.rs.GET -import javax.ws.rs.POST -import javax.ws.rs.PUT -import javax.ws.rs.Path -import javax.ws.rs.PathParam -import javax.ws.rs.Produces -import javax.ws.rs.QueryParam -import javax.ws.rs.core.MediaType - -@Api(tags = ["OP_VM"], description = "VM 管理") -@Path("/op/vms") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -@Suppress("ALL") -interface OpVMResource { - - @ApiOperation("获取所有的VM虚拟机信息") - @GET - @Path("/") - fun list( - @ApiParam(value = "IP", required = false) - @QueryParam(value = "ip") - ip: String?, - @ApiParam(value = "主机名", required = false) - @QueryParam(value = "name") - name: String?, - @ApiParam(value = "类型ID", required = false) - @QueryParam(value = "typeId") - typeId: Int?, - @ApiParam(value = "操作系统", required = false) - @QueryParam(value = "os") - os: String?, - @ApiParam(value = "操作系统版本", required = false) - @QueryParam(value = "osVersion") - osVersion: String?, - @ApiParam(value = "分页Offset", required = false) - @QueryParam("offset") - offset: Int?, - @ApiParam(value = "分页数量", required = false) - @QueryParam("limit") - limit: Int? - ): Result - - @ApiOperation("根据虚拟机ID获取虚拟机详情") - @GET - @Path("/{vmId}") - fun get( - @ApiParam(value = "虚拟机ID", required = true) - @PathParam("vmId") - vmId: Long - ): Result - - @ApiOperation("虚拟机入库") - @POST - @Path("/") - fun add( - @ApiParam(value = "VM 信息", required = true) - vm: VMCreate - ): Result - - @ApiOperation("根据IP获得对应的虚拟机信息") - @GET - @Path("/listByIp") - fun getByIp( - @ApiParam(value = "VM IP", required = true) - @QueryParam("ip") ip: String - ): Result - - @ApiOperation("删除虚拟机") - @DELETE - @Path("/") - fun delete( - @ApiParam(value = "VM ID", required = true) - @QueryParam("id") id: Long - ): Result - - @ApiOperation("更新虚拟机") - @PUT - @Path("/") - fun update( - @ApiParam(value = "VM 信息", required = true) - vm: VMCreate - ): Result - - @ApiOperation("查询VM状态") - @GET - @Path("/status") - fun queryStatus( - @ApiParam(value = "VM 名称", required = true) - @QueryParam("vmName") vmName: String - ): Result - - @ApiOperation("虚拟机进入或者解除维护状态") - @PUT - @Path("/maintain") - fun maintain( - @ApiParam(value = "VM ID", required = true) - @QueryParam("vmId") vmId: Long, - @ApiParam(value = "Enable", required = true) - @QueryParam("enable") enable: Boolean - ): Result - - @ApiOperation("虚拟机进入或者解除维护状态") - @GET - @Path("/maintain") - fun maintain( - @ApiParam(value = "VM ID", required = true) - @QueryParam("vmId") vmId: Long - ): Result - - @ApiOperation("If need to shutdown the vm after the build (currently just for investigating issues") - @PUT - @Path("/shutdownAfterBuild") - fun shutdownAfterBuild( - @ApiParam(value = "shutdown or now", required = true) - @QueryParam("shutdown") - shutdown: Boolean, - @ApiParam(value = "pipeline ID", required = true) - @QueryParam("pipelineId") - pipelineId: String - ): Result - - @ApiOperation("If need to shutdown the vm after the build (currently just for investigating issues") - @GET - @Path("/shutdownAfterBuild") - fun isShutdownAfterBuild(): Result -} diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpVMTypeResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpVMTypeResource.kt deleted file mode 100644 index d329f6c4972..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/OpVMTypeResource.kt +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.dispatch.pojo.VMType -import com.tencent.devops.dispatch.pojo.VMTypeCreate -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.DELETE -import javax.ws.rs.GET -import javax.ws.rs.POST -import javax.ws.rs.PUT -import javax.ws.rs.Path -import javax.ws.rs.Produces -import javax.ws.rs.QueryParam -import javax.ws.rs.core.MediaType - -@Api(tags = ["OP_VM_TYPE"], description = "虚拟机类型") -@Path("/op/vmtypes") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -interface OpVMTypeResource { - - @ApiOperation("列举所有虚拟机类型") - @GET - @Path("/") - fun list(): Result> - - @ApiOperation("添加虚拟机类型") - @POST - @Path("/") - fun create( - @ApiParam(value = "类型名称", required = true) - typeName: VMTypeCreate - ): Result - - @ApiOperation("更改虚拟机类型名称") - @PUT - @Path("/") - fun update( - @ApiParam(value = "虚拟机类型", required = true) - vmType: VMType - ): Result - - @ApiOperation("删除虚拟机类型") - @DELETE - @Path("/") - fun delete( - @ApiParam(value = "虚拟机类型ID", required = true) - @QueryParam("id") - typeId: Int - ): Result -} diff --git a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/ServiceVMResource.kt b/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/ServiceVMResource.kt deleted file mode 100644 index 133ceca178c..00000000000 --- a/src/backend/ci/core/dispatch/api-dispatch/src/main/kotlin/com/tencent/devops/dispatch/api/ServiceVMResource.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.api - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.dispatch.pojo.VM -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.GET -import javax.ws.rs.Path -import javax.ws.rs.PathParam -import javax.ws.rs.Produces -import javax.ws.rs.core.MediaType - -@Api(tags = ["SERVICE_VM"], description = "服务-虚拟机") -@Path("/service/vms") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -interface ServiceVMResource { - - @ApiOperation("根据VM hashID 获取虚拟机信息") - @GET - @Path("/{vmHashId}") - fun get( - @ApiParam("VM哈希ID", required = true) - @PathParam("vmHashId") - vmHashId: String - ): Result -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/build.gradle.kts b/src/backend/ci/core/dispatch/biz-dispatch/build.gradle.kts index 492dc59f056..17e0999c0e5 100644 --- a/src/backend/ci/core/dispatch/biz-dispatch/build.gradle.kts +++ b/src/backend/ci/core/dispatch/biz-dispatch/build.gradle.kts @@ -26,7 +26,6 @@ */ dependencies { - api(project(":core:plugin:codecc-plugin:common-codecc")) api(project(":core:process:api-process")) api(project(":core:project:api-project")) api(project(":core:dispatch:api-dispatch")) @@ -41,7 +40,6 @@ dependencies { api(project(":core:common:common-db")) api(project(":core:common:common-auth:common-auth-api")) api(project(":core:common:common-kafka")) - api("com.vmware:vijava") api("org.json:json") api("org.apache.commons:commons-exec") } diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildAgentVMResourceImpl.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildAgentVMResourceImpl.kt deleted file mode 100644 index 40fde44312f..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildAgentVMResourceImpl.kt +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.controller - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.web.RestResource -import com.tencent.devops.dispatch.api.BuildAgentVMResource -import com.tencent.devops.dispatch.pojo.VM -import com.tencent.devops.dispatch.service.PipelineDispatchService -import com.tencent.devops.dispatch.service.VMService -import org.springframework.beans.factory.annotation.Autowired - -@RestResource@Suppress("ALL") -class BuildAgentVMResourceImpl @Autowired constructor( - private val pipelineDispatchService: PipelineDispatchService, - private val vMService: VMService -) : BuildAgentVMResource { - - override fun getVmByPipeLine( - projectId: String, - buildId: String, - agentId: String, - secretKey: String, - vmSeqId: String - ): Result { - val pipeline = pipelineDispatchService.queryPipelineByBuildAndSeqId(buildId, vmSeqId) - return Result(vMService.queryVMById(pipeline.vmId)) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildCodeccToolResourceImpl.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildCodeccToolResourceImpl.kt deleted file mode 100644 index 86a042b0dcf..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildCodeccToolResourceImpl.kt +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.controller - -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.common.web.RestResource -import com.tencent.devops.dispatch.api.BuildCodeccToolResource -import com.tencent.devops.dispatch.service.CodeccDownloaderService -import org.springframework.beans.factory.annotation.Autowired -import javax.ws.rs.core.Response - -@RestResource -class BuildCodeccToolResourceImpl @Autowired constructor( - private val codeccDownloaderService: CodeccDownloaderService -) : BuildCodeccToolResource { - override fun downloadTool(toolName: String, osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - return codeccDownloaderService.downloadTool(toolName, osType, fileMd5, is32Bit) - } - - override fun downloadCovScript(osType: OSType, fileMd5: String): Response { - return codeccDownloaderService.downloadCovScript(osType, fileMd5) - } - - override fun downloadToolsScript(osType: OSType, fileMd5: String): Response { - return codeccDownloaderService.downloadToolsScript(osType, fileMd5) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildVMResourceImpl.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildVMResourceImpl.kt deleted file mode 100644 index 0ad335ab0b4..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/BuildVMResourceImpl.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.controller - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.web.RestResource -import com.tencent.devops.dispatch.api.BuildVMResource -import com.tencent.devops.dispatch.pojo.VM -import com.tencent.devops.dispatch.service.PipelineDispatchService -import com.tencent.devops.dispatch.service.VMService -import org.springframework.beans.factory.annotation.Autowired - -@RestResource -class BuildVMResourceImpl @Autowired constructor( - private val pipelineDispatchService: PipelineDispatchService, - private val vMService: VMService -) : BuildVMResource { - override fun getVmByPipeLine(buildId: String, vmSeqId: String): Result { - val pipeline = pipelineDispatchService.queryPipelineByBuildAndSeqId(buildId, vmSeqId) - return Result(vMService.queryVMById(pipeline.vmId)) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpMachineResourceImpl.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpMachineResourceImpl.kt deleted file mode 100644 index 122cc4446e4..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpMachineResourceImpl.kt +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.controller - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.web.RestResource -import com.tencent.devops.dispatch.api.OpMachineResource -import com.tencent.devops.dispatch.pojo.Machine -import com.tencent.devops.dispatch.pojo.MachineCreate -import com.tencent.devops.dispatch.service.MachineService -import org.springframework.beans.factory.annotation.Autowired - -@RestResource -class OpMachineResourceImpl @Autowired constructor(private val machineService: MachineService) : OpMachineResource { - - override fun list( - ip: String?, - name: String?, - username: String? - ): Result> { - return Result(machineService.queryAllMachine(ip, name, username)) - } - - override fun add(machine: MachineCreate): Result { - return machineService.addMachine(machine) - } - - override fun delete(id: Int): Result { - machineService.deleteMachine(id) - return Result(true) - } - - override fun update(machine: MachineCreate): Result { - return machineService.updateMachine(machine) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpPipelineResourceImpl.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpPipelineResourceImpl.kt deleted file mode 100644 index f638a975c02..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpPipelineResourceImpl.kt +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.controller - -import com.tencent.devops.common.api.exception.OperationException -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.web.RestResource -import com.tencent.devops.dispatch.api.OpPipelineResource -import com.tencent.devops.dispatch.service.PipelineVMService -import org.springframework.beans.factory.annotation.Autowired - -@RestResource -class OpPipelineResourceImpl @Autowired constructor( - private val pipelineVMService: PipelineVMService -) : OpPipelineResource { - - override fun setVMs( - pipelineId: String, - vmNames: String, - vmSeqId: Int? - ): Result { - if (pipelineId.isBlank()) { - throw OperationException("pipelineId为空") - } - - if (vmNames.isBlank()) { - throw OperationException("虚拟机为空") - } - pipelineVMService.setVMs(pipelineId, vmNames, vmSeqId) - return Result(true) - } - - override fun getVMs( - pipelineId: String, - vmSeqId: Int? - ): Result { - if (pipelineId.isBlank()) { - throw OperationException("pipelineId为空") - } - return Result(pipelineVMService.getVMs(pipelineId, vmSeqId) ?: "") - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpVMResourceImpl.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpVMResourceImpl.kt deleted file mode 100644 index 90f08f81754..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpVMResourceImpl.kt +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.controller - -import com.tencent.devops.common.api.exception.InvalidParamException -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.web.RestResource -import com.tencent.devops.dispatch.api.OpVMResource -import com.tencent.devops.dispatch.pojo.VM -import com.tencent.devops.dispatch.pojo.VMCreate -import com.tencent.devops.dispatch.service.VMService -import com.tencent.devops.dispatch.utils.ShutdownVMAfterBuildUtils -import org.springframework.beans.factory.annotation.Autowired - -@RestResource@Suppress("ALL") -class OpVMResourceImpl @Autowired constructor( - private val vmService: VMService, - private val shutdownVMAfterBuildUtils: ShutdownVMAfterBuildUtils -) : OpVMResource { - - override fun list( - ip: String?, - name: String?, - typeId: Int?, - os: String?, - osVersion: String?, - offset: Int?, - limit: Int? - ) = Result(vmService.queryVMs(ip, name, typeId, os, osVersion, offset, limit)) - - override fun get(vmId: Long): Result { - if (vmId < 0) { - throw InvalidParamException("无效的虚拟机ID($vmId)") - } - return Result(vmService.queryVMById(vmId)) - } - - override fun add(vm: VMCreate): Result { - return vmService.addVM(vm) - } - - override fun getByIp(ip: String): Result { - return Result(vmService.queryVMByIp(ip)) - } - - override fun delete(id: Long): Result { - vmService.deleteVM(id) - return Result(true) - } - - override fun update(vm: VMCreate): Result { - return vmService.updateVM(vm) - } - - override fun queryStatus(vmName: String): Result { - return Result(vmService.queryVMStatus(vmName)) - } - - override fun maintain(vmId: Long, enable: Boolean): Result { - vmService.maintainVM(vmId, enable) - return Result(true) - } - - override fun maintain(vmId: Long): Result { - return Result(vmService.queryVMMaintainStatus(vmId)) - } - - override fun shutdownAfterBuild(shutdown: Boolean, pipelineId: String): Result { - shutdownVMAfterBuildUtils.shutdown(shutdown, pipelineId) - return Result(true) - } - - override fun isShutdownAfterBuild() = - Result(shutdownVMAfterBuildUtils.getShutdownVM()) -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpVMTypeResourceImpl.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpVMTypeResourceImpl.kt deleted file mode 100644 index 949a9dd3177..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/OpVMTypeResourceImpl.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.controller - -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.web.RestResource -import com.tencent.devops.dispatch.api.OpVMTypeResource -import com.tencent.devops.dispatch.pojo.VMType -import com.tencent.devops.dispatch.pojo.VMTypeCreate -import com.tencent.devops.dispatch.service.VMTypeService -import org.springframework.beans.factory.annotation.Autowired - -@RestResource@Suppress("ALL") -class OpVMTypeResourceImpl @Autowired constructor( - private val vmTypeService: VMTypeService -) : OpVMTypeResource { - - override fun list() = Result(vmTypeService.queryAllVMType()) - - override fun create(typeName: VMTypeCreate) = vmTypeService.createType(typeName.typeName) - - override fun update(vmType: VMType) = vmTypeService.updateType(vmType) - - override fun delete(typeId: Int): Result { - vmTypeService.deleteType(typeId) - return Result(true) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/ServiceVMResourceImpl.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/ServiceVMResourceImpl.kt deleted file mode 100644 index da201151ec5..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/controller/ServiceVMResourceImpl.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.controller - -import com.tencent.devops.common.api.exception.ParamBlankException -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.api.util.HashUtil -import com.tencent.devops.common.web.RestResource -import com.tencent.devops.dispatch.api.ServiceVMResource -import com.tencent.devops.dispatch.pojo.VM -import com.tencent.devops.dispatch.service.VMService -import org.springframework.beans.factory.annotation.Autowired - -@RestResource -class ServiceVMResourceImpl @Autowired constructor(val vmService: VMService) : ServiceVMResource { - - override fun get(vmHashId: String): Result { - if (vmHashId.isBlank()) { - throw ParamBlankException("无效的VM哈希ID") - } - return Result(vmService.queryVMById(HashUtil.decodeOtherIdToLong(vmHashId))) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/MachineDao.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/MachineDao.kt deleted file mode 100644 index a59281ae5f8..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/MachineDao.kt +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.dao - -import com.tencent.devops.common.api.util.SecurityUtil -import com.tencent.devops.common.api.util.timestamp -import com.tencent.devops.dispatch.pojo.Machine -import com.tencent.devops.model.dispatch.tables.TDispatchMachine -import com.tencent.devops.model.dispatch.tables.records.TDispatchMachineRecord -import org.jooq.Condition -import org.jooq.DSLContext -import org.jooq.Result -import org.springframework.stereotype.Repository -import org.springframework.util.StringUtils -import java.time.LocalDateTime - -@Repository@Suppress("ALL") -class MachineDao { - - fun findAllMachine(dslContext: DSLContext): Result { - return findAllMachine(dslContext, null, null, null) - } - - fun findAllMachine( - dslContext: DSLContext, - ip: String?, - name: String?, - username: String? - ): Result { - with(TDispatchMachine.T_DISPATCH_MACHINE) { - val conditions = mutableListOf() - if (!StringUtils.isEmpty(ip)) conditions.add(MACHINE_IP.like("%" + ip + "%")) - if (!StringUtils.isEmpty(name)) conditions.add(MACHINE_NAME.like("%" + name + "%")) - if (!StringUtils.isEmpty(username)) conditions.add(MACHINE_USERNAME.like("%" + username + "%")) - return dslContext.selectFrom(this) - .where(conditions) - .orderBy(MACHINE_ID.asc()) - .fetch() - } - } - - fun findMachineById(dslContext: DSLContext, id: Int): TDispatchMachineRecord? { - return dslContext.selectFrom(TDispatchMachine.T_DISPATCH_MACHINE) - .where(TDispatchMachine.T_DISPATCH_MACHINE.MACHINE_ID.eq(id)) - .fetchAny() - } - - fun findMachineByIp(dslContext: DSLContext, ip: String): TDispatchMachineRecord? { - return dslContext.selectFrom(TDispatchMachine.T_DISPATCH_MACHINE) - .where(TDispatchMachine.T_DISPATCH_MACHINE.MACHINE_IP.eq(ip)) - .fetchAny() - } - - fun findMachineByName(dslContext: DSLContext, vmName: String): TDispatchMachineRecord? { - with(TDispatchMachine.T_DISPATCH_MACHINE) { - return dslContext.selectFrom(this) - .where(MACHINE_NAME.eq(vmName)) - .fetchAny() - } - } - - fun countByIp(dslContext: DSLContext, ip: String): Int { - with(TDispatchMachine.T_DISPATCH_MACHINE) { - return dslContext.selectCount().from(this).where(MACHINE_IP.eq(ip)).fetchOne(0, Int::class.java)!! - } - } - - fun countByName(dslContext: DSLContext, name: String): Int { - with(TDispatchMachine.T_DISPATCH_MACHINE) { - return dslContext.selectCount().from(this).where(MACHINE_NAME.eq(name)).fetchOne(0, Int::class.java)!! - } - } - - fun addMachine( - dslContext: DSLContext, - ip: String, - name: String, - username: String, - password: String, - maxVMRun: Int - ) { - with(TDispatchMachine.T_DISPATCH_MACHINE) { - val now = LocalDateTime.now() - dslContext.insertInto( - this, - MACHINE_IP, - MACHINE_NAME, - MACHINE_USERNAME, - MACHINE_PASSWORD, - MAX_VM_RUN, - MACHINE_CREATED_TIME, - MACHINE_UPDATED_TIME - ) - .values( - ip, - name, - username, - SecurityUtil.encrypt(password), - maxVMRun, - now, - now - ) - .execute() - } - } - - fun updateMachine( - dslContext: DSLContext, - id: Int, - ip: String, - name: String, - username: String, - password: String, - maxVMRun: Int - ) { - with(TDispatchMachine.T_DISPATCH_MACHINE) { - dslContext.update(this) - .set(MACHINE_IP, ip) - .set(MACHINE_NAME, name) - .set(MACHINE_USERNAME, username) - .set(MACHINE_PASSWORD, SecurityUtil.encrypt(password)) - .set(MAX_VM_RUN, maxVMRun) - .set(MACHINE_UPDATED_TIME, LocalDateTime.now()) - .where(MACHINE_ID.eq(id)) - .execute() - } - } - - fun deleteMachine(dslContext: DSLContext, id: Int) { - with(TDispatchMachine.T_DISPATCH_MACHINE) { - dslContext.deleteFrom(this) - .where(MACHINE_ID.eq(id)) - .execute() - } - } - - fun parseMachine(record: TDispatchMachineRecord?): Machine? { - return if (record == null) { - null - } else Machine( - record.machineId, - record.machineIp, - record.machineName, - record.machineUsername, - SecurityUtil.decrypt(record.machinePassword), - record.currentVmRun, - record.maxVmRun, - record.machineCreatedTime.timestamp(), - record.machineUpdatedTime.timestamp() - ) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/PipelineVMDao.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/PipelineVMDao.kt deleted file mode 100644 index 2ae929b6593..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/PipelineVMDao.kt +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.dao - -import com.tencent.devops.model.dispatch.tables.TDispatchPipelineVm -import org.jooq.DSLContext -import org.jooq.impl.DSL -import org.springframework.stereotype.Repository - -@Repository@Suppress("ALL") -class PipelineVMDao { - - fun getVMs( - dslContext: DSLContext, - pipelineId: String, - vmSeqId: Int? - ): String? { - with(TDispatchPipelineVm.T_DISPATCH_PIPELINE_VM) { - val step = dslContext.selectFrom(this) - .where(PIPELINE_ID.eq(pipelineId)) - if (vmSeqId != null) { - step.and(VM_SEQ_ID.eq(vmSeqId)) - } else { - step.and(VM_SEQ_ID.eq(-1)) - } - return step.fetchOne()?.vmNames - } - } - - fun setVMs( - dslContext: DSLContext, - pipelineId: String, - vmNames: String, - vmSeqId: Int? - ) { - with(TDispatchPipelineVm.T_DISPATCH_PIPELINE_VM) { - dslContext.transaction { configuration -> - val context = DSL.using(configuration) - val step = context.selectFrom(this) - .where(PIPELINE_ID.eq(pipelineId)) - if (vmSeqId != null) { - step.and(VM_SEQ_ID.eq(vmSeqId)) - } - val exist = step.fetch() - - if (exist.isEmpty()) { - // insert - if (vmSeqId == null) { - context.insertInto(this, - PIPELINE_ID, - VM_NAMES) - .values(pipelineId, vmNames) - .execute() - } else { - context.insertInto(this, - PIPELINE_ID, - VM_NAMES, - VM_SEQ_ID) - .values(pipelineId, vmNames, vmSeqId) - .execute() - } - } else { - // update - val updateStep = context.update(this) - .set(VM_NAMES, vmNames) - .where(PIPELINE_ID.eq(pipelineId)) - - if (vmSeqId != null) { - updateStep.and(VM_SEQ_ID.eq(vmSeqId)) - } - - updateStep.execute() - } - } - } - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/PrivateVMDao.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/PrivateVMDao.kt deleted file mode 100644 index b6fdc88021b..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/PrivateVMDao.kt +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.dao - -import com.tencent.devops.model.dispatch.tables.TDispatchPrivateVm -import com.tencent.devops.model.dispatch.tables.records.TDispatchPrivateVmRecord -import org.jooq.DSLContext -import org.jooq.Result -import org.springframework.stereotype.Repository - -@Repository@Suppress("ALL") -class PrivateVMDao { - - fun findVMByProject(dslContext: DSLContext, projectId: String): Result { - with(TDispatchPrivateVm.T_DISPATCH_PRIVATE_VM) { - return dslContext.selectFrom(this) - .where(PROJECT_ID.eq(projectId)) - .fetch() - } - } - - fun list(dslContext: DSLContext): Result { - with(TDispatchPrivateVm.T_DISPATCH_PRIVATE_VM) { - return dslContext.selectFrom(this) - .fetch() - } - } - - fun add(dslContext: DSLContext, vmId: Long, projectId: String) { - with(TDispatchPrivateVm.T_DISPATCH_PRIVATE_VM) { - dslContext.insertInto(this, - VM_ID, - PROJECT_ID) - .values(vmId.toInt(), projectId) - .execute() - } - } - - fun delete(dslContext: DSLContext, vmId: Long, projectId: String) { - with(TDispatchPrivateVm.T_DISPATCH_PRIVATE_VM) { - dslContext.deleteFrom(this) - .where(VM_ID.eq(vmId.toInt())) - .and(PROJECT_ID.eq(projectId)) - .execute() - } - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/ProjectSnapshotDao.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/ProjectSnapshotDao.kt deleted file mode 100644 index fee6d3e50fc..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/ProjectSnapshotDao.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.dao - -import com.tencent.devops.model.dispatch.tables.TDispatchProjectSnapshot -import com.tencent.devops.model.dispatch.tables.records.TDispatchProjectSnapshotRecord -import org.jooq.DSLContext -import org.springframework.stereotype.Repository - -@Repository -class ProjectSnapshotDao { - - fun findSnapshot(dslContext: DSLContext, projectId: String): TDispatchProjectSnapshotRecord? { - return dslContext.selectFrom(TDispatchProjectSnapshot.T_DISPATCH_PROJECT_SNAPSHOT) - .where(TDispatchProjectSnapshot.T_DISPATCH_PROJECT_SNAPSHOT.PROJECT_ID.eq(projectId)) - .fetchOne() - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/VMDao.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/VMDao.kt deleted file mode 100644 index b6ac34cdf80..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/VMDao.kt +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.dao - -import com.tencent.devops.common.api.util.SecurityUtil -import com.tencent.devops.common.api.util.timestamp -import com.tencent.devops.common.service.utils.ByteUtils -import com.tencent.devops.dispatch.pojo.VM -import com.tencent.devops.dispatch.pojo.VMCreate -import com.tencent.devops.model.dispatch.tables.TDispatchMachine -import com.tencent.devops.model.dispatch.tables.TDispatchVm -import com.tencent.devops.model.dispatch.tables.TDispatchVmType -import com.tencent.devops.model.dispatch.tables.records.TDispatchVmRecord -import org.jooq.Condition -import org.jooq.DSLContext -import org.jooq.Record -import org.jooq.Result -import org.springframework.stereotype.Repository -import org.springframework.util.StringUtils -import java.time.LocalDateTime - -@Repository@Suppress("ALL") -class VMDao { - - fun findAllVms(dslContext: DSLContext): Result { - return dslContext.selectFrom(TDispatchVm.T_DISPATCH_VM) - .fetch() - } - - fun count(dslContext: DSLContext) = dslContext.selectCount() - .from(TDispatchVm.T_DISPATCH_VM) - .fetchOne(0, Int::class.java) - - fun findVms( - dslContext: DSLContext, - ip: String?, - name: String?, - typeId: Int?, - os: String?, - osVersion: String?, - offset: Int?, - limit: Int? - ): Result? { - val a = TDispatchVm.T_DISPATCH_VM.`as`("a") - val b = TDispatchMachine.T_DISPATCH_MACHINE.`as`("b") - val c = TDispatchVmType.T_DISPATCH_VM_TYPE.`as`("c") - val conditions = mutableListOf() - if (!StringUtils.isEmpty(ip)) conditions.add(a.VM_IP.like("%$ip%")) - if (!StringUtils.isEmpty(name)) conditions.add(a.VM_NAME.like("%$name%")) - if (!StringUtils.isEmpty(os)) conditions.add(a.VM_OS.like("%$os%")) - if (!StringUtils.isEmpty(osVersion)) conditions.add(a.VM_OS_VERSION.like("%$osVersion%")) - if (!StringUtils.isEmpty(typeId)) conditions.add(a.VM_TYPE_ID.eq(typeId)) - val baseStep = dslContext.select( - a.VM_ID.`as`("id"), - a.VM_MACHINE_ID.`as`("machineId"), - b.MACHINE_NAME.`as`("machineName"), - a.VM_TYPE_ID.`as`("typeId"), - c.TYPE_NAME.`as`("typeName"), - a.VM_IP.`as`("ip"), - a.VM_NAME.`as`("name"), - a.VM_OS.`as`("os"), - a.VM_OS_VERSION.`as`("osVersion"), - a.VM_CPU.`as`("cpu"), - a.VM_MEMORY.`as`("memory"), - a.VM_MAINTAIN.`as`("inMaintain"), - a.VM_MANAGER_USERNAME.`as`("vmManagerUsername"), - a.VM_MANAGER_PASSWD.`as`("vmManagerPassword"), - a.VM_USERNAME.`as`("vmUsername"), - a.VM_PASSWD.`as`("vmPassword"), - a.VM_CREATED_TIME.`as`("createdTime"), - a.VM_UPDATED_TIME.`as`("updatedTime") - ).from(a).join(b).on(a.VM_MACHINE_ID.eq(b.MACHINE_ID)).join(c).on(a.VM_TYPE_ID.eq(c.TYPE_ID)) - .where(conditions).orderBy(a.VM_ID.desc()) - if (offset != null) { - baseStep.offset(offset) - } - if (limit != null) { - baseStep.limit(limit) - } - return baseStep.fetch() - } - - fun findVmsWithOffset(dslContext: DSLContext, offset: Int) = - dslContext.selectFrom(TDispatchVm.T_DISPATCH_VM) - .offset(offset) - .fetch() - - fun findVmsWithLimit(dslContext: DSLContext, offset: Int, limit: Int) = - dslContext.selectFrom(TDispatchVm.T_DISPATCH_VM) - .limit(offset, limit) - .fetch() - - fun findVMById(dslContext: DSLContext, id: Long): TDispatchVmRecord? { - return dslContext.selectFrom(TDispatchVm.T_DISPATCH_VM) - .where(TDispatchVm.T_DISPATCH_VM.VM_ID.eq(id)) - .fetchAny() - } - - fun findVMByIds(dslContext: DSLContext, ids: Set): Result { - return dslContext.selectFrom(TDispatchVm.T_DISPATCH_VM) - .where(TDispatchVm.T_DISPATCH_VM.VM_ID.`in`(ids)) - .fetch() - } - - fun findVMByName(dslContext: DSLContext, name: String): TDispatchVmRecord? { - return dslContext.selectFrom(TDispatchVm.T_DISPATCH_VM) - .where(TDispatchVm.T_DISPATCH_VM.VM_NAME.eq(name)) - .fetchAny() - } - - fun findVMByIp(dslContext: DSLContext, ip: String): TDispatchVmRecord? { - return dslContext.selectFrom(TDispatchVm.T_DISPATCH_VM) - .where(TDispatchVm.T_DISPATCH_VM.VM_IP.eq(ip)) - .fetchAny() - } - - fun findVMsByMachine(dslContext: DSLContext, machineId: Int): Result { - with(TDispatchVm.T_DISPATCH_VM) { - return dslContext.selectFrom(this) - .where(VM_MACHINE_ID.eq(machineId)) - .fetch() - } - } - - fun maintainVM(dslContext: DSLContext, vmId: Long, maintain: Boolean) { - with(TDispatchVm.T_DISPATCH_VM) { - dslContext.update(this) - .set(VM_MAINTAIN, ByteUtils.bool2Byte(maintain)) - .where(VM_ID.eq(vmId)) - .execute() - } - } - - fun countByIp(dslContext: DSLContext, ip: String): Int { - with(TDispatchVm.T_DISPATCH_VM) { - return dslContext.selectCount().from(this).where(VM_IP.eq(ip)).fetchOne(0, Int::class.java)!! - } - } - - fun countByName(dslContext: DSLContext, name: String): Int { - with(TDispatchVm.T_DISPATCH_VM) { - return dslContext.selectCount().from(this).where(VM_NAME.eq(name)).fetchOne(0, Int::class.java)!! - } - } - - fun addVM(dslContext: DSLContext, vm: VMCreate) { - with(TDispatchVm.T_DISPATCH_VM) { - val now = LocalDateTime.now() - dslContext.insertInto(this, - VM_IP, - VM_NAME, - VM_MACHINE_ID, - VM_OS, - VM_OS_VERSION, - VM_CPU, - VM_MEMORY, - VM_TYPE_ID, - VM_MAINTAIN, - VM_MANAGER_USERNAME, - VM_MANAGER_PASSWD, - VM_USERNAME, - VM_PASSWD, - VM_CREATED_TIME, - VM_UPDATED_TIME) - .values( - vm.ip, - vm.name, - vm.machineId, - vm.os, - vm.osVersion, - vm.cpu, - vm.memory, - vm.typeId, - ByteUtils.bool2Byte(vm.inMaintain), - vm.vmManagerUsername, - SecurityUtil.encrypt(vm.vmManagerPassword), - vm.vmUsername, - SecurityUtil.encrypt(vm.vmPassword), - now, - now - ) - .execute() - } - } - - fun deleteVM(dslContext: DSLContext, id: Long): Int { - with(TDispatchVm.T_DISPATCH_VM) { - return dslContext.deleteFrom(this) - .where(VM_ID.eq(id)) - .execute() - } - } - - fun updateVM(dslContext: DSLContext, vm: VMCreate): Int { - with(TDispatchVm.T_DISPATCH_VM) { - return dslContext.update(this) - .set(VM_MACHINE_ID, vm.machineId) - .set(VM_IP, vm.ip) - .set(VM_NAME, vm.name) - .set(VM_OS, vm.os) - .set(VM_CPU, vm.cpu) - .set(VM_MEMORY, vm.memory) - .set(VM_TYPE_ID, vm.typeId) - .set(VM_MAINTAIN, ByteUtils.bool2Byte(vm.inMaintain)) - .set(VM_MANAGER_USERNAME, vm.vmManagerUsername) - .set(VM_MANAGER_PASSWD, SecurityUtil.encrypt(vm.vmManagerPassword)) - .set(VM_USERNAME, vm.vmUsername) - .set(VM_PASSWD, SecurityUtil.encrypt(vm.vmPassword)) - .set(VM_UPDATED_TIME, LocalDateTime.now()) - .where(VM_ID.eq(vm.id)) - .execute() - } - } - - fun deleteVMsByMachine(dslContext: DSLContext, machineId: Int): Int { - with(TDispatchVm.T_DISPATCH_VM) { - return dslContext.deleteFrom(this) - .where(VM_MACHINE_ID.eq(machineId)) - .execute() - } - } - - fun parseVM(record: TDispatchVmRecord?): VM? { - return if (record == null) { - null - } else VM(record.vmId, - record.vmMachineId, - record.vmTypeId, - record.vmIp, - record.vmName, - record.vmOs, - record.vmOsVersion, - record.vmCpu, - record.vmMemory, - ByteUtils.byte2Bool(record.vmMaintain), - record.vmManagerUsername, - SecurityUtil.decrypt(record.vmManagerPasswd), - record.vmUsername, - SecurityUtil.decrypt(record.vmPasswd), - record.vmCreatedTime.timestamp(), - record.vmUpdatedTime.timestamp()) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/VMTypeDao.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/VMTypeDao.kt deleted file mode 100644 index e18fc4b3219..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/dao/VMTypeDao.kt +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.dao - -import com.tencent.devops.common.api.util.timestamp -import com.tencent.devops.dispatch.pojo.VMType -import com.tencent.devops.model.dispatch.tables.TDispatchVmType -import com.tencent.devops.model.dispatch.tables.records.TDispatchVmTypeRecord -import org.jooq.DSLContext -import org.jooq.Result -import org.springframework.stereotype.Repository -import java.time.LocalDateTime - -@Repository@Suppress("ALL") -class VMTypeDao { - - fun findVMTypeById(dslContext: DSLContext, id: Int): TDispatchVmTypeRecord? { - return with(TDispatchVmType.T_DISPATCH_VM_TYPE) { - dslContext.selectFrom(this) - .where(TYPE_ID.eq(id)) - .fetchAny() - } - } - - fun findAllVMType(dslContext: DSLContext): Result? { - return with(TDispatchVmType.T_DISPATCH_VM_TYPE) { - dslContext.selectFrom(this) - .orderBy(TYPE_ID.asc()) - .fetch() - } - } - - fun countByName(dslContext: DSLContext, typeName: String): Int { - with(TDispatchVmType.T_DISPATCH_VM_TYPE) { - return dslContext.selectCount().from(this).where(TYPE_NAME.eq(typeName)).fetchOne(0, Int::class.java)!! - } - } - - fun createVMType( - dslContext: DSLContext, - typeName: String - ): Boolean { - with(TDispatchVmType.T_DISPATCH_VM_TYPE) { - val now = LocalDateTime.now() - return dslContext.insertInto(this) - .columns(TYPE_NAME, TYPE_CREATED_TIME, TYPE_UPDATED_TIME) - .values(typeName, now, now) - .execute() == 1 - } - } - - fun updateVMType( - dslContext: DSLContext, - typeId: Int, - typeName: String - ): Boolean { - with(TDispatchVmType.T_DISPATCH_VM_TYPE) { - return dslContext.update(this) - .set(TYPE_NAME, typeName) - .set(TYPE_UPDATED_TIME, LocalDateTime.now()) - .where(TYPE_ID.eq(typeId)) - .execute() == 1 - } - } - - fun deleteVMType( - dslContext: DSLContext, - typeId: Int - ) { - with(TDispatchVmType.T_DISPATCH_VM_TYPE) { - dslContext.delete(this) - .where(TYPE_ID.eq(typeId)) - .execute() - } - } - - fun parseVMType(record: TDispatchVmTypeRecord?): VMType? { - return if (record == null) { - null - } else { - VMType(record.typeId, - record.typeName, - record.typeCreatedTime.timestamp(), - record.typeUpdatedTime.timestamp()) - } - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/CodeccDownloaderService.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/CodeccDownloaderService.kt deleted file mode 100644 index 3b7eb22fd24..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/CodeccDownloaderService.kt +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service - -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.common.api.util.FileUtil -import com.tencent.devops.plugin.codecc.pojo.CodeccToolType -import org.springframework.beans.factory.annotation.Value -import org.springframework.stereotype.Service -import java.io.File -import javax.ws.rs.NotFoundException -import javax.ws.rs.core.MediaType -import javax.ws.rs.core.Response -import javax.ws.rs.core.StreamingOutput - -@Service@Suppress("ALL") -class CodeccDownloaderService { - - @Value("\${codecc.path:#{null}}") - private val codeccPath: String? = null - - @Value("\${codecc.covFile}") - private lateinit var covScriptFile: String - - @Value("\${codecc.toolFile}") - private lateinit var toolScriptFile: String - - fun downloadTool(toolName: String, osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - return when (toolName) { - CodeccToolType.PYTHON2.name -> downloadPython2(osType, fileMd5, is32Bit) - CodeccToolType.PYTHON3.name -> downloadPython3(osType, fileMd5, is32Bit) - CodeccToolType.COVERITY.name -> downloadCoverity(osType, fileMd5, is32Bit) - CodeccToolType.KLOCWORK.name -> downloadKlocwork(osType, fileMd5, is32Bit) - CodeccToolType.ESLINT.name -> downloadEslint(osType, fileMd5, is32Bit) - CodeccToolType.PYLINT2.name -> downloadPylint2(osType, fileMd5, is32Bit) - CodeccToolType.PYLINT3.name -> downloadPylint3(osType, fileMd5, is32Bit) - CodeccToolType.GOLANG.name -> downloadGolang(osType, fileMd5, is32Bit) - CodeccToolType.GOMETALINTER.name -> downloadGoMetaLinter(osType, fileMd5, is32Bit) - CodeccToolType.JDK8.name -> downloadJdk8(osType, fileMd5, is32Bit) - else -> throw RuntimeException("unsupported tool name: $toolName") - } - } - - private fun downloadJdk8(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val file = when (osType) { - OSType.LINUX -> { - if (is32Bit != null && is32Bit) { - "jdk-8u191-linux-i586.tar.gz" - } else { - "jdk-8u191-linux-x64.tar.gz" - } - } - OSType.MAC_OS -> { - "jdk-8u191-macosx-x64.dmg" - } - else -> { - throw RuntimeException("not support os: $osType") - } - } - return download(file, fileMd5) - } - - private fun downloadGoMetaLinter(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val file = if (osType == OSType.MAC_OS) "gometalinter_macos.zip" else "gometalinter_linux.zip" - return download(file, fileMd5) - } - - private fun downloadGolang(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val file = when (osType) { - OSType.LINUX -> { - if (is32Bit != null && is32Bit) { - "go1.9.2.linux-386.tar.gz" - } else { - "go1.9.2.linux-amd64.tar.gz" - } - } - OSType.MAC_OS -> { - "go1.9.2.darwin-amd64.tar.gz" - } - else -> { - throw RuntimeException("not support os: $osType") - } - } - return download(file, fileMd5) - } - - private fun downloadPylint3(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val file = "pylint_3.5.zip" - return download(file, fileMd5) - } - - private fun downloadPylint2(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val file = "pylint_2.7.zip" - return download(file, fileMd5) - } - - private fun downloadEslint(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val file = "node-v8.9.0-linux-x64_eslint.tar.gz" - return download(file, fileMd5) - } - - fun downloadKlocwork(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val klocFile = when (osType) { - OSType.LINUX -> { - if (is32Bit != null && is32Bit) { - "kw-analysis-linux-12.3.tar.gz" - } else { - "kw-analysis-linux64-12.3.tar.gz" - } - } - OSType.MAC_OS -> { - "cov-analysis-macosx-2018.06.tar.gz" - } - else -> { - throw RuntimeException("not support os: $osType") - } - } - return download(klocFile, fileMd5) - } - - fun downloadCoverity(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val covFile = when (osType) { - OSType.LINUX -> { - if (is32Bit != null && is32Bit) { - "cov-analysis-linux-2018.03.tar.gz" - } else { - "cov-analysis-linux64-2018.03.tar.gz" - } - } - OSType.MAC_OS -> { - "cov-analysis-macosx-2018.06.tar.gz" - } - else -> { - throw RuntimeException("not support os: $osType") - } - } - return download(covFile, fileMd5) - } - - fun downloadPython2(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val pyFile = "Python-2.7.12.tgz" - return download(pyFile, fileMd5) - } - - fun downloadPython3(osType: OSType, fileMd5: String, is32Bit: Boolean?): Response { - val pyFile = "Python-3.5.1.tgz" - return download(pyFile, fileMd5) - } - - fun downloadCovScript(osType: OSType, fileMd5: String): Response { - return download(covScriptFile, fileMd5) - } - - fun downloadToolsScript(osType: OSType, fileMd5: String): Response { - return download(toolScriptFile, fileMd5) - } - - private fun download(file: String, eTag: String): Response { - val target = File(codeccPath, file) - if (!target.exists()) { - throw NotFoundException("${target.absolutePath} 不存在") - } - - if (!target.isFile) { - throw RuntimeException("${target.absolutePath} 不是一个文件") - } - - if (eTag.isNotBlank()) { - // 检查文件的MD5值是否和客户端一致 - if (FileUtil.getMD5(target) == eTag) { - return Response.status(Response.Status.NOT_MODIFIED).build() - } - } - val buf = ByteArray(40960) - val inputStream = target.inputStream() - val fileStream = StreamingOutput { output -> - while (true) { - val len = inputStream.read(buf) - if (len == -1) break - output.write(buf, 0, len) - output.flush() - } - } - return Response - .ok(fileStream, MediaType.APPLICATION_OCTET_STREAM_TYPE) - .header("content-disposition", "attachment; filename = ${target.name}") - .build() - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/MachineService.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/MachineService.kt deleted file mode 100644 index 0c3bfb64b3a..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/MachineService.kt +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service - -import com.tencent.devops.common.api.constant.CommonMessageCode -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.service.utils.MessageCodeUtil -import com.tencent.devops.dispatch.dao.MachineDao -import com.tencent.devops.dispatch.dao.VMDao -import com.tencent.devops.dispatch.pojo.Machine -import com.tencent.devops.dispatch.pojo.MachineCreate -import com.tencent.devops.dispatch.service.vm.VMCache -import org.jooq.DSLContext -import org.jooq.impl.DSL -import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Service - -@Service@Suppress("ALL") -class MachineService @Autowired constructor( - private val machineDao: MachineDao, - private val vmDao: VMDao, - private val vmCache: VMCache, - private val dslContext: DSLContext -) { - - private val logger = LoggerFactory.getLogger(MachineService::class.java) - - fun queryAllMachine(ip: String?, name: String?, username: String?): List { - val results = machineDao.findAllMachine(dslContext, ip, name, username) - val machines = ArrayList() - results.forEach { - val m = machineDao.parseMachine(it) - if (m != null) { - machines.add(m) - } - } - return machines - } - - fun queryMachineById(id: Int): Machine? { - return machineDao.parseMachine(machineDao.findMachineById(dslContext, id)) - } - - fun queryMachineByIp(ip: String): Machine? { - return machineDao.parseMachine(machineDao.findMachineByIp(dslContext, ip)) - } - - fun queryMachineByVMName(vmName: String): Machine? { - val vmRecord = vmDao.findVMByName(dslContext, vmName) ?: return null - return queryMachineById(vmRecord.vmMachineId!!) - } - - fun addMachine(machine: MachineCreate): Result { - logger.info("the machine request is {}", machine) - // 判断ip是否重复 - val ipCount = machineDao.countByIp(dslContext, machine.ip) - if (ipCount > 0) { - return MessageCodeUtil.generateResponseDataObject( - CommonMessageCode.PARAMETER_IS_EXIST, - arrayOf(machine.ip), - false - ) - } - // 判断名字是否重复 - val nameCount = machineDao.countByName(dslContext, machine.name) - if (nameCount > 0) { - return MessageCodeUtil.generateResponseDataObject( - CommonMessageCode.PARAMETER_IS_EXIST, - arrayOf(machine.name), - false - ) - } - machineDao.addMachine( - dslContext, - machine.ip, - machine.name, - machine.username, - machine.password, - machine.maxVMRun - ) - return Result(true) - } - - fun updateMachine(machine: MachineCreate): Result { - logger.info("the machine request is {}", machine) - val ipCount = machineDao.countByIp(dslContext, machine.ip) - if (ipCount > 0) { - val machineObj = machineDao.findMachineById(dslContext, machine.id) - if (null != machineObj && machineObj.machineIp != machine.ip) { - return MessageCodeUtil.generateResponseDataObject( - CommonMessageCode.PARAMETER_IS_EXIST, - arrayOf(machine.ip), - false - ) - } - } - val nameCount = machineDao.countByName(dslContext, machine.name) - if (nameCount > 0) { - val machineObj = machineDao.findMachineById(dslContext, machine.id) - if (null != machineObj && machineObj.machineName != machine.name) { - return MessageCodeUtil.generateResponseDataObject( - CommonMessageCode.PARAMETER_IS_EXIST, - arrayOf(machine.name), - false - ) - } - } - machineDao.updateMachine( - dslContext, - machine.id, - machine.ip, - machine.name, - machine.username, - machine.password, machine.maxVMRun - ) - vmCache.expireByMachineId(machine.id) - return Result(true) - } - - fun deleteMachine(id: Int) { - dslContext.transaction { configuration -> - val transactionContext = DSL.using(configuration) - machineDao.deleteMachine(transactionContext, id) - vmDao.deleteVMsByMachine(transactionContext, id) - } - vmCache.expireByMachineId(id) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/PipelineVMService.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/PipelineVMService.kt deleted file mode 100644 index d6650acf7b4..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/PipelineVMService.kt +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service - -import com.tencent.devops.dispatch.dao.PipelineVMDao -import org.jooq.DSLContext -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Service - -@Service@Suppress("ALL") -class PipelineVMService @Autowired constructor( - private val pipelineVMDao: PipelineVMDao, - private val dslContext: DSLContext -) { - - fun getVMs(pipelineId: String, vmSeqId: Int?): String? { - return pipelineVMDao.getVMs(dslContext, pipelineId, vmSeqId) - } - - fun getVMsByPipelines(pipelineId: String, vmSeqId: Int?): String? { - val vmNames = getVMs(pipelineId, vmSeqId) - return if (vmNames.isNullOrBlank()) { - if (vmSeqId == null) { - null - } else { - // If the special vm of the pipeline & vmSeqId is empty, try to get it only by pipelineId - getVMs(pipelineId, null) - } - } else { - vmNames - } - } - - /** - * vmName separate by ',' - */ - fun setVMs(pipelineId: String, vmNames: String, vmSeqId: Int?) { - pipelineVMDao.setVMs(dslContext, pipelineId, vmNames, vmSeqId) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/PrivateVMService.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/PrivateVMService.kt deleted file mode 100644 index e4efec8ec84..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/PrivateVMService.kt +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service - -import com.tencent.devops.dispatch.dao.PrivateVMDao -import com.tencent.devops.dispatch.dao.VMDao -import com.tencent.devops.dispatch.pojo.VMWithPrivateProject -import org.jooq.DSLContext -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Service - -@Service@Suppress("ALL") -class PrivateVMService @Autowired constructor( - private val dslContext: DSLContext, - private val privateVMDao: PrivateVMDao, - private val vmDao: VMDao -) { - - fun list(): List { - val records = privateVMDao.list(dslContext) - val vmIds = records.map { - it.vmId.toLong() - }.toSet() - - val map = records.map { - it.vmId.toLong() to it.projectId - }.toMap() - val vmRecords = vmDao.findVMByIds(dslContext, vmIds) - return vmRecords.map { - VMWithPrivateProject( - it.vmId, - it.vmMachineId, - it.vmTypeId, - it.vmIp, - it.vmName, - map[it.vmId] ?: "" - ) - } - } - - fun add(vmId: Long, projectId: String) { - privateVMDao.add(dslContext, vmId, projectId) - } - - fun delete(vmId: Long, projectId: String) { - privateVMDao.delete(dslContext, vmId, projectId) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/VMService.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/VMService.kt deleted file mode 100644 index 0c8f5acda06..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/VMService.kt +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service - -import com.tencent.devops.common.api.constant.CommonMessageCode -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.api.util.HashUtil -import com.tencent.devops.common.api.util.timestamp -import com.tencent.devops.common.service.utils.ByteUtils -import com.tencent.devops.common.service.utils.MessageCodeUtil -import com.tencent.devops.dispatch.dao.MachineDao -import com.tencent.devops.dispatch.dao.PrivateVMDao -import com.tencent.devops.dispatch.dao.VMDao -import com.tencent.devops.dispatch.dao.VMTypeDao -import com.tencent.devops.dispatch.exception.MachineNotExistException -import com.tencent.devops.dispatch.exception.VMNotExistException -import com.tencent.devops.dispatch.exception.VMTypeNotExistException -import com.tencent.devops.dispatch.pojo.VM -import com.tencent.devops.dispatch.pojo.VMCreate -import com.tencent.devops.dispatch.pojo.VMResponse -import com.tencent.devops.dispatch.pojo.VMWithPage -import com.tencent.devops.dispatch.service.vm.PowerOffVM -import com.tencent.devops.dispatch.service.vm.PowerOnVM -import com.tencent.devops.dispatch.service.vm.QueryVMs -import com.tencent.devops.dispatch.service.vm.VMCache -import com.vmware.vim25.mo.VirtualMachine -import org.jooq.DSLContext -import org.jooq.impl.DSL -import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Service -import java.time.LocalDateTime -import java.util.Collections -import java.util.stream.Collectors -import javax.ws.rs.NotFoundException - -@Service -@Suppress("ALL") -class VMService @Autowired constructor( - private val vmDao: VMDao, - private val machineDao: MachineDao, - private val vmTypeDao: VMTypeDao, - private val privateVMDao: PrivateVMDao, - private val queryVMs: QueryVMs, - private val powerOnVM: PowerOnVM, - private val powerOffVM: PowerOffVM, - private val vmCache: VMCache, - private val dslContext: DSLContext -) { - - private val logger = LoggerFactory.getLogger(VMService::class.java) - - fun queryVMs( - ip: String?, - name: String?, - typeId: Int?, - os: String?, - osVersion: String?, - offset: Int?, - limit: Int? - ): VMWithPage { - val vms = ArrayList() - vmDao.findVms(dslContext, ip, name, typeId, os, osVersion, offset, limit)?.forEach { - val vm = VMResponse( - id = it["id"] as Int, - machineId = it["machineId"] as Int, - machineName = it["machineName"] as String, - typeId = it["typeId"] as Int, - typeName = it["typeName"] as String, - ip = it["ip"] as String, - name = it["name"] as String, - os = it["os"] as String, - osVersion = it["osVersion"] as String, - cpu = it["cpu"] as String, - memory = it["memory"] as String, - inMaintain = ByteUtils.byte2Bool(it["inMaintain"] as Byte), - vmManagerUsername = it["vmManagerUsername"] as String, - vmManagerPassword = it["vmManagerPassword"] as String, - vmUsername = it["vmUsername"] as String, - vmPassword = it["vmPassword"] as String, - createdTime = (it["createdTime"] as LocalDateTime).timestamp(), - updatedTime = (it["updatedTime"] as LocalDateTime).timestamp() - ) - vms.add(vm) - } - return VMWithPage(vms.size, vms) - } - - fun addVM(vm: VMCreate): Result { - logger.info("the VMCreate request is {}", vm) - // 判断ip是否重复 - val ipCount = vmDao.countByIp(dslContext, vm.ip) - if (ipCount > 0) { - return MessageCodeUtil.generateResponseDataObject( - messageCode = CommonMessageCode.PARAMETER_IS_EXIST, - params = arrayOf(vm.ip), - data = false) - } - // 判断名字是否重复 - val nameCount = vmDao.countByName(dslContext, vm.name) - if (nameCount > 0) { - return MessageCodeUtil.generateResponseDataObject( - messageCode = CommonMessageCode.PARAMETER_IS_EXIST, - params = arrayOf(vm.name), - data = false) - } - // Check the machine exist - machineDao.findMachineById(dslContext, vm.machineId) - ?: throw MachineNotExistException("The machine(${vm.machineId}) is not exist") - vmTypeDao.findVMTypeById(dslContext, vm.typeId) - ?: throw VMTypeNotExistException("The VMType(${vm.typeId}) is not exist") - vmDao.addVM(dslContext, vm) - return Result(true) - } - - fun deleteVM(id: Long) { - vmDao.deleteVM(dslContext, id) - vmCache.expire(id) - } - - fun updateVM(vm: VMCreate): Result { - logger.info("the VMCreate request is {}", vm) - val ipCount = vmDao.countByIp(dslContext, vm.ip) - if (ipCount > 0) { - val vmObj = vmDao.findVMById(dslContext, vm.id) - if (null != vmObj && vmObj.vmIp != vm.ip) { - return MessageCodeUtil.generateResponseDataObject( - messageCode = CommonMessageCode.PARAMETER_IS_EXIST, params = arrayOf(vm.ip), data = false) - } - } - val nameCount = vmDao.countByName(dslContext, vm.name) - if (nameCount > 0) { - val vmObj = vmDao.findVMById(dslContext, vm.id) - if (null != vmObj && vmObj.vmName != vm.name) { - return MessageCodeUtil.generateResponseDataObject( - messageCode = CommonMessageCode.PARAMETER_IS_EXIST, params = arrayOf(vm.name), data = false) - } - } - machineDao.findMachineById(dslContext, vm.machineId) - ?: throw MachineNotExistException("The machine(${vm.machineId}) is not exist") - vmTypeDao.findVMTypeById(dslContext, vm.typeId) - ?: throw VMTypeNotExistException("The VMType(${vm.typeId}) is not exist") - vmDao.updateVM(dslContext, vm) - vmCache.expire(vm.id) - return Result(true) - } - - fun queryVMById(id: Long): VM { - return vmDao.parseVM(vmDao.findVMById(dslContext, id)) ?: throw NotFoundException("VM $id is not exist") - } - - fun queryVMByName(name: String): VM? { - return vmDao.parseVM(vmDao.findVMByName(dslContext, name)) - } - - fun queryVMByIp(ip: String): VM { - return vmDao.parseVM(vmDao.findVMByIp(dslContext, ip)) ?: throw NotFoundException("VM($ip) 不存在") - } - - fun shutdownVM(vmId: Long, snapshotKey: String): Boolean { - return powerOffVM.shutdown(vmId, snapshotKey) - } - - fun directShutdownVM(vmId: Long): Boolean { - return powerOffVM.directShutdown(vmId) - } - - fun startUpVM(projectId: String, vmId: Long, snapshotKey: String): Boolean { - return powerOnVM.powerOn(projectId, vmId, snapshotKey) - } - - fun startUpVM(vmId: Long) = powerOnVM.powerOn(vmId) - - fun shutdownVM(vmId: Long) = powerOffVM.shutdown(vmId) - - fun queryVMStatus(vmHashId: String): String { - val vmId = HashUtil.decodeIdToLong(vmHashId) - val vm = vmCache.getVM(vmId) - return vm?.runtime?.powerState?.toString() ?: throw VMNotExistException("VM($vmId) NOT EXIST") - } - - fun queryVMMaintainStatus(vmId: Long): Boolean { - val vm = vmDao.parseVM(vmDao.findVMById(dslContext, vmId)) - return vm?.inMaintain ?: throw VMNotExistException("VM($vmId) is not exist") - } - - fun maintainVM(vmId: Long, maintain: Boolean) { - vmDao.maintainVM(dslContext, vmId, maintain) - } - - @Synchronized - fun findVM(projectId: String, preferVMName: String?, from: String, preVMs: List): VM? { - if (from.isBlank()) { - return null - } - if (!(from.equals("macos", ignoreCase = true) || - from.equals("WINDOWS", ignoreCase = true) || - from.equals("LINUX", ignoreCase = true))) { - logger.warn("The os is illegal($from)") - return null - } - val vms = queryVMs.queryAllPowerOffVM() - if (vms.isEmpty()) { - logger.warn("All vms are power on") - return null - } - - val filterVms = vms.stream().filter { vmName -> - try { - vmName.name.startsWith("bkdevops-$from", true) - } catch (t: Throwable) { - logger.warn("Fail to get the VM names of the vm - $vmName", t) - false - } - }.collect(Collectors.toList()) - return getIdleVM(projectId, preferVMName, from, filterVms, preVMs) - } - - private fun getIdleVM( - projectId: String, - preferVMName: String?, - from: String, - vms: List, - preVMs: List - ): VM? { - val vmNames = if (preferVMName.isNullOrBlank()) { - emptyArray() - } else { - preferVMName!!.split(",".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - } - val privateVMs = getPrivateVMs(projectId) - - if (privateVMs.isNotEmpty()) { - val postVMs = vms.filter { vm -> - var filter = false - run lit@{ - privateVMs.forEach { m -> - if (m.name == vm.name) { - filter = true - return@lit - } - } - } - filter - } - - /** - * 如果设置了 VM 的名称 - */ - if (vmNames.isNotEmpty()) { - val vm = getPreferVMs(postVMs, vmNames, true) - if (vm != null) { - return vm - } - return getPublicVM(vms, vmNames, preVMs) - } else { - val vm = getNonePreferVMs(postVMs, preVMs, true) - if (vm != null) { - return vm - } - return getPublicVM(vms, vmNames, preVMs) - } - } - return getPublicVM(vms, vmNames, preVMs) - } - - private fun getPublicVM(vms: List, preferVMs: Array, preVMs: List): VM? { - if (preferVMs.isNotEmpty()) { - return getPreferVMs(vms, preferVMs, false) - } else { - return getNonePreferVMs(vms, preVMs, false) - } - } - - private fun getNonePreferVMs(vms: List, preVMs: List, includePrivateVM: Boolean): VM? { - val filterVM = mutableListOf() - vms.forEach { - filterVM.add(getVM(it.name, includePrivateVM) ?: return@forEach) - } - - if (filterVM.isEmpty()) { - logger.warn("The filter vm is empty") - return null - } - Collections.shuffle(filterVM) - - preVMs.forEach { p -> - filterVM.forEach { vm -> - if (p == vm.id) { - return vm - } - } - } - return filterVM[0] - } - - private fun getPrivateVMs(projectId: String): Set { - return dslContext.transactionResult { configuration -> - val context = DSL.using(configuration) - val privateRecords = privateVMDao.findVMByProject(context, projectId) - val set = mutableSetOf() - if (privateRecords.isNotEmpty) { - privateRecords.forEach { - set.add(vmDao.parseVM(vmDao.findVMById(context, it.vmId.toLong())) ?: return@forEach) - } - } - set - } - } - - private fun getPreferVMs(vms: List, preferVMs: Array, includePrivateVM: Boolean): VM? { - vms.forEach { - if (preferVMs.contains(it.name)) { - return getVM(it.name, includePrivateVM) ?: return@forEach - } - } - - return null - } - - private fun getVM(vmName: String, includePrivateVM: Boolean): VM? { - val vm = queryVMByName(vmName) - if (vm == null) { - logger.warn("The vm($vmName) is not exist") - return null - } - if (vm.inMaintain) { - return null - } - if (includePrivateVM) { - return vm - } - val typeRecord = vmTypeDao.findVMTypeById(dslContext, vm.typeId) ?: return null - if (typeRecord.typeName != "public") { - logger.warn("The vm(${vm.name}) is not public(${typeRecord.typeName})") - return null - } - return vm - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/VMTypeService.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/VMTypeService.kt deleted file mode 100644 index a07eff93760..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/VMTypeService.kt +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service - -import com.tencent.devops.common.api.constant.CommonMessageCode -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.common.service.utils.MessageCodeUtil -import com.tencent.devops.dispatch.dao.VMTypeDao -import com.tencent.devops.dispatch.pojo.VMType -import org.jooq.DSLContext -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Service - -@Service@Suppress("ALL") -class VMTypeService @Autowired constructor( - private val dslContext: DSLContext, - private val vmTypeDao: VMTypeDao -) { - - fun queryAllVMType(): List { - val types = ArrayList() - val allTypes = vmTypeDao.findAllVMType(dslContext) ?: return types - allTypes.forEach { - val type = vmTypeDao.parseVMType(it) - if (type != null) { - types.add(type) - } - } - return types - } - - fun queryTypeById(typeId: Int): VMType? { - return vmTypeDao.parseVMType(vmTypeDao.findVMTypeById(dslContext, typeId)) - } - - fun createType(typeName: String): Result { - // 判断名字是否重复 - val nameCount = vmTypeDao.countByName(dslContext, typeName) - if (nameCount > 0) { - return MessageCodeUtil.generateResponseDataObject( - CommonMessageCode.PARAMETER_IS_EXIST, - arrayOf(typeName), - false - ) - } - vmTypeDao.createVMType(dslContext, typeName) - return Result(true) - } - - fun updateType(vmType: VMType): Result { - val nameCount = vmTypeDao.countByName(dslContext, vmType.typeName) - if (nameCount > 0) { - val vmTypeObj = vmTypeDao.findVMTypeById(dslContext, vmType.id) - if (null != vmTypeObj && vmTypeObj.typeName != vmType.typeName) { - return MessageCodeUtil.generateResponseDataObject( - CommonMessageCode.PARAMETER_IS_EXIST, - arrayOf(vmType.typeName), - false - ) - } - } - vmTypeDao.updateVMType(dslContext, vmType.id, vmType.typeName) - return Result(true) - } - - fun deleteType(vmTypeId: Int) { - vmTypeDao.deleteVMType(dslContext, vmTypeId) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/PowerOffVM.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/PowerOffVM.kt deleted file mode 100644 index 35e21288cbc..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/PowerOffVM.kt +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service.vm - -import com.tencent.devops.common.web.mq.alert.AlertLevel -import com.tencent.devops.common.web.mq.alert.AlertUtils -import com.vmware.vim25.ManagedObjectReference -import com.vmware.vim25.VirtualMachineSnapshotTree -import com.vmware.vim25.mo.Task -import com.vmware.vim25.mo.VirtualMachine -import com.vmware.vim25.mo.VirtualMachineSnapshot -import org.slf4j.LoggerFactory -import org.springframework.stereotype.Component - -@Component@Suppress("ALL") -class PowerOffVM(private val vmCache: VMCache) { - - fun shutdown(vmId: Long): Boolean { - val vm = vmCache.getVM(vmId) - return if (vm == null) { - logger.error("ShutdownVM: Cannot find vm $vmId") - false - } else { - return shutdownVM(vm) - } - } - - fun shutdown(vmId: Long, snapshotKey: String): Boolean { - // 首先查询该VM名称对应的VM对象 - val vm = vmCache.getVM(vmId) - return if (vm == null) { - logger.error("ShutdownVM: Cannot find vm $vmId") - false - } else { - // 首先从快照树中间删除原来的快照 - // 改成shutdownGuest,要先建快照再关机 - try { - val snapInfo = vm.snapshot - return if (snapInfo == null) { - logger.info("Create the first snapshot for $snapshotKey") - createSnapshot(vm, snapshotKey) && shutdownVM(vm) - } else { - - val snapRootTree = snapInfo.getRootSnapshotList() - // 先找匹配工程的快照 - val snapshot = getMatchedSnapShot(snapRootTree, snapshotKey) - if (snapshot != null) { - // Create the backup snapshot before remove it - logger.info("Backup the snapshot $snapshotKey") - if (!createSnapshot(vm, "$snapshotKey.bak")) { - logger.error("Fail to create the backup snapshot($snapshotKey)") - AlertUtils.doAlert(AlertLevel.HIGH, "DevOps Alert Notify", - "Fail to create the backup snapshot $snapshotKey of vm $vmId") - return false - } - - logger.info("Remove the old snapshot ${snapshot.name}") - if (!removeSnapshot(vm, snapshot.snapshot, vmId)) { - logger.error("ShutdownVM: Remove vm $vmId project $snapshotKey old snapshot fail") - AlertUtils.doAlert(AlertLevel.HIGH, "DevOps Alert Notify", - "Fail to remove the backup snapshot $snapshotKey of vm $vmId") - return false - } - } else { - logger.info("Create the first snapshot for $snapshotKey") - } - val createSuccess = createSnapshot(vm, snapshotKey) - if (createSuccess) { - while (removeBackupSnapshot(vm, "$snapshotKey.bak", vmId)) - return shutdownVM(vm) - } - logger.warn("Fail to create the snapshot $snapshotKey") - return false - } - } catch (e: Exception) { - logger.error("Fail to shutdown vm - $vmId", e) - return false - } - } - } - - private fun removeBackupSnapshot(vm: VirtualMachine, snapshotKey: String, vmId: Long): Boolean { - val snapInfo = vm.snapshot - if (snapInfo == null) { - logger.info("The snapshot is empty") - return false - } - val snapRootTree = snapInfo.getRootSnapshotList() - val snapshot = getMatchedSnapShot(snapRootTree, snapshotKey) - if (snapshot == null) { - logger.info("Fail to get the match backup snapshot $snapshotKey") - return false - } - logger.info("Remove the backup snapshot $snapshotKey") - removeSnapshot(vm, snapshot.snapshot, vmId, false) - return true - } - - /** - * 不处理快照直接关机 - * @param vmId VM名称 - * @return 是否成功 - */ - fun directShutdown(vmId: Long): Boolean { - // 首先查询该VM名称对应的VM对象 - val vm = vmCache.getVM(vmId) - return vm != null && shutdownVM(vm) - } - - private fun removeSnapshot( - vm: VirtualMachine, - snapshot: ManagedObjectReference, - vmId: Long, - removeChild: Boolean = true - ): Boolean { - val task = VirtualMachineSnapshot(vm.serverConnection, snapshot).removeSnapshot_Task(removeChild) - if (task.waitForTask() == Task.SUCCESS) { - return true - } - logger.error("Removing Snapshot for VM - [$vmId] Failure") - AlertUtils.doAlert(AlertLevel.HIGH, "DevOps Alert Notify", - "Fail to remove the snapshot ${snapshot.`val`} of vm $vmId") - return false - } - - private fun createSnapshot(vm: VirtualMachine, snapshotKey: String): Boolean { - val result = vm.createSnapshot_Task( - "p_$snapshotKey", - "", - false, - false).waitForTask() - return result == Task.SUCCESS - } - - private fun getMatchedSnapShot( - tree: Array, - snapshotKey: String - ): VirtualMachineSnapshotTree? { - tree.forEach foreach@{ - val snapshotName = it.getName() - val matched = snapshotName == "p_$snapshotKey" - if (matched) { - return it - } else { - val children = it.getChildSnapshotList() ?: return@foreach - val snap = getMatchedSnapShot(children, snapshotKey) - if (snap != null) { - return snap - } - } - } - return null - } - - private fun shutdownVM(vm: VirtualMachine): Boolean { - try { -// val result = vm.powerOffVM_Task().waitForTask() -// logger.info("Shutting down the vm($result)") -// return result == Task.SUCCESS - vm.shutdownGuest() - } catch (e: Exception) { - logger.error("Fail to shutdown vm - " + vm.name, e) - } - return true - } - - companion object { - private val logger = LoggerFactory.getLogger(PowerOffVM::class.java) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/PowerOnVM.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/PowerOnVM.kt deleted file mode 100644 index 692fce6a7dd..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/PowerOnVM.kt +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service.vm - -import com.tencent.devops.dispatch.service.ProjectSnapshotService -import com.vmware.vim25.VirtualMachinePowerState -import com.vmware.vim25.VirtualMachineSnapshotTree -import com.vmware.vim25.mo.Task -import com.vmware.vim25.mo.VirtualMachineSnapshot -import org.slf4j.LoggerFactory -import org.springframework.stereotype.Component - -@Component@Suppress("ALL") -class PowerOnVM( - private val vmCache: VMCache, - private val projectSnapshotService: ProjectSnapshotService -) { - - fun powerOn(vmId: Long): Boolean { - val vm = vmCache.getVM(vmId) - if (vm == null) { - logger.error("ShutdownVM: Cannot find vm $vmId") - return false - } - val result = vm.powerOnVM_Task(null).waitForTask() - - if (result == Task.SUCCESS) { - return true - } - return false - } - - fun powerOn(projectId: String, vmId: Long, snapshotKey: String): Boolean { - val vm = vmCache.getVM(vmId) - if (vm == null) { - logger.error("PowerOn: Cannot find vm $vmId") - return false - } - - if (vm.runtime?.powerState != VirtualMachinePowerState.poweredOff) { - logger.warn("The vm($vmId) is not power off - ${vm.runtime?.powerState}") - return false - } - - // 首先从快照树中间删除原来的快照 - try { - val snapInfo = vm.snapshot - if (snapInfo == null) { - val result = vm.powerOnVM_Task(null).waitForTask() - - return result == Task.SUCCESS - } - - val snapRootTree = snapInfo.getRootSnapshotList() - - // 先找匹配工程的快照 - val startupSnapshot = projectSnapshotService.getProjectStartupSnapshot(projectId) - var snapshot = getMatchedSnapShot(projectId, snapRootTree, snapshotKey, null) - - if (snapshot == null) { - // Trying to find the back up snap key - snapshot = getMatchedSnapShot(projectId, snapRootTree, "$snapshotKey.bak", null) - if (snapshot == null) { - snapshot = getMatchedSnapShot(projectId, snapRootTree, null, startupSnapshot) - if (snapshot == null && startupSnapshot != null) { - // Try to get the 'init' snapshot - snapshot = getMatchedSnapShot(projectId, snapRootTree, null, null) - } - } else { - logger.info("Get the backup snapshot of $snapshotKey") - } - } - - if (snapshot == null) { - logger.info("Can't find any snapshot") - return vm.powerOnVM_Task(null).waitForTask() == Task.SUCCESS - } - - var result = VirtualMachineSnapshot(vm.serverConnection, - snapshot.snapshot).revertToSnapshot_Task(null).waitForTask() - if (result != Task.SUCCESS) { - return false - } - - result = vm.powerOnVM_Task(null).waitForTask() - - logger.info("Revert the snapshot(${snapshot.name}) and start vm for snapshot($snapshotKey)") - if (result == Task.SUCCESS) { - return true - } - // Wait 10 seconds to check its status is power on - for (i in 1..10) { - logger.warn("Fail revert snapshot and the vm status ${vm.runtime.powerState}") - if (vm.runtime.powerState == VirtualMachinePowerState.poweredOn) { - return true - } - Thread.sleep(1000) - } - } catch (e: Exception) { - logger.warn("Fail to power on vm - $vmId", e) - } - return false - } - - private fun getMatchedSnapShot( - projectId: String, - tree: Array, - snapshotKey: String?, - startupSnapshot: String? - ): VirtualMachineSnapshotTree? { - tree.forEach { - val snapshotName = it.getName() - val matched = when (snapshotKey) { - null -> { - snapshotName == startupSnapshot ?: "init" - } - else -> snapshotName == "p_$snapshotKey" - } - if (matched) { - logger.info("Get the match snapshot($snapshotName) for project($projectId)") - return it - } else { - val children = it.getChildSnapshotList() ?: return@forEach - if (children.isEmpty()) { - return@forEach - } - val snap = getMatchedSnapShot(projectId, children, snapshotKey, startupSnapshot) - if (snap != null) { - return snap - } - } - } - return null - } - - private fun getMatchedSnapShot( - tree: Array, - snapshotKey: String - ): VirtualMachineSnapshotTree? { - tree.forEach foreach@{ - val snapshotName = it.getName() - val matched = snapshotName == "p_$snapshotKey" - if (matched) { - return it - } else { - val children = it.getChildSnapshotList() ?: return@foreach - val snap = getMatchedSnapShot(children, snapshotKey) - if (snap != null) { - return snap - } - } - } - return null - } - - companion object { - private val logger = LoggerFactory.getLogger(PowerOnVM::class.java) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/QueryVMs.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/QueryVMs.kt deleted file mode 100644 index 60237a6cbd5..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/QueryVMs.kt +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service.vm - -import com.tencent.devops.dispatch.dao.MachineDao -import com.tencent.devops.dispatch.utils.VMUtils.getService -import com.tencent.devops.dispatch.utils.VMUtils.invalid -import com.vmware.vim25.VirtualMachinePowerState -import com.vmware.vim25.mo.InventoryNavigator -import com.vmware.vim25.mo.VirtualMachine -import org.jooq.DSLContext -import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Component - -@Component@Suppress("ALL") -class QueryVMs @Autowired constructor( - private val dslContext: DSLContext, - private val machineDao: MachineDao -) { - - fun queryAllPowerOffVM(): Set { - val vms = HashSet() - - val results = machineDao.findAllMachine(dslContext) - if (results.isEmpty()) { - return vms - } - - results.forEach { - val m = machineDao.parseMachine(it) - if (m != null) { - try { - val maxRunningVM = it.maxVmRun - val startEpoch = System.currentTimeMillis() - logger.info("Start to get the vm [${m.name}|${m.id}|${m.ip}]") - val si = getService(m) ?: return@forEach - logger.info("It took ${System.currentTimeMillis() - startEpoch}ms to get the mv [${m.ip}]") - - val allVMS = InventoryNavigator(si.rootFolder) - .searchManagedEntities(VIRTUAL_MACHINE) - var runningVMCnt = 0 - run lit@{ - allVMS.forEach { - if ((it as VirtualMachine).runtime.powerState == VirtualMachinePowerState.poweredOff) { - vms.add(it) - } else { - runningVMCnt++ - if (maxRunningVM in 1..runningVMCnt) { - logger.warn("There are too many running vm($runningVMCnt) " + - "which is more than the setter one($maxRunningVM) of ESX(${m.ip})") - return@lit - } - } - } - } - } catch (t: Throwable) { - logger.warn("Fail to list power off vms of vm($m) because of ${t.message}") - invalid(m) - return@forEach - } - } - } - - return vms - } - - fun queryAllPowerOnVM(): Set { - val vms = HashSet() - - val results = machineDao.findAllMachine(dslContext) - if (results.isEmpty()) { - return vms - } - - results.forEach { - val m = machineDao.parseMachine(it) - if (m != null) { - try { - val si = getService(m) ?: return@forEach - - val allVMS = InventoryNavigator(si.rootFolder) - .searchManagedEntities(VIRTUAL_MACHINE) - allVMS.forEach { - if ((it as VirtualMachine).runtime.powerState == VirtualMachinePowerState.poweredOn) { - vms.add(it) - } - } - } catch (t: Throwable) { - logger.warn("Fail to list power off vms of vm($m) because of ${t.message}") - invalid(m) - return@forEach - } - } - } - - return vms - } - - companion object { - private val logger = LoggerFactory.getLogger(QueryVMs::class.java) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/VMCache.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/VMCache.kt deleted file mode 100644 index 64e19db3b49..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/service/vm/VMCache.kt +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.service.vm - -import com.google.common.cache.CacheBuilder -import com.google.common.cache.CacheLoader -import com.tencent.devops.dispatch.dao.MachineDao -import com.tencent.devops.dispatch.dao.VMDao -import com.tencent.devops.dispatch.pojo.VM -import com.tencent.devops.dispatch.utils.VMUtils.getService -import com.tencent.devops.dispatch.utils.VMUtils.invalid -import com.vmware.vim25.mo.InventoryNavigator -import com.vmware.vim25.mo.VirtualMachine -import org.jooq.DSLContext -import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Component -import java.util.concurrent.ConcurrentHashMap -import java.util.concurrent.TimeUnit - -const val VIRTUAL_MACHINE = "VirtualMachine" -@Component@Suppress("ALL") -class VMCache @Autowired constructor( - private val machineDao: MachineDao, - private val vmDao: VMDao, - private val dslContext: DSLContext -) { - - private val cache = CacheBuilder.newBuilder() - .maximumSize(3000) - .expireAfterWrite(30, TimeUnit.MINUTES) - .build( - object : CacheLoader() { - @Throws(Exception::class) - override fun load(vmId: Long) = queryMachine( - vmDao.parseVM(vmDao.findVMById(dslContext, vmId))) - } - ) - - private val machine2VMMap = ConcurrentHashMap/*vmIds*/>() - - fun getVM(vmId: Long): VirtualMachine? { - return cache.get(vmId) - } - - fun expire(vmId: Long) { - cache.invalidate(vmId) - } - - fun expireByMachineId(machineId: Int) { - val list = machine2VMMap.remove(machineId) - list?.forEach( - { - expire(it) - } - ) - } - - private fun queryMachine(vm: VM?): VirtualMachine? { - return if (vm == null) { - null - } else { - val machine = machineDao.parseMachine(machineDao.findMachineById(dslContext, vm.machineId)) - - return if (machine == null) { - null - } else { - try { - val si = getService(machine) ?: return null - val rootFolder = si.rootFolder - val virtualMachine = InventoryNavigator( - rootFolder).searchManagedEntity(VIRTUAL_MACHINE, vm.name) - if (virtualMachine != null) { - val v = virtualMachine as VirtualMachine - var list = machine2VMMap[vm.machineId] - if (list == null) { - list = ArrayList() - machine2VMMap.put(vm.machineId, list) - } - - list.add(vm.id) - return v - } - - null - } catch (e: Exception) { - logger.warn("Fail to get the vm service($machine)", e) - invalid(machine) - null - } - } - } - } - - companion object { - private val logger = LoggerFactory.getLogger(VMCache::class.java) - } -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/ShutdownVMAfterBuildUtils.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/ShutdownVMAfterBuildUtils.kt deleted file mode 100644 index 2d032791092..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/ShutdownVMAfterBuildUtils.kt +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.utils - -import com.fasterxml.jackson.module.kotlin.readValue -import com.tencent.devops.common.api.util.JsonUtil -import com.tencent.devops.common.redis.RedisOperation -import org.slf4j.LoggerFactory -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Component - -/** - * deng - * 24/01/2018 - */ -@Component@Suppress("ALL") -class ShutdownVMAfterBuildUtils @Autowired constructor(private val redisOperation: RedisOperation) { - private val logger = LoggerFactory.getLogger(ShutdownVMAfterBuildUtils::class.java) - - private val KEY = "dispatch_vm_debug_not_shutdown_after" - - fun shutdown(shutdown: Boolean, pipelineId: String) { - logger.info("Set the pipeline($pipelineId) to ($shutdown)") - val values = redisOperation.get(KEY) - if (values == null) { - if (shutdown) { - logger.info("The pipeline($pipelineId) set the shutdown") - } else { - update(listOf( - ShutdownVM(pipelineId, null) - )) - } - } else { - val shutdownVMs: MutableList = JsonUtil.getObjectMapper().readValue(values) - val iter = shutdownVMs.iterator() - var update = false - while (iter.hasNext()) { - val s = iter.next() - if (s.pipelineId == pipelineId) { - if (shutdown) { - logger.info("Remove the shutdown vm($s)") - iter.remove() - } - update = true - break - } - } - if (update) { - update(shutdownVMs) - } else { - if (shutdown) { - logger.warn("The shutdown($values) is not match the one you set($pipelineId)") - } else { - shutdownVMs.add(ShutdownVM(pipelineId, null)) - update(shutdownVMs) - } - } - } - } - - fun getShutdownVM() = redisOperation.get(KEY) - - fun isShutdown(vmIp: String): Pair { - try { - val values = redisOperation.get(KEY) - if (values.isNullOrBlank()) { - return Pair(true, null) - } - val shutdownVMs: List = JsonUtil.getObjectMapper().readValue(values!!) - shutdownVMs.forEach { s -> - if (s.ip == vmIp) { - logger.info("The vm($vmIp) will not shutdown by pipeline(${s.pipelineId})") - return Pair(false, s.pipelineId) - } - } - } catch (t: Throwable) { - logger.warn("Fail to check if the vm($vmIp) shutdown", t) - } - return Pair(true, null) - } - - fun isShutdown(pipelineId: String, vmIp: String): Boolean { - try { - val values = redisOperation.get(KEY) - if (values.isNullOrBlank()) { - return true - } - val shutdownVMs: List = JsonUtil.getObjectMapper().readValue(values!!) - shutdownVMs.forEach { s -> - if (s.pipelineId == pipelineId) { - s.ip = vmIp - update(shutdownVMs) - logger.warn("The pipeline($pipelineId) of vm($vmIp) is not shutdown after the build") - return false - } - } - return true - } catch (t: Throwable) { - logger.warn("Fail to check if it's shutdown($pipelineId) and ip($vmIp)", t) - return true - } - } - - private fun update(shutdownVMs: List) { - logger.info("Update the shutdown vm($shutdownVMs)") - redisOperation.set(key = KEY, - value = JsonUtil.getObjectMapper().writeValueAsString(shutdownVMs), expired = false) - } - - data class ShutdownVM( - val pipelineId: String, - var ip: String? - ) -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/VMLock.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/VMLock.kt deleted file mode 100644 index 07b64113350..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/VMLock.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.utils - -import com.tencent.devops.common.redis.RedisLock -import com.tencent.devops.common.redis.RedisOperation - -@Suppress("ALL") -class VMLock( - redisOperation: RedisOperation, - vmIp: String -) { - - private val redisLock = RedisLock(redisOperation, "DISPATCH_REDIS_LOCK_VM_$vmIp", 60L) - - fun tryLock() = - redisLock.tryLock() - - fun lock() = redisLock.lock() - - fun unlock() = - redisLock.unlock() -} diff --git a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/VMUtils.kt b/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/VMUtils.kt deleted file mode 100644 index fa5c40ba41f..00000000000 --- a/src/backend/ci/core/dispatch/biz-dispatch/src/main/kotlin/com/tencent/devops/dispatch/utils/VMUtils.kt +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.dispatch.utils - -import com.google.common.cache.CacheBuilder -import com.google.common.cache.CacheLoader -import com.tencent.devops.dispatch.pojo.Machine -import com.vmware.vim25.mo.ServiceInstance -import org.slf4j.LoggerFactory -import java.net.URL -import java.util.concurrent.TimeUnit - -@Suppress("ALL") -object VMUtils { - - private val cache = CacheBuilder.newBuilder() - .maximumSize(100) - .expireAfterWrite(10, TimeUnit.MINUTES) - .build( - object : CacheLoader() { - override fun load(machine: Machine) = _getService(machine) - } - ) - - fun getService(machine: Machine): ServiceInstance? { - return cache.get(machine) - } - - fun invalid(machine: Machine) { - cache.invalidate(machine) - } - - @Synchronized private fun _getService(machine: Machine): ServiceInstance? { - try { - return ServiceInstance(URL("https://${machine.ip}/sdk"), - machine.username, - machine.password, true) - } catch (e: Exception) { - logger.warn("Fail to connect to ${machine.ip} with username(${machine.username}/${machine.password})", - e) - } - return null - } - private val logger = LoggerFactory.getLogger(VMUtils::class.java) -} diff --git a/src/backend/ci/core/environment/api-environment/src/main/kotlin/com/tencent/devops/environment/api/thirdPartyAgent/ExternalThirdPartyAgentResource.kt b/src/backend/ci/core/environment/api-environment/src/main/kotlin/com/tencent/devops/environment/api/thirdPartyAgent/ExternalThirdPartyAgentResource.kt index 0f884dd92de..853cc5b50d4 100644 --- a/src/backend/ci/core/environment/api-environment/src/main/kotlin/com/tencent/devops/environment/api/thirdPartyAgent/ExternalThirdPartyAgentResource.kt +++ b/src/backend/ci/core/environment/api-environment/src/main/kotlin/com/tencent/devops/environment/api/thirdPartyAgent/ExternalThirdPartyAgentResource.kt @@ -68,7 +68,10 @@ interface ExternalThirdPartyAgentResource { agentId: String, @ApiParam("本地eTag标签", required = false) @QueryParam("eTag") - eTag: String? + eTag: String?, + @ApiParam("本地操作系统架构", required = false) + @QueryParam("arch") + arch: String? ): Response @ApiOperation("下载JRE") @@ -82,7 +85,10 @@ interface ExternalThirdPartyAgentResource { agentId: String, @ApiParam("本地eTag标签", required = false) @QueryParam("eTag") - eTag: String? + eTag: String?, + @ApiParam("本地操作系统架构", required = false) + @QueryParam("arch") + arch: String? ): Response @ApiOperation("生成并下载新的批次安装所需要的文件") diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CoverityProjectType.kt b/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/model/AgentArchType.kt similarity index 91% rename from src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CoverityProjectType.kt rename to src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/model/AgentArchType.kt index ec15b7b3f03..edcbe76c45f 100644 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CoverityProjectType.kt +++ b/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/model/AgentArchType.kt @@ -25,10 +25,9 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.tencent.devops.plugin.codecc.pojo.coverity +package com.tencent.devops.environment.model -enum class CoverityProjectType { - COMPILE, - UN_COMPILE, - COMBINE +enum class AgentArchType(val arch: String) { + ARM64("arm64"), + MIPS64("mips64") } diff --git a/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/resources/thirdPartyAgent/ExternalThirdPartyAgentResourceImpl.kt b/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/resources/thirdPartyAgent/ExternalThirdPartyAgentResourceImpl.kt index 5f5454beed7..07fcff7a0fd 100644 --- a/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/resources/thirdPartyAgent/ExternalThirdPartyAgentResourceImpl.kt +++ b/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/resources/thirdPartyAgent/ExternalThirdPartyAgentResourceImpl.kt @@ -29,6 +29,7 @@ package com.tencent.devops.environment.resources.thirdPartyAgent import com.tencent.devops.common.web.RestResource import com.tencent.devops.environment.api.thirdPartyAgent.ExternalThirdPartyAgentResource +import com.tencent.devops.environment.model.AgentArchType import com.tencent.devops.environment.service.thirdPartyAgent.DownloadAgentInstallService import com.tencent.devops.environment.service.thirdPartyAgent.ImportService import org.springframework.beans.factory.annotation.Autowired @@ -42,11 +43,24 @@ class ExternalThirdPartyAgentResourceImpl @Autowired constructor( override fun downloadAgentInstallScript(agentId: String) = downloadAgentInstallService.downloadInstallScript(agentId) - override fun downloadAgent(agentId: String, eTag: String?) = - downloadAgentInstallService.downloadAgent(agentId) + override fun downloadAgent(agentId: String, eTag: String?, arch: String?) = + downloadAgentInstallService.downloadAgent( + agentId = agentId, + arch = when (arch) { + "arm64" -> AgentArchType.ARM64 + "mips64" -> AgentArchType.MIPS64 + else -> null + } + ) - override fun downloadJRE(agentId: String, eTag: String?) = - downloadAgentInstallService.downloadJre(agentId, eTag) + override fun downloadJRE(agentId: String, eTag: String?, arch: String?) = + downloadAgentInstallService.downloadJre( + agentId, eTag, arch = when (arch) { + "arm64" -> AgentArchType.ARM64 + "mips64" -> AgentArchType.MIPS64 + else -> null + } + ) override fun downloadNewInstallAgentBatchFile(agentHashId: String): Response { val newAgentId = importService.generateAgentByOtherAgentId(agentHashId) diff --git a/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/service/thirdPartyAgent/DownloadAgentInstallService.kt b/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/service/thirdPartyAgent/DownloadAgentInstallService.kt index 199e6d94b50..d5f815f9ef5 100644 --- a/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/service/thirdPartyAgent/DownloadAgentInstallService.kt +++ b/src/backend/ci/core/environment/biz-environment/src/main/kotlin/com/tencent/devops/environment/service/thirdPartyAgent/DownloadAgentInstallService.kt @@ -32,6 +32,7 @@ import com.tencent.devops.common.api.util.HashUtil import com.tencent.devops.common.api.util.SecurityUtil import com.tencent.devops.common.service.Profile import com.tencent.devops.environment.dao.thirdPartyAgent.ThirdPartyAgentDao +import com.tencent.devops.environment.model.AgentArchType import com.tencent.devops.environment.service.AgentUrlService import com.tencent.devops.environment.utils.FileMD5CacheUtils.getFileMD5 import com.tencent.devops.model.environment.tables.records.TEnvironmentThirdpartyAgentRecord @@ -110,14 +111,14 @@ class DownloadAgentInstallService @Autowired constructor( .build() } - fun downloadGoAgent(agentId: String, record: TEnvironmentThirdpartyAgentRecord): Response { - logger.info("Trying to download the agent($agentId)") + fun downloadGoAgent(agentId: String, record: TEnvironmentThirdpartyAgentRecord, arch: AgentArchType?): Response { + logger.info("Trying to download the agent($agentId) arch($arch)") - val jarFiles = getGoAgentJarFiles(record.os) - val goDaemonFile = getGoFile(record.os, "devopsDaemon") - val goAgentFile = getGoFile(record.os, "devopsAgent") - val goInstallerFile = getGoFile(record.os, "installer") - val goUpgraderFile = getGoFile(record.os, "upgrader") + val jarFiles = getGoAgentJarFiles(record.os, arch) + val goDaemonFile = getGoFile(record.os, "devopsDaemon", arch) + val goAgentFile = getGoFile(record.os, "devopsAgent", arch) + val goInstallerFile = getGoFile(record.os, "installer", arch) + val goUpgraderFile = getGoFile(record.os, "upgrader", arch) val packageFiles = getAgentPackageFiles(record.os) val scriptFiles = getGoAgentScriptFiles(record) val propertyFile = getPropertyFile(record) @@ -185,25 +186,30 @@ class DownloadAgentInstallService @Autowired constructor( zipOut.closeArchiveEntry() } - fun downloadAgent(agentId: String): Response { + fun downloadAgent(agentId: String, arch: AgentArchType?): Response { val agentRecord = getAgentRecord(agentId) - return downloadGoAgent(agentId, agentRecord) + return downloadGoAgent(agentId, agentRecord, arch) } private fun getAgentPackageFiles(os: String) = File(agentPackage, "packages/${os.toLowerCase()}/").listFiles() - private fun getGoAgentJarFiles(os: String): List { + private fun getGoAgentJarFiles(os: String, arch: AgentArchType?): List { val agentJar = getAgentJarFile() - val jreFile = getJreZipFile(os) + val jreFile = getJreZipFile(os, arch) return listOf(agentJar, jreFile) } - private fun getGoFile(os: String, fileName: String): File { + private fun getGoFile(os: String, fileName: String, arch: AgentArchType?): File { + val archStr = if (arch == null) { + "" + } else { + "_${arch.arch}" + } val daemonFileName = when (os) { OS.WINDOWS.name -> "upgrade/$fileName.exe" - OS.MACOS.name -> "upgrade/${fileName}_macos" - else -> "upgrade/${fileName}_linux" + OS.MACOS.name -> "upgrade/${fileName}_macos$archStr" + else -> "upgrade/${fileName}_linux$archStr" } val daemonFile = File(agentPackage, daemonFileName) if (!daemonFile.exists()) { @@ -233,10 +239,10 @@ class DownloadAgentInstallService @Autowired constructor( } ?: emptyMap() } - fun downloadJre(agentId: String, eTag: String?): Response { + fun downloadJre(agentId: String, eTag: String?, arch: AgentArchType?): Response { logger.info("downloadJre, agentId: $agentId, eTag: $eTag") val record = getAgentRecord(agentId) - val file = getJreZipFile(record.os) + val file = getJreZipFile(record.os, arch) if (!eTag.isNullOrBlank()) { if (eTag == getFileMD5(file)) { @@ -284,8 +290,13 @@ class DownloadAgentInstallService @Autowired constructor( return agentJar } - fun getJreZipFile(os: String): File { - val file = File(agentPackage, "/jre/${os.toLowerCase()}/jre.zip") + fun getJreZipFile(os: String, arch: AgentArchType?): File { + val archStr = if (arch == null) { + "" + } else { + "_${arch.arch}" + } + val file = File(agentPackage, "/jre/${os.toLowerCase()}$archStr/jre.zip") if (!file.exists()) { logger.warn("The jre file(${file.absolutePath}) is not exist") throw FileNotFoundException("The jre file is not exist") diff --git a/src/backend/ci/core/log/biz-log/src/main/kotlin/com/tencent/devops/log/service/impl/LogServiceESImpl.kt b/src/backend/ci/core/log/biz-log/src/main/kotlin/com/tencent/devops/log/service/impl/LogServiceESImpl.kt index 6e45f38ca27..5c777eb4fdf 100644 --- a/src/backend/ci/core/log/biz-log/src/main/kotlin/com/tencent/devops/log/service/impl/LogServiceESImpl.kt +++ b/src/backend/ci/core/log/biz-log/src/main/kotlin/com/tencent/devops/log/service/impl/LogServiceESImpl.kt @@ -62,7 +62,7 @@ import org.elasticsearch.client.RequestOptions import org.elasticsearch.client.core.CountRequest import org.elasticsearch.client.indices.CreateIndexRequest import org.elasticsearch.client.indices.GetIndexRequest -import org.elasticsearch.common.unit.TimeValue +import org.elasticsearch.core.TimeValue import org.elasticsearch.index.query.BoolQueryBuilder import org.elasticsearch.index.query.Operator import org.elasticsearch.index.query.QueryBuilders diff --git a/src/backend/ci/core/log/biz-log/src/main/kotlin/com/tencent/devops/log/util/ESIndexUtils.kt b/src/backend/ci/core/log/biz-log/src/main/kotlin/com/tencent/devops/log/util/ESIndexUtils.kt index 78a573a6d50..f44f61207ff 100644 --- a/src/backend/ci/core/log/biz-log/src/main/kotlin/com/tencent/devops/log/util/ESIndexUtils.kt +++ b/src/backend/ci/core/log/biz-log/src/main/kotlin/com/tencent/devops/log/util/ESIndexUtils.kt @@ -29,8 +29,8 @@ package com.tencent.devops.log.util import com.tencent.devops.common.log.pojo.message.LogMessageWithLineNo import org.elasticsearch.common.settings.Settings -import org.elasticsearch.common.xcontent.XContentBuilder -import org.elasticsearch.common.xcontent.XContentFactory +import org.elasticsearch.xcontent.XContentBuilder +import org.elasticsearch.xcontent.XContentFactory object ESIndexUtils { diff --git a/src/backend/ci/core/openapi/api-openapi/build.gradle.kts b/src/backend/ci/core/openapi/api-openapi/build.gradle.kts index fe4d559d5a0..9c2f0ff16e2 100644 --- a/src/backend/ci/core/openapi/api-openapi/build.gradle.kts +++ b/src/backend/ci/core/openapi/api-openapi/build.gradle.kts @@ -30,7 +30,7 @@ dependencies { api(project(":core:common:common-web")) api(project(":core:common:common-util")) api(project(":core:quality:api-quality")) - api(project(":core:plugin:codecc-plugin:common-codecc")) + api(project(":core:common:common-archive")) api(project(":core:common:common-auth:common-auth-api")) api(project(":core:store:api-store")) api(project(":core:auth:api-auth")) diff --git a/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/api/apigw/v4/ApigwTemplateInstanceResourceV4.kt b/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/api/apigw/v4/ApigwTemplateInstanceResourceV4.kt index dbf210f815e..d44ece137a8 100644 --- a/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/api/apigw/v4/ApigwTemplateInstanceResourceV4.kt +++ b/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/api/apigw/v4/ApigwTemplateInstanceResourceV4.kt @@ -116,6 +116,35 @@ interface ApigwTemplateInstanceResourceV4 { instances: List ): TemplateOperationRet + @ApiOperation("批量更新流水线模板实例", tags = ["v4_user_templateInstance_update", "v4_app_templateInstance_update"]) + @PUT + @Path("/update") + fun updateTemplateInstances( + @ApiParam(value = "appCode", required = true, defaultValue = AUTH_HEADER_DEVOPS_APP_CODE_DEFAULT_VALUE) + @HeaderParam(AUTH_HEADER_DEVOPS_APP_CODE) + appCode: String?, + @ApiParam(value = "apigw Type", required = true) + @PathParam("apigwType") + apigwType: String?, + @ApiParam(value = "用户ID", required = true, defaultValue = AUTH_HEADER_USER_ID_DEFAULT_VALUE) + @HeaderParam(AUTH_HEADER_USER_ID) + userId: String, + @ApiParam("项目ID", required = true) + @PathParam("projectId") + projectId: String, + @ApiParam("模板ID", required = true) + @QueryParam("templateId") + templateId: String, + @ApiParam("版本名", required = true) + @QueryParam("versionName") + versionName: String, + @ApiParam("是否应用模板设置") + @QueryParam("useTemplateSettings") + useTemplateSettings: Boolean, + @ApiParam("模板实例", required = true) + instances: List + ): TemplateOperationRet + @ApiOperation("获取流水线模板的实例列表", tags = ["v4_app_templateInstance_get", "v4_user_templateInstance_get"]) @GET @Path("/") diff --git a/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/BuildElementData.kt b/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/BuildElementData.kt deleted file mode 100644 index 127cd65070e..00000000000 --- a/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/BuildElementData.kt +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.openapi.pojo.external.measure - -import io.swagger.annotations.ApiModel -import io.swagger.annotations.ApiModelProperty - -@ApiModel("度量数据-原子数据") -data class BuildElementData( - @ApiModelProperty("原子id", required = true) - val id: String = "", - @ApiModelProperty("原子名称", required = true) - val name: String = "", - @ApiModelProperty("工程ID", required = true) - val projectId: String = "", - @ApiModelProperty("流水线ID", required = true) - val pipelineId: String = "", - @ApiModelProperty("构建ID", required = true) - val buildId: String = "", - @ApiModelProperty("原子构建结果", required = true) - val status: String = "", - @ApiModelProperty("原子构建启动时间", required = true) - val beginTime: Long = 0, - @ApiModelProperty("结束时间", required = true) - val endTime: Long = 0, - @ApiModelProperty("Element type", required = true) - val type: String = "", - @ApiModelProperty("原子节点分类", required = false) - val category: String = "", - @ApiModelProperty("atomCode", required = false) - val atomCode: String = "", - @ApiModelProperty("templateId", required = false) - val templateId: String? = "", - @ApiModelProperty("错误类型", required = false) - val errorType: String? = null, - @ApiModelProperty("错误码标识", required = false) - val errorCode: Int? = null, - @ApiModelProperty("错误信息描述", required = false) - val errorMsg: String? = null -) diff --git a/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/PipelineBuildResponseData.kt b/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/PipelineBuildResponseData.kt deleted file mode 100644 index 9f00ed063a4..00000000000 --- a/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/PipelineBuildResponseData.kt +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.openapi.pojo.external.measure - -import com.tencent.devops.plugin.codecc.pojo.CodeccCallback -import com.tencent.devops.common.quality.pojo.QualityRuleIntercept -import io.swagger.annotations.ApiModel -import io.swagger.annotations.ApiModelProperty - -@ApiModel("流水线构建查询接口响应数据") -data class PipelineBuildResponseData( - @ApiModelProperty("流水线对应的项目id") - val projectId: String = "", - @ApiModelProperty("projectCode") - val projectCode: String = "", - @ApiModelProperty("bgName") - val bgName: String = "", - @ApiModelProperty("centerName") - val centerName: String = "", - @ApiModelProperty("deptName") - val deptName: String = "", - @ApiModelProperty("流水线的id") - val pipelineId: String = "", - @ApiModelProperty("流水线的名称") - val pipelineName: String = "", - @ApiModelProperty("构建版本号") - val buildNum: Int = 0, - @ApiModelProperty("流水线的这次构建的id") - val buildId: String = "", - @ApiModelProperty("流水线的启动时间") - val beginTime: Long = 0, - @ApiModelProperty("流水线的结束时间") - val endTime: Long = 0, - @ApiModelProperty("流水线的启动方式") - val startType: String = "", - @ApiModelProperty("流水线的启动用户") - val buildUser: String = "", - @ApiModelProperty("流水线的是否并行") - val isParallel: Boolean = false, - @ApiModelProperty("流水线的构建结果") - val buildResult: String = "", - @ApiModelProperty("流水线Element结构") - val elements: List = emptyList(), - @ApiModelProperty("Codecc报告") - val codeccReport: CodeccCallback? = null, - @ApiModelProperty("质量红线数据", required = false) - var qualityData: List? = null, - @ApiModelProperty("是否 PCG 公共构件资源") - val dispatchTypeContainsPcg: Boolean = false, - @ApiModelProperty("templateId", required = false) - val templateId: String? = "", - @ApiModelProperty("model", required = false) - val model: String? = "", - @ApiModelProperty("插件错误信息", required = false) - val errorInfoList: String? = null -) diff --git a/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/ServiceMeasureResource.kt b/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/ServiceMeasureResource.kt deleted file mode 100644 index 9626008ca92..00000000000 --- a/src/backend/ci/core/openapi/api-openapi/src/main/kotlin/com/tencent/devops/openapi/pojo/external/measure/ServiceMeasureResource.kt +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -package com.tencent.devops.openapi.pojo.external.measure - -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_ORGANIZATION_ID -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_ORGANIZATION_TYPE -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_USER_ID -import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_USER_ID_DEFAULT_VALUE -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.openapi.pojo.BuildStatisticsResponse -import io.swagger.annotations.Api -import io.swagger.annotations.ApiOperation -import io.swagger.annotations.ApiParam -import javax.ws.rs.Consumes -import javax.ws.rs.DefaultValue -import javax.ws.rs.GET -import javax.ws.rs.HeaderParam -import javax.ws.rs.Path -import javax.ws.rs.Produces -import javax.ws.rs.QueryParam -import javax.ws.rs.core.MediaType - -@Api(tags = ["SERVICE_MEASURE"], description = "服务-度量资源") -@Path("/service") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -@Suppress("ALL") -interface ServiceMeasureResource { - - @ApiOperation("流水线构建查询接口,含详情与质量红线信息") - @GET - @Path("/pipeline/builds") - fun getBuildList( - @ApiParam(value = "用户ID", required = true, defaultValue = AUTH_HEADER_DEVOPS_USER_ID_DEFAULT_VALUE) - @HeaderParam(AUTH_HEADER_DEVOPS_USER_ID) - userId: String, - @ApiParam(value = "开始时间(时间戳形式)", required = true) - @QueryParam(value = "beginDate") - beginDate: Long, - @ApiParam(value = "结束时间(时间戳形式)", required = true) - @QueryParam(value = "endDate") - endDate: Long, - @ApiParam(value = "事业群ID", required = true) - @QueryParam(value = "bgId") - bgId: String, - @ApiParam(value = "偏移量", required = true, defaultValue = "0") - @QueryParam(value = "offset") - @DefaultValue("0") - offset: Int = 0, - @ApiParam(value = "查询数量", required = true, defaultValue = "10") - @QueryParam(value = "limit") - @DefaultValue("10") - limit: Int = 10 - ): Result> - - @ApiOperation("获取流水线构建结果统计数据") - @GET - @Path("/pipelines/builds/statistics") - fun buildStatistics( - @ApiParam(value = "用户ID", required = true, defaultValue = AUTH_HEADER_DEVOPS_USER_ID_DEFAULT_VALUE) - @HeaderParam(AUTH_HEADER_DEVOPS_USER_ID) - userId: String, - @ApiParam(value = "组织类型", required = true) - @HeaderParam(AUTH_HEADER_DEVOPS_ORGANIZATION_TYPE) - organizationType: String, - @ApiParam(value = "组织ID", required = true) - @HeaderParam(AUTH_HEADER_DEVOPS_ORGANIZATION_ID) - organizationId: Int, - @ApiParam("部门名称", required = false, defaultValue = "") - @QueryParam("deptName") - deptName: String? = "", - @ApiParam("中心名称", required = false, defaultValue = "") - @QueryParam("centerName") - centerName: String? = "", - @ApiParam("起始时间", required = false, defaultValue = "") - @QueryParam("beginTime") - beginTime: String? = "", - @ApiParam("截止时间", required = false, defaultValue = "") - @QueryParam("endTime") - endTime: String? = "", - @ApiParam("类型(ALL/CONTAINS_SCRIPT/CONTAINS_CODECC)", required = false, defaultValue = "ALL") - @QueryParam("type") - type: String? = "" - ): Result -} diff --git a/src/backend/ci/core/openapi/biz-openapi/src/main/kotlin/com/tencent/devops/openapi/resources/apigw/v4/ApigwTemplateInstanceResourceV4Impl.kt b/src/backend/ci/core/openapi/biz-openapi/src/main/kotlin/com/tencent/devops/openapi/resources/apigw/v4/ApigwTemplateInstanceResourceV4Impl.kt index 91b0452c025..194660ac9c6 100644 --- a/src/backend/ci/core/openapi/biz-openapi/src/main/kotlin/com/tencent/devops/openapi/resources/apigw/v4/ApigwTemplateInstanceResourceV4Impl.kt +++ b/src/backend/ci/core/openapi/biz-openapi/src/main/kotlin/com/tencent/devops/openapi/resources/apigw/v4/ApigwTemplateInstanceResourceV4Impl.kt @@ -84,6 +84,26 @@ class ApigwTemplateInstanceResourceV4Impl @Autowired constructor(private val cli ) } + override fun updateTemplateInstances( + appCode: String?, + apigwType: String?, + userId: String, + projectId: String, + templateId: String, + versionName: String, + useTemplateSettings: Boolean, + instances: List + ): TemplateOperationRet { + return client.get(ServiceTemplateInstanceResource::class).updateTemplate( + userId = userId, + projectId = projectId, + templateId = templateId, + versionName = versionName, + useTemplateSettings = useTemplateSettings, + instances = instances + ) + } + override fun listTemplateInstances( appCode: String?, apigwType: String?, diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/agent/LinuxCodeCCScriptElement.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/agent/LinuxCodeCCScriptElement.kt deleted file mode 100644 index b88c4dbc206..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/agent/LinuxCodeCCScriptElement.kt +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.common.pipeline.pojo.element.agent - -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.common.pipeline.pojo.element.Element -import com.tencent.devops.plugin.codecc.pojo.coverity.ProjectLanguage -import io.swagger.annotations.ApiModel -import io.swagger.annotations.ApiModelProperty - -@ApiModel("CodeCC代码检查任务(service端)", description = LinuxScriptElement.classType) -open class LinuxCodeCCScriptElement( - @ApiModelProperty("任务名称", required = true) - override var name: String = "执行Linux脚本", - @ApiModelProperty("id", required = false) - override var id: String? = null, - @ApiModelProperty("状态", required = false) - override var status: String? = null, - @ApiModelProperty("脚本类型", required = true) - open var scriptType: BuildScriptType = BuildScriptType.SHELL, - @ApiModelProperty("脚本内容", required = true) - open var script: String = "", - @ApiModelProperty("CodeCC Task Name", required = false, hidden = true) - open var codeCCTaskName: String? = null, - @ApiModelProperty("CodeCC Task CN Name", required = false, hidden = true) - open var codeCCTaskCnName: String? = null, - @ApiModelProperty("工程语言", required = true) - open var languages: List = listOf(), - @ApiModelProperty("是否异步", required = false) - open var asynchronous: Boolean? = false, - @ApiModelProperty("扫描类型(0:全量, 1:增量)", required = false) - open var scanType: String? = "", - @ApiModelProperty("代码存放路径", required = false) - open var path: String? = null, - @ApiModelProperty("codecc原子执行环境,例如WINDOWS,LINUX,MACOS等", required = true) - var compilePlat: String? = null, - @ApiModelProperty( - "JSONArray格式的字符串\n" + - "eg:\"[\"COVERITY\",\"CPPLINT\",\"PYLINT\",\"TSCLUA\",\"CCN\",\"DUPC\",\"ESLINT\",\"GOML\"" + - ",\"KLOCWORK\"]\",其中\n COVERITY:Coverity工具\n" + - "CPPLINT:cpplint工具\n" + - "PYLINT:pylint工具\n" + - "TSCLUA:TSCLUA工具\n" + - "CCN:圈复杂度工具\n" + - "DUPC:重复率工具\n" + - "GOML:go语言检查工具\n" + - "KLOCWORK:KLOCWORK工具\n" + - "CHECKSTYLE: CHECKSTYLE工具" + - "STYLECOP: STYLECOP工具", required = true - ) - var tools: List? = null, - @ApiModelProperty( - "非必填,当tools列表中有PYLINT时必填;值类型有且仅有两种:“py2”、“py3”,\n" + - "其中“py2”表示使用python2版本,“py3”表示使用python3版本", required = false - ) - var pyVersion: String? = null, - @ApiModelProperty("eslint项目框架, React, Vue, Other", required = false) - var eslintRc: String? = null, - @ApiModelProperty("PHP标准", required = false) - var phpcsStandard: String? = null, - @ApiModelProperty("go语言WORKSPACE下相对路径", required = false) - var goPath: String? = null, - @ApiModelProperty("spotbugs相关参数", required = false) - var projectBuildType: String? = null, - @ApiModelProperty("spotbugs相关参数", required = false) - var projectBuildCommand: String? = null, - @ApiModelProperty("圈复杂度阈值", required = false) - var ccnThreshold: String? = null, - @ApiModelProperty("是否隐藏代码内容,字符串的false和true", required = false) - var needCodeContent: String? = null, - var coverityToolSetId: String? = null, - var klocworkToolSetId: String? = null, - var cpplintToolSetId: String? = null, - var eslintToolSetId: String? = null, - var pylintToolSetId: String? = null, - var gometalinterToolSetId: String? = null, - var checkStyleToolSetId: String? = null, - var styleCopToolSetId: String? = null, - var detektToolSetId: String? = null, - var phpcsToolSetId: String? = null, - var sensitiveToolSetId: String? = null, - var occheckToolSetId: String? = null, - var gociLintToolSetId: String? = null, - var woodpeckerToolSetId: String? = null, - var horuspyToolSetId: String? = null, - var pinpointToolSetId: String? = null -) : Element(name, id, status) { - - companion object { - const val classType = "linuxCodeCCScript" - } - - override fun getClassType() = classType - - constructor(): this( - name = "", - id = "", - status = "", - scriptType = BuildScriptType.SHELL, - script = "", - codeCCTaskName = "", - codeCCTaskCnName = "", - languages = listOf(), - asynchronous = true, - scanType = "", - path = "", - compilePlat = "", - tools = listOf(), - pyVersion = null, - eslintRc = null, - phpcsStandard = null, - goPath = null, - projectBuildType = null, - projectBuildCommand = null, - ccnThreshold = null, - needCodeContent = null, - coverityToolSetId = null, - klocworkToolSetId = null, - cpplintToolSetId = null, - eslintToolSetId = null, - pylintToolSetId = null, - gometalinterToolSetId = null, - checkStyleToolSetId = null, - styleCopToolSetId = null, - detektToolSetId = null, - phpcsToolSetId = null, - sensitiveToolSetId = null, - occheckToolSetId = null, - gociLintToolSetId = null, - woodpeckerToolSetId = null, - horuspyToolSetId = null - ) -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/agent/LinuxPaasCodeCCScriptElement.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/agent/LinuxPaasCodeCCScriptElement.kt deleted file mode 100644 index f259df6c781..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/agent/LinuxPaasCodeCCScriptElement.kt +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.common.pipeline.pojo.element.agent - -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.plugin.codecc.pojo.coverity.ProjectLanguage -import io.swagger.annotations.ApiModel -import io.swagger.annotations.ApiModelProperty - -@ApiModel("CodeCC代码检查任务", description = LinuxPaasCodeCCScriptElement.classType) -data class LinuxPaasCodeCCScriptElement( - @ApiModelProperty("任务名称", required = true) - override var name: String = "执行Linux脚本", - @ApiModelProperty("id", required = false) - override var id: String? = null, - @ApiModelProperty("状态", required = false) - override var status: String? = null, - @ApiModelProperty("脚本类型", required = true) - override var scriptType: BuildScriptType = BuildScriptType.SHELL, - @ApiModelProperty("脚本内容", required = true) - override var script: String = "", - @ApiModelProperty("CodeCC Task Name", required = false, hidden = true) - override var codeCCTaskName: String? = null, - @ApiModelProperty("CodeCC Task CN Name", required = false, hidden = true) - override var codeCCTaskCnName: String? = null, - @ApiModelProperty("CodeCC Task Id", required = false, hidden = true) - var codeCCTaskId: String? = null, - @ApiModelProperty("是否异步", required = false) - override var asynchronous: Boolean? = false, - @ApiModelProperty("扫描类型(0:全量, 1:增量)", required = false) - override var scanType: String? = null, - @ApiModelProperty("代码存放路径", required = false) - override var path: String? = null, - @ApiModelProperty("工程语言", required = true) - override var languages: List = listOf() -) : LinuxCodeCCScriptElement( - name, - id, - status, - scriptType, - script, - codeCCTaskName, - codeCCTaskCnName, - languages, - asynchronous, - scanType, - path -) { - - companion object { - const val classType = "linuxPaasCodeCCScript" - } - - override fun cleanUp() { - codeCCTaskId = null - codeCCTaskName = null - } - - override fun getClassType() = - classType - - constructor(): this( - name = "", - id = "", - status = null, - scriptType = BuildScriptType.SHELL, - script = "", - codeCCTaskName = "", - codeCCTaskCnName = "", - codeCCTaskId = "", - asynchronous = true, - scanType = "", - path = "", - languages = listOf() - ) -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeCCAutoConfiguration.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeCCAutoConfiguration.kt index 004e0c94d6e..be204ee186f 100644 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeCCAutoConfiguration.kt +++ b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeCCAutoConfiguration.kt @@ -28,8 +28,6 @@ package com.tencent.devops.plugin.codecc import com.tencent.devops.plugin.codecc.config.CodeccConfig -import com.tencent.devops.plugin.codecc.element.LinuxCodeCCScriptElementBizPlugin -import com.tencent.devops.plugin.codecc.element.LinuxPaasCodeCCScriptElementBizPlugin import org.springframework.boot.autoconfigure.AutoConfigureOrder import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -46,20 +44,7 @@ class CodeCCAutoConfiguration { fun coverityApi(codeccConfig: CodeccConfig): CodeccApi { return CodeccApi( codeccApiUrl = codeccConfig.codeccApiGateWay, - codeccApiProxyUrl = codeccConfig.codeccApiProxyGateWay, - createPath = codeccConfig.createPath, - deletePath = codeccConfig.deletePath, - updatePath = codeccConfig.updatePath, - existPath = codeccConfig.existPath, - report = codeccConfig.report, - getRuleSetsPath = codeccConfig.getRuleSetsPath + codeccApiProxyUrl = codeccConfig.codeccApiProxyGateWay ) } - - @Bean - fun linuxCodeCCScriptElementBizPlugin() = LinuxCodeCCScriptElementBizPlugin() - - @Bean - fun linuxPaasCodeCCScriptElementBizPlugin(coverityApi: CodeccApi) = - LinuxPaasCodeCCScriptElementBizPlugin(coverityApi) } diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccApi.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccApi.kt index 78fdb12eae6..736793ecd1b 100644 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccApi.kt +++ b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccApi.kt @@ -31,17 +31,10 @@ import com.fasterxml.jackson.module.kotlin.readValue import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_PROJECT_ID import com.tencent.devops.common.api.auth.AUTH_HEADER_DEVOPS_USER_ID import com.tencent.devops.common.api.exception.RemoteServiceException -import com.tencent.devops.common.api.exception.TaskExecuteException -import com.tencent.devops.common.api.pojo.ErrorCode -import com.tencent.devops.common.api.pojo.ErrorType import com.tencent.devops.common.api.pojo.Result import com.tencent.devops.common.api.util.JsonUtil import com.tencent.devops.common.api.util.OkhttpUtils -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement import com.tencent.devops.plugin.codecc.pojo.CodeccMeasureInfo -import com.tencent.devops.plugin.codecc.pojo.coverity.CodeccReport -import com.tencent.devops.plugin.codecc.pojo.coverity.CoverityResult import okhttp3.MediaType import okhttp3.Request import okhttp3.RequestBody @@ -52,148 +45,16 @@ import javax.ws.rs.HttpMethod @Suppress("ALL") open class CodeccApi constructor( private val codeccApiUrl: String, - private val codeccApiProxyUrl: String, - private val createPath: String = "/ms/task/api/service/task", - private val updatePath: String = "/ms/task/api/service/task", - private val existPath: String = "/ms/task/api/service/task/exists", - private val deletePath: String = "/ms/task/api/service/task", - private val report: String = "/api", - private val getRuleSetsPath: String = "/ms/defect/api/service/checker/tools/{toolName}/pipelineCheckerSets" + private val codeccApiProxyUrl: String ) { companion object { private val objectMapper = JsonUtil.getObjectMapper() private val logger = LoggerFactory.getLogger(CodeccApi::class.java) - private const val USER_NAME_HEADER = "X-DEVOPS-UID" - private const val DEVOPS_PROJECT_ID = "X-DEVOPS-PROJECT-ID" - private const val DEVOPS_TASK_ID = "X-DEVOPS-TASK-ID" - private const val COMMIT_ID = "commitId" private const val CONTENT_TYPE = "Content-Type" private const val CONTENT_TYPE_JSON = "application/json" } - open fun createTask( - projectId: String, - pipelineId: String, - pipelineName: String, - rtx: String, - element: LinuxCodeCCScriptElement - ): CoverityResult { - with(element) { - if (tools == null || tools!!.isEmpty() || languages.isEmpty()) return CoverityResult() - val devopsToolParams = mutableListOf() - devopsToolParams.addAll( - listOf( - DevOpsToolParams("compilePlat", compilePlat ?: "LINUX"), - DevOpsToolParams("scan_type", scanType ?: "1"), - DevOpsToolParams("phpcs_standard", phpcsStandard ?: ""), - DevOpsToolParams("go_path", goPath ?: ""), - DevOpsToolParams("py_version", pyVersion ?: ""), - DevOpsToolParams("ccn_threshold", ccnThreshold ?: ""), - DevOpsToolParams("needCodeContent", needCodeContent ?: ""), - DevOpsToolParams("eslint_rc", eslintRc ?: "") - ) - ) - if (!element.projectBuildType.isNullOrBlank()) { - devopsToolParams.add(DevOpsToolParams("PROJECT_BUILD_TYPE", projectBuildType!!)) - devopsToolParams.add(DevOpsToolParams("PROJECT_BUILD_COMMAND", projectBuildCommand ?: "")) - } - val body = mapOf( - "pipelineId" to pipelineId, - "pipelineName" to pipelineName, - "devopsCodeLang" to objectMapper.writeValueAsString(languages), - "devopsTools" to objectMapper.writeValueAsString(tools), - "devopsToolParams" to devopsToolParams, - "toolCheckerSets" to genToolChecker(element), - "nameCn" to pipelineName, - "projectBuildType" to scriptType.name, - "projectBuildCommand" to script - ) - logger.info("start to create task: $body") - - val header = mapOf( - USER_NAME_HEADER to rtx, - DEVOPS_PROJECT_ID to projectId, - CONTENT_TYPE to CONTENT_TYPE_JSON - ) - return getCodeccResult(taskExecution(body, createPath, header, "POST")) - } - } - - open fun updateTask( - pipelineName: String, - userId: String, - element: LinuxPaasCodeCCScriptElement - ) { - with(element) { - val devopsToolParams = mutableListOf( - DevOpsToolParams("compilePlat", compilePlat ?: "LINUX"), - DevOpsToolParams("scan_type", scanType ?: "1"), - DevOpsToolParams("phpcs_standard", phpcsStandard ?: ""), - DevOpsToolParams("go_path", goPath ?: ""), - DevOpsToolParams("py_version", pyVersion ?: ""), - DevOpsToolParams("ccn_threshold", ccnThreshold ?: ""), - DevOpsToolParams("needCodeContent", needCodeContent ?: ""), - DevOpsToolParams("eslint_rc", eslintRc ?: ""), - DevOpsToolParams("SHELL", script) - ) - if (!element.projectBuildType.isNullOrBlank()) { - devopsToolParams.add(DevOpsToolParams("PROJECT_BUILD_TYPE", projectBuildType!!)) - devopsToolParams.add(DevOpsToolParams("PROJECT_BUILD_COMMAND", projectBuildCommand ?: "")) - } - if (codeCCTaskId.isNullOrBlank()) return - val body = mapOf( - "pipelineName" to pipelineName, - "devopsCodeLang" to objectMapper.writeValueAsString(languages), - "devopsTools" to objectMapper.writeValueAsString(tools ?: listOf()), - "taskId" to codeCCTaskId!!, - "devopsToolParams" to devopsToolParams, - "toolCheckerSets" to genToolChecker(element), - "nameCn" to pipelineName, - "projectBuildType" to scriptType.name, - "projectBuildCommand" to script - ) - logger.info("Update the coverity task($body)") - val header = mapOf( - USER_NAME_HEADER to userId, - CONTENT_TYPE to CONTENT_TYPE_JSON - ) - getCodeccResult(taskExecution(body, updatePath, header, "PUT")) - } - } - - open fun isTaskExist(taskId: String, userId: String): Boolean { - logger.info("Check the coverity task if exist") - val header = mapOf(CONTENT_TYPE to CONTENT_TYPE_JSON) - val result = getCodeccResult(taskExecution(mapOf(), "$existPath/$taskId", header, "GET")) - logger.info("Get the exist result($result)") - return result.data == true - } - - open fun deleteTask(taskId: String, rtx: String) { - val body = emptyMap() - - val headers = mapOf( - "proj_id" to taskId, - USER_NAME_HEADER to rtx - ) - taskExecution(body, "$deletePath/$taskId", headers, "DELETE") - } - - fun getRuleSets(projectId: String, userId: String, toolName: String): Result> { - val headers = mapOf( - AUTH_HEADER_DEVOPS_USER_ID to userId, - AUTH_HEADER_DEVOPS_PROJECT_ID to projectId - ) - val result = taskExecution( - body = mapOf(), - path = getRuleSetsPath.replace("{toolName}", toolName), - headers = headers, - method = "GET" - ) - return objectMapper.readValue(result) - } - private fun taskExecution( body: Map, path: String, @@ -240,7 +101,7 @@ open class CodeccApi constructor( } } - fun getExecUrl(path: String): String { + private fun getExecUrl(path: String): String { val execUrl = if (codeccApiProxyUrl.isBlank()) { codeccApiUrl + path } else { @@ -250,70 +111,6 @@ open class CodeccApi constructor( return execUrl } - private fun getCodeccResult(responseBody: String): CoverityResult { - val result = objectMapper.readValue(responseBody) - if (result.code != "0" || result.status != 0) throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_TASK_OPERATE_FAIL, - errorMsg = "execute codecc task fail" - ) - return result - } - - open fun getReport( - projectId: String, - pipelineId: String, - taskId: String, - userId: String - ): CodeccReport { - try { - val body = mapOf( - "bs_project_id" to projectId, - "pipeline_id" to pipelineId, - "task_id" to taskId - ) - val requestBody = RequestBody.create( - MediaType.parse("application/json; charset=utf-8"), objectMapper.writeValueAsString(body) - ) - val builder = Request.Builder() - .header(USER_NAME_HEADER, userId) - .url(codeccApiUrl + report) - .post(requestBody) - - val request = builder.build() - - OkhttpUtils.doHttp(request).use { response -> - // okHttpClient.newCall(request).execute().use { response -> - if (!response.isSuccessful) { - logger.warn("Fail to execute($report) task($body) because of ${response.message()}") - throw RemoteServiceException("Fail to invoke codecc report") - } - val responseBody = response.body()!!.string() - return CodeccReport(responseBody) - } - } catch (ignored: Throwable) { - logger.warn("Fail to get the codecc report of ($projectId|$pipelineId)", ignored) - throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_TASK_OPERATE_FAIL, - errorMsg = "获取CodeCC报告失败" - ) - } - } - - fun getLanguageRuleSets(projectId: String, userId: String): Result> { - val headers = mapOf( - AUTH_HEADER_DEVOPS_PROJECT_ID to projectId - ) - val result = taskExecution( - body = mapOf(), - path = "/ms/defect/api/service/checkerSet/categoryList", - headers = headers, - method = "GET" - ) - return objectMapper.readValue(result) - } - fun installCheckerSet(projectId: String, userId: String, type: String, checkerSetId: String): Result { val headers = mapOf( AUTH_HEADER_DEVOPS_PROJECT_ID to projectId, @@ -381,43 +178,4 @@ open class CodeccApi constructor( ) return objectMapper.readValue(result) } - - private fun genToolChecker(element: LinuxCodeCCScriptElement): List { - return genToolRuleSet(element).map { - ToolChecker(it.key, it.value) - } - } - - private fun genToolRuleSet(element: LinuxCodeCCScriptElement): Map { - val map = mutableMapOf() - with(element) { - if (!coverityToolSetId.isNullOrBlank()) map["COVERITY"] = coverityToolSetId!! - if (!klocworkToolSetId.isNullOrBlank()) map["KLOCWORK"] = klocworkToolSetId!! - if (!cpplintToolSetId.isNullOrBlank()) map["CPPLINT"] = cpplintToolSetId!! - if (!eslintToolSetId.isNullOrBlank()) map["ESLINT"] = eslintToolSetId!! - if (!pylintToolSetId.isNullOrBlank()) map["PYLINT"] = pylintToolSetId!! - if (!gometalinterToolSetId.isNullOrBlank()) map["GOML"] = gometalinterToolSetId!! - if (!checkStyleToolSetId.isNullOrBlank()) map["CHECKSTYLE"] = checkStyleToolSetId!! - if (!styleCopToolSetId.isNullOrBlank()) map["STYLECOP"] = styleCopToolSetId!! - if (!detektToolSetId.isNullOrBlank()) map["DETEKT"] = detektToolSetId!! - if (!phpcsToolSetId.isNullOrBlank()) map["PHPCS"] = phpcsToolSetId!! - if (!sensitiveToolSetId.isNullOrBlank()) map["SENSITIVE"] = sensitiveToolSetId!! - if (!occheckToolSetId.isNullOrBlank()) map["OCCHECK"] = occheckToolSetId!! - if (!gociLintToolSetId.isNullOrBlank()) map["GOCILINT"] = gociLintToolSetId!! - if (!woodpeckerToolSetId.isNullOrBlank()) map["WOODPECKER_SENSITIVE"] = woodpeckerToolSetId!! - if (!horuspyToolSetId.isNullOrBlank()) map["HORUSPY"] = horuspyToolSetId!! - if (!pinpointToolSetId.isNullOrBlank()) map["PINPOINT"] = pinpointToolSetId!! - } - return map - } - - private data class DevOpsToolParams( - val varName: String, - val chooseValue: String - ) - - private data class ToolChecker( - val toolName: String, - val checkerSetId: String - ) } diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccElementSubTypeFetcher.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccElementSubTypeFetcher.kt deleted file mode 100644 index 41dbbf7c06d..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccElementSubTypeFetcher.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc - -import com.tencent.devops.common.pipeline.ElementSubTypeFetcher -import com.tencent.devops.common.pipeline.pojo.element.Element -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement - -class CodeccElementSubTypeFetcher : ElementSubTypeFetcher { - - override fun jsonSubTypes(): Map> { - return mapOf( - LinuxCodeCCScriptElement.classType to LinuxCodeCCScriptElement::class.java, - LinuxPaasCodeCCScriptElement.classType to LinuxPaasCodeCCScriptElement::class.java - ) - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccUtils.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccUtils.kt index 73e2fc74482..b840a5962e6 100644 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccUtils.kt +++ b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/CodeccUtils.kt @@ -27,9 +27,6 @@ package com.tencent.devops.plugin.codecc -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement - object CodeccUtils { const val BK_CI_CODECC_TASK_ID = "BK_CI_CODECC_TASK_ID" @@ -39,23 +36,18 @@ object CodeccUtils { const val BK_CI_CODECC_COMMUNITY_ATOM = "CodeCCCheckAtom" fun isCodeccAtom(atomName: String?): Boolean { - return isCodeccNewAtom(atomName) || isCodeccV1Atom(atomName) + return isCodeccNewAtom(atomName) } - fun isCodeccNewAtom(atomName: String?): Boolean { + private fun isCodeccNewAtom(atomName: String?): Boolean { return isCodeccV2Atom(atomName) || isCodeccV3Atom(atomName) } - fun isCodeccV1Atom(atomName: String?): Boolean { - return atomName == LinuxCodeCCScriptElement.classType || - atomName == LinuxPaasCodeCCScriptElement.classType - } - - fun isCodeccV2Atom(atomName: String?): Boolean { + private fun isCodeccV2Atom(atomName: String?): Boolean { return atomName == "CodeccCheckAtom" } - fun isCodeccV3Atom(atomName: String?): Boolean { + private fun isCodeccV3Atom(atomName: String?): Boolean { return atomName == BK_CI_CODECC_V3_ATOM } @@ -66,8 +58,6 @@ object CodeccUtils { // 主要是因为codecc插件版本太多,又要统一处理,故加此map val realAtomCodeMap = mapOf( - LinuxCodeCCScriptElement.classType to BK_CI_CODECC_V3_ATOM, - LinuxPaasCodeCCScriptElement.classType to BK_CI_CODECC_V3_ATOM, "CodeccCheckAtom" to BK_CI_CODECC_V3_ATOM, BK_CI_CODECC_V3_ATOM to BK_CI_CODECC_V3_ATOM ) diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/config/CodeccConfig.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/config/CodeccConfig.kt index 3a82efacd1b..e9b47cf5cb7 100644 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/config/CodeccConfig.kt +++ b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/config/CodeccConfig.kt @@ -41,22 +41,4 @@ class CodeccConfig { @Value("\${codeccGateway.proxy:}") val codeccApiProxyGateWay: String = "" - - @Value("\${codeccGateway.api.createTask:/ms/task/api/service/task}") - val createPath = "/ms/task/api/service/task" - - @Value("\${codeccGateway.api.updateTask:/ms/task/api/service/task}") - val updatePath = "/ms/task/api/service/task" - - @Value("\${codeccGateway.api.checkTaskExists:/ms/task/api/service/task/exists}") - val existPath = "/ms/task/api/service/task/exists" - - @Value("\${codeccGateway.api.deleteTask:/ms/task/api/service/task}") - val deletePath = "/ms/task/api/service/task" - - @Value("\${codeccGateway.api.codeCheckReport:/api}") - val report = "" - - @Value("\${codeccGateway.api.getRuleSets:/blueShield/getRuleSetsPath}") - val getRuleSetsPath = "" } diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/element/LinuxCodeCCScriptElementBizPlugin.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/element/LinuxCodeCCScriptElementBizPlugin.kt deleted file mode 100644 index 53511eb9054..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/element/LinuxCodeCCScriptElementBizPlugin.kt +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc.element - -import com.tencent.devops.common.pipeline.container.Container -import com.tencent.devops.common.pipeline.enums.ChannelCode -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.atom.BeforeDeleteParam -import com.tencent.devops.process.plugin.ElementBizPlugin -import com.tencent.devops.process.plugin.annotation.ElementBiz - -@ElementBiz -class LinuxCodeCCScriptElementBizPlugin : ElementBizPlugin { - - override fun afterCreate( - element: LinuxCodeCCScriptElement, - projectId: String, - pipelineId: String, - pipelineName: String, - userId: String, - channelCode: ChannelCode, - create: Boolean, - container: Container - ) = Unit - - override fun beforeDelete(element: LinuxCodeCCScriptElement, param: BeforeDeleteParam) = Unit - - override fun elementClass(): Class { - return LinuxCodeCCScriptElement::class.java - } - - override fun check(element: LinuxCodeCCScriptElement, appearedCnt: Int) { - if (appearedCnt > 1) { - throw IllegalArgumentException("只允许一个代码扫描原子") - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementBizPlugin.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementBizPlugin.kt deleted file mode 100644 index ccc4a6ae2a5..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementBizPlugin.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc.element - -import com.tencent.devops.common.api.exception.OperationException -import com.tencent.devops.common.pipeline.container.Container -import com.tencent.devops.common.pipeline.enums.ChannelCode -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.atom.BeforeDeleteParam -import com.tencent.devops.plugin.codecc.CodeccApi -import com.tencent.devops.process.plugin.ElementBizPlugin -import com.tencent.devops.process.plugin.annotation.ElementBiz -import org.slf4j.LoggerFactory - -@ElementBiz -class LinuxPaasCodeCCScriptElementBizPlugin constructor( - private val coverityApi: CodeccApi -) : ElementBizPlugin { - - companion object { - private val logger = LoggerFactory.getLogger(LinuxPaasCodeCCScriptElementBizPlugin::class.java) - } - - override fun elementClass(): Class { - return LinuxPaasCodeCCScriptElement::class.java - } - - override fun check(element: LinuxPaasCodeCCScriptElement, appearedCnt: Int) { - if (appearedCnt > 1) { - throw IllegalArgumentException("只允许一个代码扫描原子") - } - } - - @Suppress("ALL") - override fun afterCreate( - element: LinuxPaasCodeCCScriptElement, - projectId: String, - pipelineId: String, - pipelineName: String, - userId: String, - channelCode: ChannelCode, - create: Boolean, - container: Container - ) { - with(element) { - if (languages.isEmpty()) { - throw OperationException("工程语言不能为空") - } - try { - if ((!create) && (!codeCCTaskId.isNullOrEmpty())) { - if (coverityApi.isTaskExist(codeCCTaskId!!, userId)) { - // Update the coverity - coverityApi.updateTask(pipelineName, userId, element) - return - } - } - // Create a new one - val task = coverityApi.createTask(projectId, pipelineId, pipelineName, userId, element) - // 返回data可能是map,也可能是true - logger.info("Create the coverity task($task)") - if (task.data is Map<*, *>) { - val dataMap = task.data as Map - codeCCTaskId = (dataMap["taskId"] as Int).toString() - codeCCTaskName = dataMap["nameEn"] as String - codeCCTaskCnName = pipelineName - } - } catch (e: Exception) { - logger.warn( - "Fail to create the coverity codecc task($projectId|$pipelineId|$pipelineName|$userId|$name)", - e - ) - throw OperationException("代码检查任务创建失败,请联系【助手】") - } - } - } - - override fun beforeDelete(element: LinuxPaasCodeCCScriptElement, param: BeforeDeleteParam) { - with(element) { - logger.info("Start to delete the codecc task($codeCCTaskId) in codecc by user ${param.userId}") - if (codeCCTaskId.isNullOrEmpty()) { - logger.warn("The codecc task id is empty") - return - } - coverityApi.deleteTask(codeCCTaskId!!, param.userId) - codeCCTaskId = null - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/CodeccElementData.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/CodeccElementData.kt deleted file mode 100644 index 458968f2ebe..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/CodeccElementData.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc.pojo - -import io.swagger.annotations.ApiModel - -@ApiModel("codecc原子数据") -data class CodeccElementData( - val projectId: String, - val pipelineId: String, - val taskName: String, - val taskCnName: String, - val taskId: String, - val sync: String, - val scanType: String, - val language: String, - val platform: String, - val tools: String, - val pythonVersion: String, - val eslintRc: String, - val codePath: String, - val scriptType: String, - val script: String, - val channelCode: String, - val updateUserId: String -) diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CodeccReport.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CodeccReport.kt deleted file mode 100644 index ce47f093020..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/CodeccReport.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc.pojo.coverity - -import io.swagger.annotations.ApiModel -import io.swagger.annotations.ApiModelProperty - -@ApiModel("Codecc-Report信息") -data class CodeccReport( - @ApiModelProperty("codecc report信息", required = true) - val report: String -) diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/ProjectLanguage.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/ProjectLanguage.kt deleted file mode 100644 index 1fe8bb96002..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/kotlin/com/tencent/devops/plugin/codecc/pojo/coverity/ProjectLanguage.kt +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc.pojo.coverity - -enum class ProjectLanguage(val value: String) { - C("c"), - C_PLUS_PLUSH("c++"), - C_CPP("cpp"), - OBJECTIVE_C("objective-C"), - OC("objective-C"), - C_SHARP("c#"), - JAVA("java"), - PYTHON("python"), - JAVASCRIPT("javascript"), - JS("javascript"), - PHP("php"), - RUBY("ruby"), - LUA("lua"), - GOLANG("golang"), - SWIFT("swift"), - TYPESCRIPT("typescript"), - KOTLIN("kotlin"), - CLOJURE("clojure"), - SOLIDITY("solidity"), - OTHERS("others"); - - companion object { - fun fromValue(value: String) = - ProjectLanguage.values().associateBy(ProjectLanguage::value)[value] - ?: throw IllegalArgumentException("The project language($value) is not exist") - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/resources/META-INF/services/com.tencent.devops.common.pipeline.ElementSubTypeFetcher b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/resources/META-INF/services/com.tencent.devops.common.pipeline.ElementSubTypeFetcher deleted file mode 100644 index c299b0c1f49..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/main/resources/META-INF/services/com.tencent.devops.common.pipeline.ElementSubTypeFetcher +++ /dev/null @@ -1,28 +0,0 @@ -# -# Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. -# -# Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -# -# BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. -# -# A copy of the MIT License is included in this file. -# -# -# Terms of the MIT License: -# --------------------------------------------------- -# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all copies or substantial portions of -# the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -com.tencent.devops.plugin.codecc.CodeccElementSubTypeFetcher diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxCodeCCScriptElementBizPluginTest.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxCodeCCScriptElementBizPluginTest.kt deleted file mode 100644 index e3f3cbd5ddf..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxCodeCCScriptElementBizPluginTest.kt +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc.element - -import com.tencent.devops.common.pipeline.container.TriggerContainer -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.common.pipeline.enums.ChannelCode -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.atom.BeforeDeleteParam -import com.tencent.devops.plugin.codecc.pojo.coverity.ProjectLanguage -import org.junit.Assert -import org.junit.Test - -class LinuxCodeCCScriptElementBizPluginTest { - - private val plugin = LinuxCodeCCScriptElementBizPlugin() - - private val pipelineId = "p-123" - private val projectId = "test" - private val pipelineName = "codecc Pipeline" - private val userId = "admin" - private val element = LinuxCodeCCScriptElement( - name = "exe", - id = "1", - status = "1", - script = "echo hello", - scanType = "1", - scriptType = BuildScriptType.SHELL, - codeCCTaskCnName = "demo", - asynchronous = true, - path = "/tmp/codecc", - languages = listOf(ProjectLanguage.JAVA) - ) - private val container = TriggerContainer( - id = "1" - ) - - @Test - fun afterCreate() { - plugin.afterCreate( - element = element, - projectId = projectId, - pipelineId = pipelineId, - pipelineName = pipelineName, - userId = userId, - channelCode = ChannelCode.BS, - create = true, - container = container - ) - } - - @Test - fun beforeDelete() { - val param = BeforeDeleteParam(userId, projectId, pipelineId) - plugin.beforeDelete(element, param) - } - - @Test - fun elementClass() { - Assert.assertEquals( - LinuxCodeCCScriptElement::class.java, - plugin.elementClass() - ) - } - - @Test - fun checkOne() { - plugin.check(element, 1) - plugin.check(element, 0) - } - - @Test(expected = IllegalArgumentException::class) - fun checkMoreOne() { - plugin.check(element, 2) - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementBizPluginTest.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementBizPluginTest.kt deleted file mode 100644 index b2d63e1758c..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementBizPluginTest.kt +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc.element - -import com.nhaarman.mockito_kotlin.any -import com.nhaarman.mockito_kotlin.mock -import com.nhaarman.mockito_kotlin.whenever -import com.tencent.devops.common.api.exception.OperationException -import com.tencent.devops.common.pipeline.container.TriggerContainer -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.common.pipeline.enums.ChannelCode -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.atom.BeforeDeleteParam -import com.tencent.devops.plugin.codecc.CodeccApi -import com.tencent.devops.plugin.codecc.pojo.coverity.CoverityResult -import com.tencent.devops.plugin.codecc.pojo.coverity.ProjectLanguage -import org.junit.Assert.assertEquals -import org.junit.Test - -class LinuxPaasCodeCCScriptElementBizPluginTest { - - private val coverityApi: CodeccApi = mock() - - private val plugin = LinuxPaasCodeCCScriptElementBizPlugin(coverityApi) - - private val pipelineId = "p-123" - private val projectId = "test" - private val pipelineName = "codecc Pipeline" - private val userId = "admin" - private val element = LinuxPaasCodeCCScriptElement( - name = "exe", - id = "1", - status = "1", - script = "echo hello", - scanType = "1", - scriptType = BuildScriptType.SHELL, - codeCCTaskCnName = "demo", - codeCCTaskId = "123", - asynchronous = true, - path = "/tmp/codecc", - languages = listOf(ProjectLanguage.JAVA) - ) - private val container = TriggerContainer( - id = "1" - ) - - @Test - fun elementClass() { - assertEquals( - LinuxPaasCodeCCScriptElement::class.java, - plugin.elementClass() - ) - } - - @Test - fun checkOne() { - plugin.check(element, 1) - plugin.check(element, 0) - } - - @Test(expected = IllegalArgumentException::class) - fun checkMoreOne() { - plugin.check(element, 2) - } - - @Test(expected = OperationException::class) - fun afterCreateWhenLanguagesIsEmptyThrowException() { - element.languages = emptyList() - plugin.afterCreate( - element = element, - projectId = projectId, - pipelineId = pipelineId, - pipelineName = pipelineName, - userId = userId, - channelCode = ChannelCode.BS, - create = true, - container = container - ) - } - - @Test - fun afterCreateWhenTaskExists() { - whenever( - coverityApi.isTaskExist( - taskId = any(), - userId = any() - - ) - ).thenReturn(true) - - plugin.afterCreate( - element = element, - projectId = projectId, - pipelineId = pipelineId, - pipelineName = pipelineName, - userId = userId, - channelCode = ChannelCode.BS, - create = false, - container = container - ) - } - - @Test(expected = OperationException::class) - fun afterCreateWhenCoverityReturnNull() { - whenever( - coverityApi.isTaskExist( - taskId = any(), - userId = any() - - ) - ).thenReturn(false) - - whenever( - coverityApi.createTask( - projectId = any(), - pipelineId = any(), - pipelineName = any(), - rtx = any(), - element = any() - ) - ).thenReturn(null) - - plugin.afterCreate( - element = element, - projectId = projectId, - pipelineId = pipelineId, - pipelineName = pipelineName, - userId = userId, - channelCode = ChannelCode.BS, - create = false, - container = container - ) - } - - @Test(expected = OperationException::class) - fun afterCreateWhenTaskNotExists() { - val coverityResult = CoverityResult( - status = 0, - message = "", - data = mapOf( - "taskId" to 123 - ) - ) - whenever( - coverityApi.isTaskExist( - taskId = any(), - userId = any() - - ) - ).thenReturn(false) - - whenever( - coverityApi.createTask( - projectId = any(), - pipelineId = any(), - pipelineName = any(), - rtx = any(), - element = any() - ) - ).thenReturn(coverityResult) - - plugin.afterCreate( - element = element, - projectId = projectId, - pipelineId = pipelineId, - pipelineName = pipelineName, - userId = userId, - channelCode = ChannelCode.BS, - create = true, - container = container - ) - val map = coverityResult.data as Map - assertEquals(map["taskId"], element.codeCCTaskId) - } - - @Test - fun beforeDeleteFail() { - val param = BeforeDeleteParam(userId, projectId, pipelineId) - plugin.beforeDelete(element = element, param = param) - } - - @Test - fun beforeDeleteWhenIDNull() { - val param = BeforeDeleteParam(userId, projectId, pipelineId) - element.codeCCTaskId = null - plugin.beforeDelete(element = element, param = param) - element.codeCCTaskId = "" - plugin.beforeDelete(element = element, param = param) - } - - @Test - fun beforeDeleteWhenSuccess() { - val param = BeforeDeleteParam(userId, projectId, pipelineId) - plugin.beforeDelete(element = element, param = param) - assertEquals(element.codeCCTaskId, null) - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementTest.kt b/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementTest.kt deleted file mode 100644 index 354e49d3a41..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/common-codecc/src/test/kotlin/com/tencent/devops/plugin/codecc/element/LinuxPaasCodeCCScriptElementTest.kt +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.codecc.element - -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement -import com.tencent.devops.plugin.codecc.pojo.coverity.ProjectLanguage -import org.junit.Assert.assertEquals -import org.junit.Test - -class LinuxPaasCodeCCScriptElementTest { - - @Test - fun cleanUp() { - var element = LinuxPaasCodeCCScriptElement( - name = "exe", - id = "1", - status = "1", - script = "echo hello", - scanType = "1", - scriptType = BuildScriptType.SHELL, - codeCCTaskCnName = "demo", - codeCCTaskId = "123", - asynchronous = false, - path = "/tmp/codecc", - languages = listOf(ProjectLanguage.JAVA) - ) - element.cleanUp() - assertEquals(element.codeCCTaskId, null) - assertEquals(element.codeCCTaskName, null) - - element = LinuxPaasCodeCCScriptElement( - scriptType = BuildScriptType.BAT, - name = "exe", scanType = "1", codeCCTaskCnName = "demo", codeCCTaskId = "123", - languages = listOf(ProjectLanguage.JAVA) - ) - element.scriptType = BuildScriptType.PYTHON2 - element.scriptType = BuildScriptType.PYTHON3 - element.scriptType = BuildScriptType.POWER_SHELL - element.cleanUp() - assertEquals(element.codeCCTaskId, null) - assertEquals(element.codeCCTaskName, null) - } - - @Test - fun getClassType() { - val element = LinuxPaasCodeCCScriptElement( - scriptType = BuildScriptType.POWER_SHELL, - name = "exe", scanType = "1", codeCCTaskCnName = "demo", codeCCTaskId = "123", - languages = listOf(ProjectLanguage.JAVA) - ) - assertEquals( - element.getClassType(), - LinuxPaasCodeCCScriptElement.classType - ) - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/pojo/CodeccExecuteConfig.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/pojo/CodeccExecuteConfig.kt deleted file mode 100644 index 190fcad9b8d..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/pojo/CodeccExecuteConfig.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.pojo - -import com.tencent.devops.common.api.enums.RepositoryConfig -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.process.pojo.BuildTask -import com.tencent.devops.process.pojo.BuildVariables -import java.io.File - -/** - * 26/01/2018 - */ -data class CodeccExecuteConfig( - val scriptType: BuildScriptType, - val repos: List, - val buildVariables: BuildVariables, - val buildTask: BuildTask, - val workspace: File, - val tools: List, - val filterTools: List, - val timeOut: Long = 4 * 3600 // 4小时 -) { - data class RepoItem( - val repositoryConfig: RepositoryConfig?, - val type: String, - val relPath: String = "", // 代码路径 - val relativePath: String = "", // 代码相对路径 - var url: String = "", - var authType: String = "", - var repoHashId: String = "", - var svnUerPassPair: Pair? = null - ) -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/LinuxCodeCCScriptTask.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/LinuxCodeCCScriptTask.kt deleted file mode 100644 index 0c5cb96a5be..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/LinuxCodeCCScriptTask.kt +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task - -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.common.api.util.JsonUtil -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement -import com.tencent.devops.plugin.worker.pojo.CodeccExecuteConfig -import com.tencent.devops.process.pojo.BuildTask -import com.tencent.devops.process.pojo.BuildVariables -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccEnvHelper -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccRepoHelper -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccUtils -import com.tencent.devops.plugin.worker.task.codecc.util.WindowsCodeccUtils -import com.tencent.devops.worker.common.env.AgentEnv -import com.tencent.devops.worker.common.logger.LoggerService -import com.tencent.devops.worker.common.task.ITask -import com.tencent.devops.worker.common.task.TaskClassType -import java.io.File - -/** - * 构建脚本任务 - */ -@TaskClassType(classTypes = [LinuxPaasCodeCCScriptElement.classType, LinuxCodeCCScriptElement.classType]) -class LinuxCodeCCScriptTask : ITask() { - - override fun execute(buildTask: BuildTask, buildVariables: BuildVariables, workspace: File) { - val taskParams = buildTask.params ?: mapOf() - // 如果指定_CODECC_FILTER_TOOLS,则只做_CODECC_FILTER_TOOLS的扫描 - val repos = CodeccRepoHelper.getCodeccRepos(buildTask, buildVariables) - val filterTools = buildVariables.variables["_CODECC_FILTER_TOOLS"] ?: "" - val coverityConfig = CodeccExecuteConfig( - scriptType = BuildScriptType.valueOf(taskParams["scriptType"] ?: ""), - repos = repos, - buildVariables = buildVariables, - buildTask = buildTask, - workspace = workspace, - tools = JsonUtil.to(taskParams["tools"]!!), - filterTools = filterTools.split(",").map { it.trim() }.filter { it.isNotBlank() } - ) - LoggerService.addNormalLine("buildVariables coverityConfig: $coverityConfig") - - // 第三方机器初始化 - CodeccEnvHelper.thirdInit(coverityConfig) - - // 先写入codecc任务 - CodeccEnvHelper.saveTask(buildVariables) - - // 执行codecc的python脚本 - if (AgentEnv.getOS() == OSType.WINDOWS) WindowsCodeccUtils().executeCommand(coverityConfig) - else CodeccUtils().executeCommand(coverityConfig) - - // 写入环境变量 - addEnv(CodeccEnvHelper.getCodeccEnv(workspace, buildTask.buildId)) - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/LinuxCodeccConfig.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/LinuxCodeccConfig.kt deleted file mode 100644 index fe9c6e364da..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/LinuxCodeccConfig.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc - -val MOUNT_PATH = System.getProperty("devops.codecc.script.path", "/data/devops/codecc") -val SCRIPT_PATH = System.getProperty("devops.codecc.script.path", "$MOUNT_PATH/script") -val SOFTWARE_PATH = System.getProperty("devops.codecc.software.path", "$MOUNT_PATH/software") - -val TOOL_SCRIT_PATH = System.getProperty("evops.codecc.script.tool.path", "build.py") -val PYLINT2_PATH = System.getProperty("devops.codecc.software.pylint2.path", "pylint2") -val PYLINT3_PATH = System.getProperty("devops.codecc.software.pylint3.path", "pylint3") -val NODE_PATH = System.getProperty("devops.codecc.software.node.path", "node/bin") -val JDK_PATH = System.getProperty("devops.codecc.software.jdk.path", "jdk/bin") -val GO_PATH = System.getProperty("devops.codecc.software.go.path", "go/bin") -val GOMETALINTER_PATH = System.getProperty("devops.codecc.software.gometalinter.path", "gometalinter/bin") -val LIBZIP_PATH = System.getProperty("devops.codecc.software.libzip.path", "libzip/bin") -val PHP_PATH = System.getProperty("devops.codecc.software.php.path", "php/bin") -val PYTHON2_PATH = System.getProperty("devops.codecc.software.python2.path", "python2/bin") -val PYTHON3_PATH = System.getProperty("devops.codecc.software.python3.path", "python3/bin") -val MONO_PATH = System.getProperty("devops.codecc.software.mono.path", "mono/bin") - -val GRADLE_PATH = System.getProperty("devops.codecc.software.gradle.path", "gradle/bin") -val MAVEN_PATH = System.getProperty("devops.codecc.software.maven.path", "maven/bin") -val ANT_PATH = System.getProperty("devops.codecc.software.ant.path", "ant/bin") diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/LinuxCodeccConstants.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/LinuxCodeccConstants.kt deleted file mode 100644 index 1a015189ac9..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/LinuxCodeccConstants.kt +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc - -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.worker.common.env.AgentEnv -import com.tencent.devops.worker.common.env.BuildEnv -import com.tencent.devops.worker.common.utils.WorkspaceUtils -import java.io.File - -object LinuxCodeccConstants { - - const val SVN_USER = "SVN_USER" - const val SVN_PASSWORD = "SVN_PASSWORD" - val COV_TOOLS = listOf("COVERITY", "KLOCWORK", "GOCILINT") - - // 1. 公共构建机参数 - private val CODECC_FOLDER = File("/data/bkdevops/apps/coverity") - - // 2. 第三方构建机相关参数 - val THIRD_CODECC_FOLDER = WorkspaceUtils.getLandun().canonicalPath + File.separator + "codecc" - - // 2.1 第三方构建机需要下载的文件 - val THIRD_PYTHON2_TAR_FILE = File(THIRD_CODECC_FOLDER, "Python-2.7.12.tgz") - val THIRD_PYTHON3_TAR_FILE = File(THIRD_CODECC_FOLDER, "Python-3.5.1.tgz") - val THIRD_COVERITY_FILE = File( - THIRD_CODECC_FOLDER, if (AgentEnv.getOS() == OSType.LINUX) { - if (AgentEnv.is32BitSystem()) "cov-analysis-linux-2018.03.tar.gz" - else "cov-analysis-linux64-2018.03.tar.gz" - } else { - "cov-analysis-macosx-2018.06.tar.gz" - }) - val THIRD_KLOCWORK_FILE = File( - THIRD_CODECC_FOLDER, if (AgentEnv.getOS() == OSType.LINUX) { - if (AgentEnv.is32BitSystem()) "kw-analysis-linux-12.3.tar.gz" - else "kw-analysis-linux64-12.3.tar.gz" - } else { - "kw-analysis-macosx-12.3.tar.gz" - }) - val THIRD_PYLINT2_FILE = File(THIRD_CODECC_FOLDER, "pylint_2.7.zip") - val THIRD_PYLINT3_FILE = File(THIRD_CODECC_FOLDER, "pylint_3.5.zip") - val THIRD_GOROOT_FILE = File( - THIRD_CODECC_FOLDER, if (AgentEnv.getOS() == OSType.LINUX) { - if (AgentEnv.is32BitSystem()) "go1.9.2.linux-386.tar.gz" - else "go1.9.2.linux-amd64.tar.gz" - } else { - "go1.9.2.darwin-amd64.tar.gz" - }) - val THIRD_JDK_FILE = if (AgentEnv.getOS() == OSType.LINUX) { - if (AgentEnv.is32BitSystem()) File(THIRD_CODECC_FOLDER, "jdk-8u191-linux-x64.tar.gz") - else File(THIRD_CODECC_FOLDER, "jdk-8u191-linux-i586.tar.gz") - } else { - File(THIRD_CODECC_FOLDER, "jdk-8u191-macosx-x64.dmg") - } - val THIRD_NODE_FILE = File(THIRD_CODECC_FOLDER, "node-v8.9.0-linux-x64_eslint.tar.gz") - val THIRD_GOMETALINTER_FILE = if (AgentEnv.getOS() == OSType.MAC_OS) { - File(THIRD_CODECC_FOLDER, "gometalinter_macos.zip") - } else { - File(THIRD_CODECC_FOLDER, "gometalinter_linux.zip") - } - - val COVRITY_HOME = if (BuildEnv.isThirdParty()) { - THIRD_COVERITY_FILE.canonicalPath.removeSuffix(".tar.gz") - } else { - File(CODECC_FOLDER, if (AgentEnv.getOS() == OSType.MAC_OS) { - "cov-analysis-macosx" - } else { - "cov-analysis-linux" - }).canonicalPath - } - - val KLOCWORK_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, THIRD_KLOCWORK_FILE.name) - } else { - File("/data/bkdevops/apps/codecc/kw-analysis/bin") - } - - val PYTHON2_PATH = if (BuildEnv.isThirdParty()) { - if (AgentEnv.getOS() == OSType.MAC_OS) { - File("/usr/bin") - } else { - File(THIRD_CODECC_FOLDER, "Python-2.7.12/bin") - } - } else { - if (AgentEnv.getOS() == OSType.MAC_OS) { - File("/usr/bin") - } else { - File("/data/bkdevops/apps/python/2.7.12/bin") - } - } - - val PYTHON3_PATH = if (BuildEnv.isThirdParty()) { - if (AgentEnv.getOS() == OSType.MAC_OS) { - File("/data/bkdevops/apps/python/3.5/IDLE.app/Contents/MacOS") - } else { - File(THIRD_CODECC_FOLDER, "Python-3.5.1/bin") - } - } else { - if (AgentEnv.getOS() == OSType.MAC_OS) { - File("/data/bkdevops/apps/python/3.5/IDLE.app/Contents/MacOS") - } else { - File("/data/bkdevops/apps/python/3.5.1/bin") - } - } - - val JDK_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "jdk1.8.0_191/bin").canonicalPath - } else { - if (AgentEnv.getOS() == OSType.MAC_OS) { - "/data/soda/apps/jdk/1.8.0_161/Contents/Home/bin" - } else { - "/data/bkdevops/apps/jdk/1.8.0_161/bin" - } - } - val NODE_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "node-v8.9.0-linux-x64_eslint/bin").canonicalPath - } else { - "/data/bkdevops/apps/codecc/node-v8.9.0-linux-x64/bin" - } - val GOMETALINTER_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "gometalinter/bin").canonicalPath - } else { - "/data/bkdevops/apps/codecc/gometalinter/bin" - } - val PYLINT2_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "mypylint_2.7").canonicalPath - } else { - "/data/bkdevops/apps/codecc/pylint_2.7" - } - val PYLINT3_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "mypylint_3.5").canonicalPath - } else { - "/data/bkdevops/apps/codecc/pylint_3.5" - } - val GOROOT_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "go/bin").canonicalPath - } else { - "/data/bkdevops/apps/codecc/go/bin" - } - val STYLE_TOOL_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "").canonicalPath // 暂时不支持第三方机器 - } else { - "/data/bkdevops/apps/codecc/mono/bin" - } - val PHPCS_TOOL_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "").canonicalPath // 暂时不支持第三方机器 - } else { - "/data/bkdevops/apps/codecc/php/bin" - } - val GOROOT_PATH_12 = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "golang1.12.9/bin").canonicalPath - } else { - "/data/bkdevops/apps/codecc/golang1.12.9/bin" - } - val GO_CI_LINT_PATH = if (BuildEnv.isThirdParty()) { - File(THIRD_CODECC_FOLDER, "gocilint1.17.1").canonicalPath - } else { - "/data/bkdevops/apps/codecc/gocilint1.17.1" - } - - fun getCovPyFile(): File { - val covPyFile = when { - AgentEnv.isDev() -> "build_external_dev.py" - AgentEnv.isTest() -> "build_external_test.py" - else -> "build_external_prod.py" - } - return if (BuildEnv.isThirdParty()) File(THIRD_CODECC_FOLDER, covPyFile) - else File(CODECC_FOLDER, covPyFile) - } - - fun getToolPyFile(): File { - val toolPyFile = when { - AgentEnv.isDev() -> "build_tool_external_dev.py" - AgentEnv.isTest() -> "build_tool_external_test.py" - else -> "build_tool_external_prod.py" - } - return if (BuildEnv.isThirdParty()) File(THIRD_CODECC_FOLDER, toolPyFile) - else File(CODECC_FOLDER, toolPyFile) - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/WindowsCodeccConstants.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/WindowsCodeccConstants.kt deleted file mode 100644 index fc894cbf62b..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/WindowsCodeccConstants.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc - -import java.io.File - -object WindowsCodeccConstants { - - // windows公共构建机路径 - // windows不需要安装,直接配置路径即可 - val WINDOWS_CODECC_FOLDER = File("c:/software/codecc") - val WINDOWS_COV_PY_FILE = File(WINDOWS_CODECC_FOLDER, "script/${LinuxCodeccConstants.getCovPyFile().name}") - val WINDOWS_TOOL_PY_FILE = File(WINDOWS_CODECC_FOLDER, "script/${LinuxCodeccConstants.getToolPyFile().name}") - val WINDOWS_COVRITY_HOME = File(WINDOWS_CODECC_FOLDER, "cov-analysis-win64-2018.06") - val WINDOWS_KLOCWORK_HOME = File(WINDOWS_CODECC_FOLDER, "kw-analysis-win64-12.3") - val WINDOWS_PYTHON2_PATH = File(WINDOWS_CODECC_FOLDER, "Python27") - val WINDOWS_PYTHON3_PATH = File(WINDOWS_CODECC_FOLDER, "Python-3.5.2") - val WINDOWS_PYLINT2_PATH = File(WINDOWS_CODECC_FOLDER, "pylint_2.7") - val WINDOWS_PYLINT3_PATH = File(WINDOWS_CODECC_FOLDER, "pylint_3.5") - val WINDOWS_GOROOT_PATH = File(WINDOWS_CODECC_FOLDER, "go1.10.3") - val WINDOWS_JDK_PATH = File(WINDOWS_CODECC_FOLDER, "Java/jdk1.8.0_65/bin") - val WINDOWS_NODE_PATH = File(WINDOWS_CODECC_FOLDER, "node-v8.9.0-win-x86_eslint") - val WINDOWS_GOMETALINTER_PATH = File(WINDOWS_CODECC_FOLDER, "gometalinter/bin") -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccEnvHelper.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccEnvHelper.kt deleted file mode 100644 index 3babfd167ae..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccEnvHelper.kt +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.plugin.worker.pojo.CodeccExecuteConfig -import com.tencent.devops.process.pojo.BuildVariables -import com.tencent.devops.worker.common.api.ApiFactory -import com.tencent.devops.worker.common.api.codecc.CodeccSDKApi -import com.tencent.devops.worker.common.env.AgentEnv -import com.tencent.devops.worker.common.env.BuildEnv -import com.tencent.devops.worker.common.task.script.ScriptEnvUtils -import java.io.File - -object CodeccEnvHelper { - - private val api = ApiFactory.create(CodeccSDKApi::class) - - fun getCodeccEnv(workspace: File, buildId: String): Map { - return ScriptEnvUtils.getEnv(buildId, workspace) - } - - fun saveTask(buildVariables: BuildVariables) { - api.saveTask(buildVariables.projectId, buildVariables.pipelineId, buildVariables.buildId) - } - - // 第三方构建机初始化 - fun thirdInit(coverityConfig: CodeccExecuteConfig) { - // 第三方构建机安装环境 - val channelCode = coverityConfig.buildVariables.variables["pipeline.start.channel"] ?: "" - if (BuildEnv.isThirdParty()) { - when (AgentEnv.getOS()) { - OSType.WINDOWS -> { - CodeccInstaller.windowsDonwloadScript() - } - OSType.LINUX -> { - CodeccInstaller.donwloadScript() - CodeccInstaller.setUpPython3(coverityConfig) - } - OSType.MAC_OS -> { - CodeccInstaller.donwloadScript() - CodeccInstaller.setupTools(coverityConfig) - } - else -> { - } - } - } else { - // mac公共机需要安装 python3 环境 - if (AgentEnv.getOS() == OSType.MAC_OS) { -// val pythonExist = -// CodeccInstaller.pythonExist(File("~/.pyenv/shims/python")) -// LoggerService.addNormalLine("check mac python is exist : $pythonExist") -// if (!pythonExist) { -// LoggerService.addNormalLine("python installing...") -// CodeccInstaller.installMacPython() -// } - } - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccExecuteHelper.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccExecuteHelper.kt deleted file mode 100644 index 0e5efd823cf..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccExecuteHelper.kt +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.tencent.devops.common.api.exception.TaskExecuteException -import com.tencent.devops.common.api.pojo.ErrorType -import com.tencent.devops.common.api.util.JsonUtil -import com.tencent.devops.plugin.worker.pojo.CodeccExecuteConfig -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.COV_TOOLS -import com.tencent.devops.common.api.pojo.ErrorCode -import com.tencent.devops.worker.common.logger.LoggerService -import java.util.concurrent.CountDownLatch -import java.util.concurrent.Executors -import java.util.concurrent.TimeUnit -import java.util.concurrent.atomic.AtomicInteger -import kotlin.reflect.KFunction1 - -@Suppress("ALL") -object CodeccExecuteHelper { - - fun executeCodecc( - codeccExecuteConfig: CodeccExecuteConfig, - covFun: KFunction1, - toolFun: KFunction1 - ): String { - val runTypes = getRunTypes(codeccExecuteConfig) - val runCoverity = runTypes.first - val runTools = runTypes.second - - val result = StringBuilder() - - var expectCount = 0 - if (runCoverity) expectCount++ - if (runTools) expectCount++ - - val lock = CountDownLatch(expectCount) - val successCount = AtomicInteger(0) - val errorMsg = StringBuilder() - // 按照旧的逻辑执行COVERITY - val executor = Executors.newFixedThreadPool(expectCount) - try { - if (runCoverity) { - // 保证coverity跑失败不影响多工具 - executor.execute { - try { - result.append(covFun(codeccExecuteConfig)) - successCount.getAndIncrement() - LoggerService.addNormalLine("run coverity or klocwork successful") - } catch (e: Exception) { - errorMsg.append("run coverity or klocwork fail: ${e.message}\n") - } finally { - lock.countDown() - } - } - } - // 其他类型扫描走新的逻辑 - if (runTools) { - executor.execute { - try { - result.append(toolFun(codeccExecuteConfig)) - successCount.getAndIncrement() - LoggerService.addNormalLine("run codecc tools successful") - } catch (e: Exception) { - errorMsg.append("run codecc tools fail: ${e.message}\n") - } finally { - lock.countDown() - } - } - } - // 判断最后结果 - // 4个小时当做超时 - lock.await(codeccExecuteConfig.timeOut, TimeUnit.MINUTES) - if (successCount.get() != expectCount) - throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_TASK_OPERATE_FAIL, - errorMsg = "运行codecc任务失败: $errorMsg" - ) - - return result.toString() - } finally { - executor.shutdownNow() - } - } - - private fun getRunTypes(codeccExecuteConfig: CodeccExecuteConfig): Pair { - with(codeccExecuteConfig) { - val tools = JsonUtil.to>(codeccExecuteConfig.buildTask.params?.get("tools")!!) - val runCoverity = (filterTools.isEmpty() && COV_TOOLS.minus(tools).size != COV_TOOLS.size) || - (filterTools.isNotEmpty() && COV_TOOLS.minus(filterTools).size != COV_TOOLS.size) - val runTools = (codeccExecuteConfig.filterTools.isEmpty() && tools.minus(COV_TOOLS).isNotEmpty()) || - (filterTools.isNotEmpty() && filterTools.minus(COV_TOOLS).isNotEmpty()) - return Pair(runCoverity, runTools) - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccInstaller.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccInstaller.kt deleted file mode 100644 index 9ff81fdd797..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccInstaller.kt +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.google.common.io.Files -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.common.api.exception.TaskExecuteException -import com.tencent.devops.common.api.pojo.ErrorType -import com.tencent.devops.common.api.util.FileUtil -import com.tencent.devops.plugin.codecc.pojo.CodeccToolType -import com.tencent.devops.plugin.worker.pojo.CodeccExecuteConfig -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_CODECC_FOLDER -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_COVERITY_FILE -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_GOMETALINTER_FILE -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_GOROOT_FILE -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_JDK_FILE -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_NODE_FILE -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_PYLINT2_FILE -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_PYLINT3_FILE -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.THIRD_PYTHON3_TAR_FILE -import com.tencent.devops.common.api.pojo.ErrorCode -import com.tencent.devops.worker.common.env.AgentEnv -import com.tencent.devops.worker.common.logger.LoggerService -import com.tencent.devops.worker.common.utils.CommandLineUtils -import com.tencent.devops.worker.common.utils.WorkspaceUtils -import java.io.File - -object CodeccInstaller { - - private val helper = CodeccToolHelper() - - fun setupTools(coverityConfig: CodeccExecuteConfig) { - // 安装python 2.x(macOs 不需要安装) -// LoggerService.addNormalLine("download python 2.x...") -// if (AgentEnv.getOS() != OSType.MAC_OS) { -// helper.getTool(CodeccToolType.PYTHON2, THIRD_PYTHON2_TAR_FILE, Runnable { -// setupPython2(WorkspaceUtils.getLandun(), THIRD_PYTHON2_TAR_FILE) -// }) -// } - - // 安装coverity -// if (coverityConfig.tools.contains("COVERITY")) { -// // 1.1 拉取coverity -// LoggerService.addNormalLine("download coverity...(该耗时可能比较长,请耐心等候)") -// // 因为coverity有1G多,所以本地md5存起来,不保留原压缩文件 -// helper.getTool(CodeccToolType.COVERITY, THIRD_COVERITY_FILE, Runnable { -// setupCov() -// }) -// } - - // 安装klocwork -// if (coverityConfig.tools.contains("KLOCWORK")) { -// // 1.1 拉取coverity -// LoggerService.addNormalLine("download klocwork...(该耗时可能比较长,请耐心等候)") -// helper.getTool(CodeccToolType.KLOCWORK, THIRD_KLOCWORK_FILE, Runnable { -// FileUtil.unzipTgzFile(THIRD_KLOCWORK_FILE.canonicalPath, THIRD_CODECC_FOLDER) -// THIRD_KLOCWORK_FILE.deleteOnExit() -// }) -// } - - // 安装node-eslint - if (coverityConfig.tools.contains("ESLINT")) { - LoggerService.addNormalLine("download node-v8.9.0-linux-x64_eslint...") - helper.getTool(CodeccToolType.ESLINT, THIRD_NODE_FILE, Runnable { - FileUtil.unzipTgzFile(THIRD_NODE_FILE.canonicalPath, THIRD_CODECC_FOLDER) - }) - } - - // 安装pylint - if (coverityConfig.tools.contains("PYLINT")) { - LoggerService.addNormalLine("download pylint2...") - helper.getTool(CodeccToolType.PYLINT2, THIRD_PYLINT2_FILE, Runnable { - FileUtil.unzipFile(THIRD_PYLINT2_FILE.canonicalPath, THIRD_CODECC_FOLDER) - }) - - LoggerService.addNormalLine("download pylint3...") - helper.getTool(CodeccToolType.PYLINT3, THIRD_PYLINT3_FILE, Runnable { - FileUtil.unzipFile(THIRD_PYLINT3_FILE.canonicalPath, THIRD_CODECC_FOLDER) - }) - } - - // 安装gometalinter - if (coverityConfig.tools.contains("GOML")) { - LoggerService.addNormalLine("download golang...") - helper.getTool(CodeccToolType.GOLANG, THIRD_GOROOT_FILE, Runnable { - FileUtil.unzipTgzFile(THIRD_GOROOT_FILE.canonicalPath, THIRD_CODECC_FOLDER) - }) - - LoggerService.addNormalLine("download gometalinter...") - helper.getTool(CodeccToolType.GOMETALINTER, THIRD_GOMETALINTER_FILE, Runnable { - FileUtil.unzipFile(THIRD_GOMETALINTER_FILE.canonicalPath, THIRD_CODECC_FOLDER) - }) - } - - // 安装jdk8 - if (coverityConfig.tools.contains("CCN") && (AgentEnv.getOS() == OSType.LINUX)) { - LoggerService.addNormalLine("download jdk8...") - helper.getTool(CodeccToolType.JDK8, THIRD_JDK_FILE, Runnable { - FileUtil.unzipTgzFile(THIRD_JDK_FILE.canonicalPath, THIRD_CODECC_FOLDER) - }) - } - } - - fun setUpPython3(coverityConfig: CodeccExecuteConfig) { - // 安装python 3.x - LoggerService.addNormalLine("download python 3.x") - helper.getTool(CodeccToolType.PYTHON3, THIRD_PYTHON3_TAR_FILE, Runnable { - setupPython3(WorkspaceUtils.getLandun(), THIRD_PYTHON3_TAR_FILE) - }) - } - - fun donwloadScript() { - // 拉取coverity python脚本 - LoggerService.addNormalLine("download cov script...") - helper.downloadCovScript() - - // 拉取多工具python脚本 - LoggerService.addNormalLine("download tools script...") - helper.downloadToolScript() - } - - fun windowsDonwloadScript() { - // 拉取coverity python脚本 - LoggerService.addNormalLine("download cov script...") - helper.windowsDownloadCovScript() - - // 拉取多工具python脚本 - LoggerService.addNormalLine("download tools script...") - helper.windowsDownloadToolScript() - } - - private fun setupCov() { - FileUtil.unzipTgzFile(THIRD_COVERITY_FILE.canonicalPath, THIRD_CODECC_FOLDER) - // 执行相关命令, 加上执行权限 - val commands = mutableListOf("chmod +x ${THIRD_COVERITY_FILE.canonicalPath.removeSuffix(".tar.gz")}/bin/cov-*") - LoggerService.addNormalLine("execute chmod command: $commands") - val script = File(WorkspaceUtils.getLandun(), "paas_cov_python_script.sh") - script.deleteOnExit() - script.writeText(commands.joinToString(System.lineSeparator())) - CommandLineUtils.execute(script, WorkspaceUtils.getLandun(), true) - THIRD_COVERITY_FILE.deleteOnExit() - } - - private fun setupPython2(workspace: File, pythonFile: File): String { - try { - LoggerService.addNormalLine("安装python: ${pythonFile.canonicalPath}") - // 先解压tgz - val tmpDir = Files.createTempDir() - tmpDir.deleteOnExit() - FileUtil.unzipTgzFile(pythonFile.canonicalPath, tmpDir.canonicalPath) - - // 执行相关命令 - val commands = mutableListOf() - commands.add("cd $tmpDir/${pythonFile.name.removeSuffix(".tgz")}") - commands.add("chmod +x ./configure") - commands.add("chmod +x ./Parser/asdl_c.py") - commands.add("chmod +x Python/makeopcodetargets.py") - commands.add("./configure --prefix=${pythonFile.canonicalPath.removeSuffix(".tgz")}") - commands.add("make && make install") - commands.forEach { LoggerService.addNormalLine(it) } - - val script = File(workspace, "paas_codecc_python_script.sh") - script.deleteOnExit() - script.writeText(commands.joinToString(System.lineSeparator())) - return CommandLineUtils.execute(script, workspace, true) - } catch (e: Exception) { - throw throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_TASK_OPERATE_FAIL, - errorMsg = "安装python2失败: ${e.message}" - ) - } - } - - private fun setupPython3(workspace: File, pythonFile: File) { - try { - // 解压tgz - val pythonPath = pythonFile.canonicalPath.removeSuffix(".tgz") - LoggerService.addNormalLine("解压${pythonFile.name}到: $pythonFile") - FileUtil.unzipTgzFile(pythonFile.canonicalPath, pythonPath) - - // 执行相关命令 - CommandLineUtils.execute("chmod -R 755 $pythonPath/bin/python", workspace, true) - } catch (e: Exception) { - throw throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_TASK_OPERATE_FAIL, - errorMsg = "安装python3失败: ${e.message}" - ) - } - } - - // 命令检查python是否能用 - fun pythonExist(pythonDir: File): Boolean { - val cmd = "$pythonDir -V" - return try { - val result = CommandLineUtils.execute(cmd, null, true) - LoggerService.addNormalLine("check python result is : $result") - true - } catch (e: Exception) { - LoggerService.addNormalLine("check python result is : ${e.message}") - false - } - } - - fun installMacPython(): String { - val cmd = "sh /data/soda/apps/python/python_install.sh" - return CommandLineUtils.execute(cmd, null, true) - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccParamsHelper.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccParamsHelper.kt deleted file mode 100644 index 0e764f8c823..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccParamsHelper.kt +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.fasterxml.jackson.core.type.TypeReference -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.common.api.exception.TaskExecuteException -import com.tencent.devops.common.api.pojo.ErrorType -import com.tencent.devops.common.api.util.JsonUtil -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.plugin.codecc.pojo.coverity.CoverityProjectType -import com.tencent.devops.plugin.codecc.pojo.coverity.ProjectLanguage -import com.tencent.devops.plugin.worker.pojo.CodeccExecuteConfig -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants -import com.tencent.devops.plugin.worker.task.codecc.WindowsCodeccConstants -import com.tencent.devops.common.api.pojo.ErrorCode -import com.tencent.devops.worker.common.CommonEnv -import com.tencent.devops.worker.common.api.utils.ThirdPartyAgentBuildInfoUtils -import com.tencent.devops.worker.common.env.AgentEnv -import com.tencent.devops.worker.common.env.BuildEnv -import com.tencent.devops.worker.common.env.BuildType -import com.tencent.devops.worker.common.logger.LoggerService -import java.io.File - -object CodeccParamsHelper { - fun addCommonParams(list: MutableList, codeccExecuteConfig: CodeccExecuteConfig) { - val buildId = codeccExecuteConfig.buildVariables.buildId - val taskParams = codeccExecuteConfig.buildTask.params ?: mapOf() - val repoScmType = CodeccRepoHelper.getScmType(codeccExecuteConfig.repos) - - list.add(taskParams["codeCCTaskName"] ?: "") - list.add("-DLANDUN_BUILDID=$buildId") - list.add("-DCERT_TYPE=${CodeccRepoHelper.getCertType(codeccExecuteConfig.repos)}") - list.add("-DSCM_TYPE=$repoScmType") - - val svnUerPassPair = CommonEnv.getSvnHttpCredential() ?: codeccExecuteConfig.repos.firstOrNull()?.svnUerPassPair - if (svnUerPassPair != null) { - list.add("-D${LinuxCodeccConstants.SVN_USER}=${svnUerPassPair.first}") - list.add("-D${LinuxCodeccConstants.SVN_PASSWORD}='${svnUerPassPair.second}'") - } - - if (repoScmType == "svn") { - if (svnUerPassPair == null) list.add("-DSCM_SSH_ACCESS=$repoScmType") - } - - list.add("-DREPO_URL_MAP='${getRepoUrlMap(codeccExecuteConfig)}'") - list.add("-DREPO_RELPATH_MAP='${getRepoRealPathMap(codeccExecuteConfig)}'") - list.add("-DREPO_SCM_RELPATH_MAP='${getRepoScmRelPathMap(codeccExecuteConfig)}'") - list.add("-DSUB_CODE_PATH_LIST=${taskParams["path"] ?: ""}") - list.add("-DLD_ENV_TYPE=${getEnvType()}") - - // 构建机信息 - if (BuildEnv.getBuildType() == BuildType.AGENT) { - LoggerService.addNormalLine("检测到这是第三方构建机") - list.add("-DDEVOPS_PROJECT_ID=${AgentEnv.getProjectId()}") - list.add("-DDEVOPS_BUILD_TYPE=${BuildType.AGENT.name}") - list.add("-DDEVOPS_AGENT_ID=${AgentEnv.getAgentId()}") - list.add("-DDEVOPS_AGENT_SECRET_KEY=${AgentEnv.getAgentSecretKey()}") - list.add("-DDEVOPS_AGENT_VM_SID=${ThirdPartyAgentBuildInfoUtils.getBuildInfo()!!.vmSeqId}") - } else if (BuildEnv.getBuildType() == BuildType.DOCKER) { - LoggerService.addNormalLine("检测到这是docker公共构建机") - list.add("-DDEVOPS_PROJECT_ID=${AgentEnv.getProjectId()}") - list.add("-DDEVOPS_BUILD_TYPE=${BuildType.DOCKER.name}") - list.add("-DDEVOPS_AGENT_ID=${AgentEnv.getAgentId()}") - list.add("-DDEVOPS_AGENT_SECRET_KEY=${AgentEnv.getAgentSecretKey()}") - list.add("-DDEVOPS_AGENT_VM_SID=") - } - - list.add("-DDEVOPS_PROJECT_ID=${codeccExecuteConfig.buildVariables.projectId}") - list.add("-DDEVOPS_PIPELINE_ID=${codeccExecuteConfig.buildVariables.pipelineId}") - list.add("-DDEVOPS_VMSEQ_ID=${codeccExecuteConfig.buildVariables.vmSeqId}") - } - - private fun getRepoScmRelPathMap(codeccExecuteConfig: CodeccExecuteConfig): String { - return toMapString( - codeccExecuteConfig.repos.map { - it.repoHashId to it.relativePath - }.toMap() - ) - } - - private fun getRepoRealPathMap(codeccExecuteConfig: CodeccExecuteConfig): String { - return toMapString( - codeccExecuteConfig.repos.map { - it.repoHashId to it.relPath - }.toMap() - ) - } - - private fun getRepoUrlMap(codeccExecuteConfig: CodeccExecuteConfig): String { - return toMapString( - codeccExecuteConfig.repos.map { - it.repoHashId to it.url - }.toMap() - ) - } - - private fun toMapString(toMap: Map): String { - val sb = StringBuilder() - sb.append("{") - toMap.entries.forEach { - sb.append("\"${it.key}\":\"${it.value}\"") - sb.append(",") - } - sb.deleteCharAt(sb.length - 1) - sb.append("}") - return sb.toString() - } - - private fun getEnvType(): String { - // 第三方机器 - return if (BuildEnv.getBuildType() == BuildType.AGENT) { - when (AgentEnv.getOS()) { - OSType.MAC_OS -> "MAC_THIRD_PARTY" - OSType.WINDOWS -> "WIN_THIRD_PARTY" - else -> "LINUX_THIRD_PARTY" - } - } else { - "PUBLIC" - } - } - private val map = mapOf( - ProjectLanguage.C.name to CoverityProjectType.COMPILE, - ProjectLanguage.C_PLUS_PLUSH.name to CoverityProjectType.COMPILE, - ProjectLanguage.C_CPP.name to CoverityProjectType.COMPILE, - ProjectLanguage.OBJECTIVE_C.name to CoverityProjectType.COMPILE, - ProjectLanguage.OC.name to CoverityProjectType.COMPILE, - ProjectLanguage.C_SHARP.name to CoverityProjectType.COMPILE, - ProjectLanguage.JAVA.name to CoverityProjectType.COMPILE, - ProjectLanguage.PYTHON.name to CoverityProjectType.UN_COMPILE, - ProjectLanguage.JAVASCRIPT.name to CoverityProjectType.UN_COMPILE, - ProjectLanguage.JS.name to CoverityProjectType.UN_COMPILE, - ProjectLanguage.PHP.name to CoverityProjectType.UN_COMPILE, - ProjectLanguage.RUBY.name to CoverityProjectType.UN_COMPILE, - ProjectLanguage.LUA.name to CoverityProjectType.UN_COMPILE, - ProjectLanguage.GOLANG.name to CoverityProjectType.COMBINE, - ProjectLanguage.SWIFT.name to CoverityProjectType.COMBINE, - ProjectLanguage.TYPESCRIPT.name to CoverityProjectType.UN_COMPILE, - ProjectLanguage.KOTLIN.name to CoverityProjectType.COMPILE, - ProjectLanguage.OTHERS.name to CoverityProjectType.UN_COMPILE - ) - - /** - * C/C++ 编译型 - * Objective-C/C++ 编译型 - * C# 编译型 - * Java 编译型 - * Python 非编译型 - * JavaScript 非编译型 - * PHP 非编译型 - * Ruby 非编译型 - */ - - fun getProjectType(languagesStr: String?): CoverityProjectType { - if (languagesStr.isNullOrBlank()) return CoverityProjectType.UN_COMPILE - - // 此处为了新引擎兼容,新引擎传递的参数是真实类型json,而不是单纯的String - // 而CodeCC是用x,y,z这种方式对待List,所以在这强转并写入params中供CodeCC读取 - val languages = JsonUtil.to(languagesStr!!, object : TypeReference>() {}) - - if (languages.isEmpty()) { - return CoverityProjectType.UN_COMPILE - } - - var type = map[languages[0]] - - languages.forEach { - val currentType = map[it] - if (type != null) { - if (currentType != null && type != currentType) { - return CoverityProjectType.COMBINE - } - } else { - type = currentType - } - } - - return type ?: CoverityProjectType.UN_COMPILE - } - - fun getCovPyFile(scriptType: BuildScriptType, codeccWorkspace: File): String { - return if (scriptType == BuildScriptType.SHELL) { - val shareCoverityFile = LinuxCodeccConstants.getCovPyFile() - if (!shareCoverityFile.exists()) { - throw throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_TASK_OPERATE_FAIL, - errorMsg = "The coverity file (${shareCoverityFile.canonicalPath}) is not exist" - ) - } - val localCoverityFile = File(codeccWorkspace, shareCoverityFile.name) - shareCoverityFile.copyTo(localCoverityFile, true) - return localCoverityFile.canonicalPath - } else { - WindowsCodeccConstants.WINDOWS_COV_PY_FILE.canonicalPath - } - } - - fun getToolPyFile(scriptType: BuildScriptType, codeccWorkspace: File): String { - return if (scriptType == BuildScriptType.SHELL) { - val shareToolFile = LinuxCodeccConstants.getToolPyFile() - if (AgentEnv.getOS() != OSType.MAC_OS && !shareToolFile.exists()) { - throw throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_RESOURCE_NOT_FOUND, - errorMsg = "The mutli tool file (${shareToolFile.canonicalPath}) is not exist" - ) - } - val localToolFile = File(codeccWorkspace, shareToolFile.name) - shareToolFile.copyTo(localToolFile, true) - return localToolFile.canonicalPath - } else { - WindowsCodeccConstants.WINDOWS_TOOL_PY_FILE.canonicalPath - } - } - - fun getPython3Path(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.PYTHON3_PATH.canonicalPath - } else { - WindowsCodeccConstants.WINDOWS_PYTHON3_PATH.canonicalPath - } - } - - fun getPython2Path(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.PYTHON2_PATH.canonicalPath - } else { - WindowsCodeccConstants.WINDOWS_PYTHON2_PATH.canonicalPath - } - } - - fun getCovToolPath(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.COVRITY_HOME - } else { - WindowsCodeccConstants.WINDOWS_COVRITY_HOME.canonicalPath - } - } - - fun getKlocToolPath(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.KLOCWORK_PATH.canonicalPath - } else { - WindowsCodeccConstants.WINDOWS_KLOCWORK_HOME.canonicalPath - } - } - - fun getPyLint2Path(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.PYLINT2_PATH - } else { - WindowsCodeccConstants.WINDOWS_PYLINT2_PATH.canonicalPath - } - } - - fun getPyLint3Path(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.PYLINT3_PATH - } else { - WindowsCodeccConstants.WINDOWS_PYLINT3_PATH.canonicalPath - } - } - - fun getGoRootPath(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.GOROOT_PATH - } else { - WindowsCodeccConstants.WINDOWS_GOROOT_PATH.canonicalPath - } - } - - fun getJdkPath(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.JDK_PATH - } else { - WindowsCodeccConstants.WINDOWS_JDK_PATH.canonicalPath - } - } - - fun getNodePath(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.NODE_PATH - } else { - WindowsCodeccConstants.WINDOWS_NODE_PATH.canonicalPath - } - } - - fun getGoMetaLinterPath(scriptType: BuildScriptType): String { - return if (scriptType == BuildScriptType.SHELL) { - LinuxCodeccConstants.GOMETALINTER_PATH - } else { - WindowsCodeccConstants.WINDOWS_GOMETALINTER_PATH.canonicalPath - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccRepoHelper.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccRepoHelper.kt deleted file mode 100644 index 5f9fef2adb4..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccRepoHelper.kt +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.tencent.devops.common.api.enums.RepositoryConfig -import com.tencent.devops.common.api.enums.RepositoryType -import com.tencent.devops.common.api.exception.InvalidParamException -import com.tencent.devops.common.api.util.EnvUtils -import com.tencent.devops.common.pipeline.pojo.element.agent.CodeGitElement -import com.tencent.devops.common.pipeline.pojo.element.agent.CodeGitlabElement -import com.tencent.devops.common.pipeline.pojo.element.agent.CodeSvnElement -import com.tencent.devops.common.pipeline.pojo.element.agent.GithubElement -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement -import com.tencent.devops.common.pipeline.utils.RepositoryConfigUtils.buildConfig -import com.tencent.devops.common.pipeline.utils.RepositoryConfigUtils.replaceCodeProp -import com.tencent.devops.plugin.worker.pojo.CodeccExecuteConfig -import com.tencent.devops.plugin.worker.task.scm.util.RepositoryUtils -import com.tencent.devops.plugin.worker.task.scm.util.SvnUtil -import com.tencent.devops.common.api.pojo.ErrorCode -import com.tencent.devops.process.pojo.BuildTask -import com.tencent.devops.process.pojo.BuildVariables -import com.tencent.devops.common.api.pojo.ErrorType -import com.tencent.devops.process.pojo.task.PipelineBuildTaskInfo -import com.tencent.devops.repository.pojo.CodeGitRepository -import com.tencent.devops.repository.pojo.CodeGitlabRepository -import com.tencent.devops.repository.pojo.CodeSvnRepository -import com.tencent.devops.repository.pojo.GithubRepository -import com.tencent.devops.worker.common.api.ApiFactory -import com.tencent.devops.worker.common.api.process.BuildTaskSDKApi -import com.tencent.devops.common.api.exception.TaskExecuteException -import com.tencent.devops.worker.common.utils.CredentialUtils - -@Suppress("ALL") -object CodeccRepoHelper { - - private val pipelineTaskApi = ApiFactory.create(BuildTaskSDKApi::class) - private val repoElementTypes = setOf( - CodeSvnElement.classType, - CodeGitElement.classType, - CodeGitlabElement.classType, - GithubElement.classType - ) - private val codeccElementTypes = setOf(LinuxCodeCCScriptElement.classType, LinuxPaasCodeCCScriptElement.classType) - - fun getCodeccRepos( - buildTask: BuildTask, - buildVariables: BuildVariables - ): List { - val buildTasks = pipelineTaskApi.getAllBuildTask().data - ?: throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_TASK_OPERATE_FAIL, - errorMsg = "get build task fail" - ) - val codeccTask = buildTasks.first { it.taskType in codeccElementTypes } - - val repoItemList = mutableSetOf() - - buildTasks.filter { it.containerId == codeccTask.containerId && it.taskType in repoElementTypes }.forEach { - val item = when (it.taskType) { - CodeSvnElement.classType -> { - CodeccExecuteConfig.RepoItem( - repositoryConfig = replaceCodeProp(buildConfig(it), buildVariables.variables), - type = "SVN", - relPath = EnvUtils.parseEnv(it.getTaskParam("path"), buildVariables.variables), - relativePath = EnvUtils.parseEnv(it.getTaskParam("svnPath"), buildVariables.variables) - ) - } - CodeGitElement.classType -> { - CodeccExecuteConfig.RepoItem( - repositoryConfig = replaceCodeProp(buildConfig(it), buildVariables.variables), - type = "GIT", - relPath = EnvUtils.parseEnv(it.getTaskParam("path"), buildVariables.variables) - ) - } - CodeGitlabElement.classType -> { - CodeccExecuteConfig.RepoItem( - repositoryConfig = replaceCodeProp(buildConfig(it), buildVariables.variables), - type = "GIT", - relPath = EnvUtils.parseEnv(it.getTaskParam("path"), buildVariables.variables) - ) - } - GithubElement.classType -> { - CodeccExecuteConfig.RepoItem( - repositoryConfig = replaceCodeProp(buildConfig(it), buildVariables.variables), - type = "GIT", - relPath = EnvUtils.parseEnv(it.getTaskParam("path"), buildVariables.variables) - ) - } - else -> { - throw TaskExecuteException( - errorType = ErrorType.USER, - errorCode = ErrorCode.USER_TASK_OPERATE_FAIL, - errorMsg = "get codecc task fail" - ) - } - } - repoItemList.add(item) - } - - // 新的拉代码插件接入模式 - val newRepoTaskIds = buildTask.buildVariable?.filter { it.key.startsWith("bk_repo_taskId_") }?.values - newRepoTaskIds?.filter { taskId -> - val containerId = buildTask.buildVariable!!["bk_repo_container_id_$taskId"] - containerId.isNullOrBlank() || containerId == codeccTask.containerId - }?.forEach { taskId -> - val repoConfigType = buildTask.buildVariable!!["bk_repo_config_type_$taskId"] - val repoType = buildTask.buildVariable!!["bk_repo_type_$taskId"]!! - val localPath = buildTask.buildVariable!!["bk_repo_local_path_$taskId"] ?: "" - val relativePath = buildTask.buildVariable!!["bk_repo_code_path_$taskId"] ?: "" - - val item = if (repoConfigType.isNullOrBlank()) { - val url = buildTask.buildVariable!!["bk_repo_code_url_$taskId"]!! - val authType = buildTask.buildVariable!!["bk_repo_auth_type_$taskId"]!! - CodeccExecuteConfig.RepoItem( - repositoryConfig = null, - type = repoType, - relPath = localPath, - relativePath = relativePath, - url = url, - authType = authType - ) - } else { - val value = if (repoConfigType == RepositoryType.ID.name) { - buildTask.buildVariable!!["bk_repo_hashId_$taskId"] - } else { - buildTask.buildVariable!!["bk_repo_name_$taskId"] - } - CodeccExecuteConfig.RepoItem( - repositoryConfig = buildConfig(value!!, RepositoryType.valueOf(repoConfigType!!)), - type = repoType, - relPath = localPath, - relativePath = relativePath - ) - } - repoItemList.add(item) - } - - return repoItemList.map { - if (it.repositoryConfig != null) { - val repo = RepositoryUtils.getRepository(it.repositoryConfig) - val authType = when (repo) { - is CodeGitRepository -> { - val authType = repo.authType?.name?.toUpperCase() - if (authType.isNullOrBlank()) "HTTP" else authType!! - } - is CodeSvnRepository -> { - val authType = repo.svnType?.toUpperCase() - if (authType.isNullOrBlank()) "SSH" else authType!! - } - is CodeGitlabRepository -> "HTTP" - is GithubRepository -> "HTTP" - else -> "SSH" - } - it.url = repo.url - it.authType = authType - it.repoHashId = repo.repoHashId ?: "" - - if (repo is CodeSvnRepository && authType == "HTTP") { - val credentialsWithType = CredentialUtils.getCredentialWithType(repo.credentialId) - val credentials = credentialsWithType.first - val credentialType = credentialsWithType.second - val svnCredential = SvnUtil.getSvnCredential(repo, credentials, credentialType) - it.svnUerPassPair = Pair(svnCredential.username, svnCredential.password) - } - } - it - } - } - - fun getScmType(repos: List): String { - return repos.map { it.type }.first().toLowerCase() // 每次扫描支持一种类型代码库,其他情况先不考虑 - } - - fun getCertType(repos: List): String { - return repos.map { it.authType }.first() // 每次扫描支持一种类型代码库认证类型,其他情况先不考虑 - } - - private fun buildConfig(task: PipelineBuildTaskInfo): RepositoryConfig { - return when (task.taskType) { - CodeGitElement.classType, CodeSvnElement.classType, CodeGitlabElement.classType, GithubElement.classType -> - RepositoryConfig( - task.getTaskParam("repositoryHashId"), - task.getTaskParam("repositoryName"), - RepositoryType.parseType(task.getTaskParam("repositoryType")) - ) - else -> throw InvalidParamException("Unknown code element -> ${task.taskType}") - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccScriptUtils.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccScriptUtils.kt deleted file mode 100644 index 78019433ad4..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccScriptUtils.kt +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.fasterxml.jackson.module.kotlin.readValue -import com.tencent.devops.common.api.util.JsonUtil -import com.tencent.devops.common.api.util.OkhttpUtils -import com.tencent.devops.worker.common.api.AbstractBuildResourceApi -import com.tencent.devops.worker.common.api.ApiFactory -import com.tencent.devops.worker.common.api.codecc.CodeccSDKApi -import com.tencent.devops.worker.common.logger.LoggerService -import okhttp3.MediaType -import okhttp3.RequestBody -import java.io.File - -@Suppress("ALL") -class CodeccScriptUtils : AbstractBuildResourceApi() { - - private val api = ApiFactory.create(CodeccSDKApi::class) - - fun downloadScriptFile(codeccWorkspace: File): File { - val codeccScriptConfig = api.getSingleCodeccScript().data - ?: throw RuntimeException("get codecc script config error") - val fileName = codeccScriptConfig.scriptFileName - val fileSizeUrl = codeccScriptConfig.fileSizeUrl - val downloadUrl = codeccScriptConfig.downloadUrl - val codeccHost = codeccScriptConfig.devnetHost - - // 1) get file size - val fileSizeParams = mapOf( - "fileName" to fileName, - "downloadType" to "BUILD_SCRIPT" - ) - val fileSizeRequest = buildPost(fileSizeUrl, RequestBody.create( - MediaType.parse("application/json; charset=utf-8"), - JsonUtil.getObjectMapper().writeValueAsString(fileSizeParams)), mutableMapOf()) - .newBuilder() - .url("$codeccHost$fileSizeUrl") - .build() - val fileSize = OkhttpUtils.doHttp(fileSizeRequest).use { - val data = it.body()!!.string() - LoggerService.addNormalLine("get file size data: $data") - val jsonData = JsonUtil.getObjectMapper().readValue>(data) - if (jsonData["status"] != 0) { - throw RuntimeException("get file size fail!") - } - jsonData["data"] as Int - } - - // 2) download - val downloadParams = mapOf( - "fileName" to fileName, - "downloadType" to "BUILD_SCRIPT", - "beginIndex" to "0", - "btyeSize" to fileSize - ) - val downloadRequest = buildPost(path = downloadUrl, - requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), - JsonUtil.getObjectMapper().writeValueAsString(downloadParams)), - headers = mutableMapOf()) - .newBuilder() - .url("$codeccHost$downloadUrl") - .build() - OkhttpUtils.doHttp(downloadRequest).use { - val data = it.body()!!.string() - LoggerService.addNormalLine("get file content success") - val file = File(codeccWorkspace, fileName) - file.writeText(data) - return file - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccToolHelper.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccToolHelper.kt deleted file mode 100644 index 25b894d85e3..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccToolHelper.kt +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.tencent.devops.common.api.util.FileUtil -import com.tencent.devops.common.api.util.OkhttpUtils -import com.tencent.devops.plugin.codecc.pojo.CodeccToolType -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants -import com.tencent.devops.plugin.worker.task.codecc.WindowsCodeccConstants -import com.tencent.devops.worker.common.api.ApiFactory -import com.tencent.devops.worker.common.api.dispatch.CodeccDownloadApi -import com.tencent.devops.worker.common.env.AgentEnv -import com.tencent.devops.worker.common.logger.LoggerService -import org.springframework.http.HttpStatus -import java.io.File - -class CodeccToolHelper { - private val codeccApi = ApiFactory.create(CodeccDownloadApi::class) - - fun downloadCovScript() { - val covFile = LinuxCodeccConstants.getCovPyFile() - val covScriptMd5 = FileUtil.getMD5(covFile) - val covScriptResponse = codeccApi.downloadCovScript(AgentEnv.getOS(), covScriptMd5) - OkhttpUtils.downloadFile(covScriptResponse, covFile) - } - - fun downloadToolScript() { - val toolFile = LinuxCodeccConstants.getToolPyFile() - val toolsScriptMd5 = FileUtil.getMD5(toolFile) - val toolsScriptResponse = codeccApi.downloadToolScript(AgentEnv.getOS(), toolsScriptMd5) - OkhttpUtils.downloadFile(toolsScriptResponse, toolFile) - } - - fun windowsDownloadCovScript() { - val covScriptMd5 = FileUtil.getMD5(WindowsCodeccConstants.WINDOWS_COV_PY_FILE) - val covScriptResponse = codeccApi.downloadCovScript(AgentEnv.getOS(), covScriptMd5) - OkhttpUtils.downloadFile(covScriptResponse, WindowsCodeccConstants.WINDOWS_COV_PY_FILE) - } - - fun windowsDownloadToolScript() { - val toolsScriptMd5 = FileUtil.getMD5(WindowsCodeccConstants.WINDOWS_TOOL_PY_FILE) - val toolsScriptResponse = codeccApi.downloadToolScript(AgentEnv.getOS(), toolsScriptMd5) - OkhttpUtils.downloadFile(toolsScriptResponse, WindowsCodeccConstants.WINDOWS_TOOL_PY_FILE) - } - - // toolFile: 工具文件下载到绝对路径 - // callback: 下载完工具执行的操作 - fun getTool(toolName: CodeccToolType, toolFile: File, callback: Runnable = Runnable { }) { - val md5File = File(toolFile.canonicalPath + ".md5") - val md5 = if (md5File.exists()) md5File.readText() else "" - val response = codeccApi.downloadTool(toolName.name, AgentEnv.getOS(), md5, AgentEnv.is32BitSystem()) - OkhttpUtils.downloadFile(response, toolFile) - if (response.code() != HttpStatus.NOT_MODIFIED.value()) { - callback.run() - // 写入md5 - md5File.writeText(FileUtil.getMD5(toolFile)) - } else { - LoggerService.addNormalLine("$toolName is newest, do not install") - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccUtils.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccUtils.kt deleted file mode 100644 index 5015bff88ff..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/CodeccUtils.kt +++ /dev/null @@ -1,442 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.common.pipeline.enums.BuildScriptType -import com.tencent.devops.common.pipeline.enums.ChannelCode -import com.tencent.devops.plugin.codecc.pojo.coverity.CoverityProjectType -import com.tencent.devops.plugin.worker.pojo.CodeccExecuteConfig -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.COV_TOOLS -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.GO_CI_LINT_PATH -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.PHPCS_TOOL_PATH -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.STYLE_TOOL_PATH -import com.tencent.devops.plugin.worker.task.codecc.LinuxCodeccConstants.SVN_PASSWORD -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.addCommonParams -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getCovToolPath -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getGoMetaLinterPath -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getGoRootPath -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getJdkPath -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getKlocToolPath -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getNodePath -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getPyLint2Path -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getPyLint3Path -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getPython2Path -import com.tencent.devops.plugin.worker.task.codecc.util.CodeccParamsHelper.getPython3Path -import com.tencent.devops.process.utils.PIPELINE_TURBO_TASK_ID -import com.tencent.devops.worker.common.CommonEnv -import com.tencent.devops.worker.common.env.AgentEnv -import com.tencent.devops.worker.common.env.BuildEnv -import com.tencent.devops.worker.common.logger.LoggerService -import com.tencent.devops.worker.common.utils.BatScriptUtil -import com.tencent.devops.worker.common.utils.ShellUtil -import org.slf4j.LoggerFactory -import java.io.File -import kotlin.math.max - -@Suppress("ALL") -open class CodeccUtils { - - private lateinit var coverityStartFile: String - private lateinit var toolsStartFile: String - private lateinit var codeccStartFile: String - - private val logger = LoggerFactory.getLogger(CodeccUtils::class.java) - - init { - LoggerService.addNormalLine("AgentEnv.isProd(): ${AgentEnv.isProd()}") - // 第三方构建机 - if (BuildEnv.isThirdParty()) { - LoggerService.addNormalLine("检测到这是非公共构建机") - } - } - - fun executeCommand(codeccExecuteConfig: CodeccExecuteConfig): String { - val codeccWorkspace = getCodeccWorkspace(codeccExecuteConfig) - try { - initData(codeccExecuteConfig.scriptType, codeccWorkspace) - return doRun(codeccExecuteConfig, codeccWorkspace) - } finally { - codeccWorkspace.deleteRecursively() - } - } - - private fun getCodeccWorkspace(codeccExecuteConfig: CodeccExecuteConfig): File { - val buildId = codeccExecuteConfig.buildVariables.buildId - val workspace = codeccExecuteConfig.workspace - - // Copy the nfs coverity file to workspace - LoggerService.addNormalLine("get the workspace: ${workspace.canonicalPath}") - LoggerService.addNormalLine( - "get the workspace parent: ${workspace.parentFile?.canonicalPath} | '${File.separatorChar}'") - LoggerService.addNormalLine("get the workspace parent string: ${workspace.parent}") - - val tempDir = File(workspace, ".temp") - LoggerService.addNormalLine("get the workspace path parent: ${tempDir.canonicalPath}") - val codeccWorkspace = File(tempDir, "codecc_coverity_$buildId") - if (!codeccWorkspace.exists()) { - codeccWorkspace.mkdirs() - } - return codeccWorkspace - } - - private fun doRun(codeccExecuteConfig: CodeccExecuteConfig, codeccWorkspace: File): String { - val scriptType = codeccExecuteConfig.scriptType - return if (scriptType == BuildScriptType.BAT) { - CodeccExecuteHelper.executeCodecc( - codeccExecuteConfig = codeccExecuteConfig, - covFun = this::doCoverityCommand, - toolFun = this::doCodeccToolCommand - ) - } else { - codeccStartFile = CodeccScriptUtils().downloadScriptFile(codeccWorkspace).canonicalPath - doCodeccSingleCommand(codeccExecuteConfig) - } - } - - private fun initData(scriptType: BuildScriptType, codeccWorkspace: File) { - coverityStartFile = CodeccParamsHelper.getCovPyFile(scriptType, codeccWorkspace) - toolsStartFile = CodeccParamsHelper.getToolPyFile(scriptType, codeccWorkspace) - LoggerService.addNormalLine( - "Get the coverity start file($coverityStartFile), " + - "tools start file($toolsStartFile)" - ) - } - - open fun coverityPreExecute(list: MutableList) { - list.add("export PATH=${getPython2Path(BuildScriptType.SHELL)}:\$PATH\n") - list.add("export LANG=zh_CN.UTF-8\n") - CommonEnv.getCommonEnv().forEach { (key, value) -> - list.add("export $key=$value\n") - } - list.add("python -V\n") - list.add("pwd\n") - } - - private fun doCoverityCommand(codeccExecuteConfig: CodeccExecuteConfig): String { - val workspace = codeccExecuteConfig.workspace - val taskParams = codeccExecuteConfig.buildTask.params ?: mapOf() - val script = taskParams["script"] ?: "" - val scriptType = codeccExecuteConfig.scriptType - val scriptFile = getScriptFile(codeccExecuteConfig, script) - logger.info("Start to execute the script file for script($script)") - - val scanTools = if (codeccExecuteConfig.filterTools.isNotEmpty()) { - codeccExecuteConfig.filterTools - } else { - codeccExecuteConfig.tools - } - val finalScanTools = scanTools.filter { it in COV_TOOLS } - - val list = mutableListOf() - coverityPreExecute(list) - list.add("python") - list.add(coverityStartFile) - - // 添加公共参数 - addCommonParams(list, codeccExecuteConfig) - - // 添加具体业务参数 - list.add("-DIS_SPEC_CONFIG=true") - list.add("-DSCAN_TOOLS=${finalScanTools.joinToString(",").toLowerCase()}") - list.add("-DCOVERITY_RESULT_PATH=${File(coverityStartFile).parent}") - - val buildCmd = when (CodeccParamsHelper.getProjectType(taskParams["languages"]!!)) { - CoverityProjectType.UN_COMPILE -> { - "--no-command --fs-capture-search ." - } - CoverityProjectType.COMPILE -> scriptFile.canonicalPath - CoverityProjectType.COMBINE -> "--fs-capture-search . ${scriptFile.canonicalPath}" - } - - // 工蜂开源扫描就不做限制 - val channelCode = codeccExecuteConfig.buildVariables.variables["pipeline.start.channel"] ?: "" - val coreCount = if (channelCode == ChannelCode.GONGFENGSCAN.name) Runtime.getRuntime().availableProcessors() - else max(Runtime.getRuntime().availableProcessors() / 2, 1) // 用一半的核 - - list.add("-DPROJECT_BUILD_COMMAND=\"--parallel-translate=$coreCount $buildCmd\"") - if (!BuildEnv.isThirdParty()) list.add("-DCOVERITY_HOME_BIN=${getCovToolPath(scriptType)}/bin") - list.add("-DPROJECT_BUILD_PATH=${workspace.canonicalPath}") - list.add("-DSYNC_TYPE=${taskParams["asynchronous"] != "true"}") - if (!BuildEnv.isThirdParty() && scanTools.contains("KLOCWORK")) list.add( - "-DKLOCWORK_HOME_BIN=${getKlocToolPath( - scriptType - )}" - ) - if (taskParams.containsKey("goPath")) list.add("-DGO_PATH=${taskParams["goPath"]}") - list.add("-DSUB_PATH=${getGoRootPath(scriptType)}:$GO_CI_LINT_PATH") - - // 开始执行 - val tag = if (scanTools.contains("COVERITY") && scanTools.contains("KLOCWORK")) "[cov&kw]" - else if (scanTools.contains("KLOCWORK")) "[kw]" - else "[cov]" - printLog(list, tag) - - return executeScript(codeccExecuteConfig, list, "[cov] ") - } - - open fun toolPreExecute(list: MutableList) { - list.add("export PATH=${getPython3Path(BuildScriptType.SHELL)}:\$PATH\n") - list.add("export LANG=zh_CN.UTF-8\n") - list.add("export PATH=/data/bkdevops/apps/codecc/go/bin:/data/bkdevops/apps/codecc/gometalinter/bin:\$PATH\n") - - CommonEnv.getCommonEnv().forEach { (key, value) -> - list.add("export $key=$value\n") - } - } - - private fun doCodeccToolCommand(codeccExecuteConfig: CodeccExecuteConfig): String { - val workspace = codeccExecuteConfig.workspace - val scriptType = codeccExecuteConfig.scriptType - - val scanTools = if (codeccExecuteConfig.filterTools.isNotEmpty()) { - codeccExecuteConfig.filterTools - } else { - codeccExecuteConfig.tools - } - if (scanTools.isEmpty()) return "scan tools is empty" - - val finalScanTools = scanTools.minus(COV_TOOLS) - - val list = mutableListOf() - toolPreExecute(list) - list.add("python -V\n") - list.add("pwd\n") - list.add("python") - list.add(toolsStartFile) - - // 添加公共参数 - addCommonParams(list, codeccExecuteConfig) - - // 添加具体业务参数 - list.add("-DSCAN_TOOLS=${finalScanTools.joinToString(",").toLowerCase()}") - list.add("-DOFFLINE=true") - list.add("-DDATA_ROOT_PATH=${File(toolsStartFile).parent}") - list.add("-DSTREAM_CODE_PATH=${workspace.canonicalPath}") - list.add("-DPY27_PATH=${getPython2Path(scriptType)}") - list.add("-DPY35_PATH=${getPython3Path(scriptType)}") - if (finalScanTools.contains("PYLINT")) { - list.add("-DPY27_PYLINT_PATH=${getPyLint2Path(scriptType)}") - list.add("-DPY35_PYLINT_PATH=${getPyLint3Path(scriptType)}") - } else { - // 两个参数是必填的 - // 把路径配置成其他可用路径就可以 - list.add("-DPY27_PYLINT_PATH=${workspace.canonicalPath}") - list.add("-DPY35_PYLINT_PATH=${workspace.canonicalPath}") - } - var subPath = if (BuildEnv.isThirdParty()) { - "" - } else { - "/usr/local/svn/bin:/usr/local/bin:/data/bkdevops/apps/coverity:" - } - subPath = "$subPath${getJdkPath(scriptType)}:${getNodePath(scriptType)}:" + - "${getGoMetaLinterPath(scriptType)}:${getGoRootPath(scriptType)}:$STYLE_TOOL_PATH:$PHPCS_TOOL_PATH" - list.add("-DSUB_PATH=$subPath") - list.add("-DGOROOT=/data/bkdevops/apps/codecc/go") - - // 打印日志 - printLog(list, "[tools]") - - return executeScript(codeccExecuteConfig, list, "[tool] ") - } - - open fun doPreCodeccSingleCommand(command: MutableList) { - command.add("export PATH=${getPython3Path(BuildScriptType.SHELL)}:\$PATH\n") - command.add("export LANG=zh_CN.UTF-8\n") - command.add( - "export PATH=/data/bkdevops/apps/codecc/go/bin:/data/bkdevops/apps/codecc/gometalinter/bin:\$PATH\n") - - CommonEnv.getCommonEnv().forEach { (key, value) -> - command.add("export $key=$value\n") - } - - command.add("python -V\n") - command.add("pwd\n") - } - - fun doCodeccSingleCommand(codeccExecuteConfig: CodeccExecuteConfig): String { - val command = mutableListOf() - doPreCodeccSingleCommand(command) - - val workspace = codeccExecuteConfig.workspace - val taskParams = codeccExecuteConfig.buildTask.params ?: mapOf() - val script = taskParams["script"] ?: "" - val scriptType = codeccExecuteConfig.scriptType - val scriptFile = getScriptFile(codeccExecuteConfig, script) - logger.info("Start to execute the script file for script($script)") - - val scanTools = if (codeccExecuteConfig.filterTools.isNotEmpty()) { - codeccExecuteConfig.filterTools - } else { - codeccExecuteConfig.tools - } - if (scanTools.isEmpty()) return "scan tools is empty" - - command.add("python") - command.add(codeccStartFile) - - // 添加公共参数 - addCommonParams(command, codeccExecuteConfig) - - // 添加coverity/klockwork参数 - command.add("-DIS_SPEC_CONFIG=true") - command.add("-DSCAN_TOOLS=${scanTools.joinToString(",").toLowerCase()}") - command.add("-DCOVERITY_RESULT_PATH=${File(coverityStartFile).parent}") - - val buildCmd = when (CodeccParamsHelper.getProjectType(taskParams["languages"])) { - CoverityProjectType.UN_COMPILE -> { - "--no-command --fs-capture-search ." - } - CoverityProjectType.COMPILE -> scriptFile.canonicalPath - CoverityProjectType.COMBINE -> "--fs-capture-search . ${scriptFile.canonicalPath}" - } - - // 工蜂开源扫描就不做限制 - val channelCode = codeccExecuteConfig.buildVariables.variables["pipeline.start.channel"] ?: "" - val coreCount = if (channelCode == ChannelCode.GONGFENGSCAN.name) Runtime.getRuntime().availableProcessors() - else max(Runtime.getRuntime().availableProcessors() / 2, 1) // 用一半的核 - - command.add("-DPROJECT_BUILD_COMMAND=\"--parallel-translate=$coreCount $buildCmd\"") - if (!BuildEnv.isThirdParty()) command.add("-DCOVERITY_HOME_BIN=${getCovToolPath(scriptType)}/bin") - command.add("-DPROJECT_BUILD_PATH=${workspace.canonicalPath}") - command.add("-DSYNC_TYPE=${taskParams["asynchronous"] != "true"}") - if (!BuildEnv.isThirdParty() && scanTools.contains("KLOCWORK")) command.add( - "-DKLOCWORK_HOME_BIN=${getKlocToolPath( - scriptType - )}" - ) - if (taskParams.containsKey("goPath")) command.add("-DGO_PATH=${taskParams["goPath"]}") - - // 多工具 - command.add("-DOFFLINE=true") - command.add("-DDATA_ROOT_PATH=${File(toolsStartFile).parent}") - command.add("-DSTREAM_CODE_PATH=${workspace.canonicalPath}") - command.add("-DPY27_PATH=${getPython2Path(scriptType)}") - command.add("-DPY35_PATH=${getPython3Path(scriptType)}") - if (scanTools.contains("PYLINT")) { - command.add("-DPY27_PYLINT_PATH=${getPyLint2Path(scriptType)}") - command.add("-DPY35_PYLINT_PATH=${getPyLint3Path(scriptType)}") - } else { - // 两个参数是必填的 - // 把路径配置成其他可用路径就可以 - command.add("-DPY27_PYLINT_PATH=${workspace.canonicalPath}") - command.add("-DPY35_PYLINT_PATH=${workspace.canonicalPath}") - } - var subPath = if (BuildEnv.isThirdParty()) { - "" - } else { - "/usr/local/svn/bin:/data/bkdevops/apps/coverity" - } - subPath = "$subPath:${getJdkPath(scriptType)}:" + - "${getNodePath(scriptType)}:${getGoMetaLinterPath(scriptType)}:${getGoRootPath(scriptType)}:" + - "$STYLE_TOOL_PATH:$PHPCS_TOOL_PATH:${getGoRootPath(scriptType)}:$GO_CI_LINT_PATH" - command.add("-DSUB_PATH=$subPath") - command.add("-DGOROOT=/data/bkdevops/apps/codecc/go") - - printLog(command, "[codecc] ") - - return executeScript( - codeccExecuteConfig = codeccExecuteConfig, - list = command, - prefix = "[codecc] " - ) - } - - private fun printLog(list: List, tag: String) { - LoggerService.addNormalLine("$tag command content: ") - list.forEach { - if (!it.startsWith("-DSSH_PRIVATE_KEY") && - !it.startsWith("-DKEY_PASSWORD") && - !it.startsWith("-D$SVN_PASSWORD") - ) { - LoggerService.addNormalLine("$tag $it") - } - } - } - - private fun takeBuildEnvs(coverConfig: CodeccExecuteConfig): List { - val turboTaskId = coverConfig.buildTask.buildVariable?.get(PIPELINE_TURBO_TASK_ID) - return if (turboTaskId.isNullOrBlank()) { - coverConfig.buildVariables.buildEnvs - } else { // 设置编译加速路径 - coverConfig.buildVariables.buildEnvs.plus( - com.tencent.devops.store.pojo.app.BuildEnv( - name = "turbo", - version = "1.0", - binPath = "", - env = mapOf() - ) - ) - } - } - - private fun getScriptFile(codeccExecuteConfig: CodeccExecuteConfig, script: String): File { - return if (AgentEnv.getOS() == OSType.WINDOWS) { - BatScriptUtil.getCommandFile( - buildId = codeccExecuteConfig.buildTask.buildId, - script = script, - dir = codeccExecuteConfig.workspace, - runtimeVariables = codeccExecuteConfig.buildVariables.variables - ) - } else { - ShellUtil.getCommandFile( - buildId = codeccExecuteConfig.buildTask.buildId, - script = script, - dir = codeccExecuteConfig.workspace, - buildEnvs = codeccExecuteConfig.buildVariables.buildEnvs, - runtimeVariables = codeccExecuteConfig.buildVariables.variables - ) - } - } - - private fun executeScript( - codeccExecuteConfig: CodeccExecuteConfig, - list: MutableList, - prefix: String - ): String { - val variables = - codeccExecuteConfig.buildVariables.variables.plus(codeccExecuteConfig.buildTask.buildVariable ?: mapOf()) - return if (AgentEnv.getOS() == OSType.WINDOWS) { - BatScriptUtil.execute( - buildId = codeccExecuteConfig.buildTask.buildId, - script = list.joinToString(" "), - dir = codeccExecuteConfig.workspace, - runtimeVariables = variables, - prefix = prefix) - } else { - ShellUtil.execute( - buildId = codeccExecuteConfig.buildTask.buildId, - script = list.joinToString(" "), - dir = codeccExecuteConfig.workspace, - buildEnvs = takeBuildEnvs(codeccExecuteConfig), - runtimeVariables = variables, - prefix = prefix - ) - } - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/WindowsCodeccUtils.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/WindowsCodeccUtils.kt deleted file mode 100644 index cb9ba9dca14..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/plugin/worker/task/codecc/util/WindowsCodeccUtils.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.plugin.worker.task.codecc.util - -import com.tencent.devops.plugin.worker.task.codecc.WindowsCodeccConstants.WINDOWS_GOMETALINTER_PATH -import com.tencent.devops.plugin.worker.task.codecc.WindowsCodeccConstants.WINDOWS_GOROOT_PATH -import com.tencent.devops.worker.common.CommonEnv - -class WindowsCodeccUtils : CodeccUtils() { - - override fun coverityPreExecute(list: MutableList) { - CommonEnv.getCommonEnv().forEach { (key, value) -> - list.add("set $key=$value\n") - } - - list.add("python -V\n") - list.add("cd\n") - } - - override fun toolPreExecute(list: MutableList) { - list.add( - "set PATH=${WINDOWS_GOROOT_PATH.canonicalPath}\\bin;${WINDOWS_GOMETALINTER_PATH.canonicalPath};%PATH%\n") - - CommonEnv.getCommonEnv().forEach { (key, value) -> - list.add("set $key=$value\n") - } - - list.add("python -V\n") - list.add("cd\n") - } -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/worker/common/api/codecc/CodeccSDKApi.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/worker/common/api/codecc/CodeccSDKApi.kt deleted file mode 100644 index 4df11f9be9b..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/worker/common/api/codecc/CodeccSDKApi.kt +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.worker.common.api.codecc - -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.plugin.codecc.config.CodeccScriptConfig -import okhttp3.Response - -interface CodeccSDKApi { - fun saveTask(projectId: String, pipelineId: String, buildId: String): Result - fun downloadTool(tool: String, osType: OSType, fileMd5: String, is32Bit: Boolean = false): Response - fun downloadToolScript(osType: OSType, fileMd5: String): Response - fun getSingleCodeccScript(): Result -} diff --git a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/worker/common/api/codecc/PluginCodeccResourceApi.kt b/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/worker/common/api/codecc/PluginCodeccResourceApi.kt deleted file mode 100644 index 25b694c4a6d..00000000000 --- a/src/backend/ci/core/plugin/codecc-plugin/worker-plugin-codecc/src/main/kotlin/com/tencent/devops/worker/common/api/codecc/PluginCodeccResourceApi.kt +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.tencent.devops.worker.common.api.codecc - -import com.fasterxml.jackson.module.kotlin.readValue -import com.tencent.devops.common.api.enums.OSType -import com.tencent.devops.common.api.exception.RemoteServiceException -import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.plugin.codecc.config.CodeccScriptConfig -import com.tencent.devops.worker.common.api.AbstractBuildResourceApi -import com.tencent.devops.worker.common.logger.LoggerService -import okhttp3.Protocol -import okhttp3.Response -import org.springframework.http.HttpStatus - -class PluginCodeccResourceApi : AbstractBuildResourceApi(), CodeccSDKApi { - - override fun saveTask(projectId: String, pipelineId: String, buildId: String): Result { - try { - val path = "/ms/plugin/api/build/codecc/save/task/$projectId/$pipelineId/$buildId" - val request = buildPost(path) - val responseContent = request(request, "保存CodeCC原子信息失败") - return Result(responseContent) - } catch (e: Exception) { - LoggerService.addNormalLine("写入codecc任务失败: ${e.message}") - } - return Result("") - } - - override fun downloadTool(tool: String, osType: OSType, fileMd5: String, is32Bit: Boolean): Response { - val path = "/ms/plugin/api/build/codecc/$tool?osType=${osType.name}&fileMd5=$fileMd5&is32Bit=$is32Bit" - val request = buildGet(path) - - val response = requestForResponse(request) - if (response.code() == HttpStatus.NOT_MODIFIED.value()) { - return Response.Builder().request(request) - .protocol(Protocol.HTTP_1_1) - .message("") - .code(HttpStatus.NOT_MODIFIED.value()).build() - } - if (!response.isSuccessful) { - throw RemoteServiceException("下载Codecc的 $tool 工具失败") - } - return response - } - - override fun downloadToolScript(osType: OSType, fileMd5: String): Response { - val path = "/ms/plugin/api/build/codecc/tools/script?osType=${osType.name}&fileMd5=$fileMd5" - val request = buildGet(path) - val response = requestForResponse(request) - if (response.code() == HttpStatus.NOT_MODIFIED.value()) { - return Response.Builder().request(request) - .protocol(Protocol.HTTP_1_1) - .message("") - .code(HttpStatus.NOT_MODIFIED.value()).build() - } - - if (!response.isSuccessful) { - throw RemoteServiceException("下载codecc的多工具执行脚本失败") - } - return response - } - - override fun getSingleCodeccScript(): Result { - val path = "/ms/plugin/api/build/codecc/singleScript" - val request = buildGet(path) - val response = request(request, "获取codecc脚本配置失败") - return objectMapper.readValue(response) - } -} diff --git a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/template/ServiceTemplateInstanceResource.kt b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/template/ServiceTemplateInstanceResource.kt index 59e34f1544b..caab5f4b8e8 100644 --- a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/template/ServiceTemplateInstanceResource.kt +++ b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/template/ServiceTemplateInstanceResource.kt @@ -104,6 +104,29 @@ interface ServiceTemplateInstanceResource { instances: List ): TemplateOperationRet + @ApiOperation("批量更新流水线模板实例") + @PUT + @Path("/projects/{projectId}/templates/{templateId}/updateTemplate") + fun updateTemplate( + @ApiParam(value = "用户ID", required = true, defaultValue = AUTH_HEADER_USER_ID_DEFAULT_VALUE) + @HeaderParam(AUTH_HEADER_USER_ID) + userId: String, + @ApiParam("项目ID", required = true) + @PathParam("projectId") + projectId: String, + @ApiParam("模板ID", required = true) + @PathParam("templateId") + templateId: String, + @ApiParam("版本名", required = true) + @QueryParam("versionName") + versionName: String, + @ApiParam("是否应用模板设置") + @QueryParam("useTemplateSettings") + useTemplateSettings: Boolean, + @ApiParam("模板实例", required = true) + instances: List + ): TemplateOperationRet + @ApiOperation("通过流水线ID获取流水线启动参数") @POST @Path("/projects/{projectId}/templates/{templateId}/pipelines") diff --git a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/template/UserTemplateInstanceResource.kt b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/template/UserTemplateInstanceResource.kt index 1f17f230ef1..5afcb158f37 100644 --- a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/template/UserTemplateInstanceResource.kt +++ b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/api/template/UserTemplateInstanceResource.kt @@ -136,7 +136,7 @@ interface UserTemplateInstanceResource { @ApiParam("模板ID", required = true) @PathParam("templateId") templateId: String, - @ApiParam("版本名", required = true) + @ApiParam("版本号", required = true) @QueryParam("version") version: Long, @ApiParam("是否应用模板设置") diff --git a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/constant/ProcessMessageCode.kt b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/constant/ProcessMessageCode.kt index a7b460cc598..47286b9e932 100644 --- a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/constant/ProcessMessageCode.kt +++ b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/constant/ProcessMessageCode.kt @@ -133,6 +133,7 @@ object ProcessMessageCode { const val ERROR_TEMPLATE_NOT_UPDATE = "2101076" // 该模板无法更新 const val ERROR_PIPELINE_MODEL_MATRIX_YAML_CHECK_ERROR = "2101077" // matrix yaml 格式错误 const val ERROR_TEMPLATE_VERSION_COUNT_EXCEEDS_LIMIT = "2101078" // 模板的版本数量不能超过{0}个 + const val FAIL_TEMPLATE_UPDATE_NUM_TOO_BIG = "2101079" // 模板实例更新数量[{0}]超过系统规定的最大值{1},请调整参数或咨询助手 // 通用参数错误 const val ERROR_RETRY_3_FAILED = "2101989" // 重试3次失败 diff --git a/src/backend/ci/core/process/biz-base/build.gradle.kts b/src/backend/ci/core/process/biz-base/build.gradle.kts index 71b6400dd4e..74125a6774f 100644 --- a/src/backend/ci/core/process/biz-base/build.gradle.kts +++ b/src/backend/ci/core/process/biz-base/build.gradle.kts @@ -35,7 +35,6 @@ dependencies { api(project(":core:dispatch:api-dispatch")) // Dispatch配额实现在dispatch,考虑移除 api(project(":core:project:api-project")) // 依赖读取项目VO api(project(":core:process:api-process")) - api(project(":core:plugin:codecc-plugin:common-codecc")) // MarketBuildUtils依赖了CodeCC,考虑移除 api(project(":core:notify:api-notify")) // 消息通知API,考虑移除 api(project(":core:process:model-process")) api("org.springframework.boot:spring-boot-starter-jooq") diff --git a/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/dao/PipelineBuildVarDao.kt b/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/dao/PipelineBuildVarDao.kt index 1b1b2387c3d..7b41ac3d523 100644 --- a/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/dao/PipelineBuildVarDao.kt +++ b/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/dao/PipelineBuildVarDao.kt @@ -81,7 +81,7 @@ class PipelineBuildVarDao @Autowired constructor() { baseStep.set(VAR_TYPE, valueType) } return baseStep.set(VALUE, value.toString()) - .where(BUILD_ID.eq(buildId).and(KEY.eq(name)).and(READ_ONLY.notEqual(true)) + .where(BUILD_ID.eq(buildId).and(KEY.eq(name)).and(READ_ONLY.isNull.or(READ_ONLY.eq(false))) .and(PROJECT_ID.eq(projectId))) .execute() } diff --git a/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/dao/template/TemplateDao.kt b/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/dao/template/TemplateDao.kt index 64a02305795..768eb782470 100644 --- a/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/dao/template/TemplateDao.kt +++ b/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/dao/template/TemplateDao.kt @@ -304,6 +304,36 @@ class TemplateDao { } } + fun getTemplate( + dslContext: DSLContext, + projectId: String? = null, + templateId: String, + versionName: String?, + version: Long? = null + ): TTemplateRecord { + with(TTemplate.T_TEMPLATE) { + val conditions = mutableListOf() + conditions.add(ID.eq(templateId)) + if (version != null) { + conditions.add(VERSION.eq(version)) + } + if (!versionName.isNullOrBlank()) { + conditions.add(VERSION_NAME.eq(versionName)) + } + if (!projectId.isNullOrBlank()) { + conditions.add(PROJECT_ID.eq(projectId)) + } + return dslContext.selectFrom(this) + .where(conditions) + .orderBy(CREATED_TIME.desc(), VERSION.desc()) + .limit(1) + .fetchOne() ?: throw ErrorCodeException( + errorCode = ProcessMessageCode.ERROR_TEMPLATE_NOT_EXISTS, + defaultMessage = "模板不存在" + ) + } + } + fun getSrcTemplateId(dslContext: DSLContext, projectId: String, templateId: String, type: String? = null): String? { return with(TTemplate.T_TEMPLATE) { val conditions = mutableListOf() diff --git a/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/BuildEndControl.kt b/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/BuildEndControl.kt index dcbfc6bdca5..4f28d177099 100644 --- a/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/BuildEndControl.kt +++ b/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/BuildEndControl.kt @@ -180,9 +180,9 @@ class BuildEndControl @Autowired constructor( // 上报SLA数据 if (buildStatus.isSuccess() || buildStatus == BuildStatus.STAGE_SUCCESS) { - successPipelineCount(this) + successPipelineCount() } else if (buildStatus.isFailure()) { - failPipelineCount(this) + failPipelineCount() } buildDurationTime(buildInfo.startTime!!) @@ -391,32 +391,26 @@ class BuildEndControl @Autowired constructor( ) } - private fun successPipelineCount(event: PipelineBuildFinishEvent) { + private fun successPipelineCount() { Counter .builder("success_pipeline_count") - .tag("projectId", event.projectId) - .tag("pipelineId", event.pipelineId) .register(meterRegistry) .increment() - finishPipelineCount(event) + finishPipelineCount() } - private fun failPipelineCount(event: PipelineBuildFinishEvent) { + private fun failPipelineCount() { Counter .builder("fail_pipeline_count") - .tag("projectId", event.projectId) - .tag("pipelineId", event.pipelineId) .register(meterRegistry) .increment() - finishPipelineCount(event) + finishPipelineCount() } - private fun finishPipelineCount(event: PipelineBuildFinishEvent) { + private fun finishPipelineCount() { Counter .builder("finish_pipeline_count") - .tag("projectId", event.projectId) - .tag("pipelineId", event.pipelineId) .register(meterRegistry) .increment() } diff --git a/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/BuildStartControl.kt b/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/BuildStartControl.kt index d459cb2977e..3194bc9dd1c 100644 --- a/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/BuildStartControl.kt +++ b/src/backend/ci/core/process/biz-engine/src/main/kotlin/com/tencent/devops/process/engine/control/BuildStartControl.kt @@ -148,7 +148,7 @@ class BuildStartControl @Autowired constructor( ) buildLogPrinter.stopLog(buildId = buildId, tag = TAG, jobId = JOB_ID, executeCount = executeCount) - startPipelineCount(this) + startPipelineCount() } private fun PipelineBuildStartEvent.pickUpReadyBuild(executeCount: Int): BuildInfo? { @@ -549,11 +549,9 @@ class BuildStartControl @Autowired constructor( return firstValidStage } - private fun startPipelineCount(event: PipelineBuildStartEvent) { + private fun startPipelineCount() { Counter .builder("start_pipeline_count") - .tag("projectId", event.projectId) - .tag("pipelineId", event.pipelineId) .register(meterRegistry) .increment() } diff --git a/src/backend/ci/core/process/biz-process-sample/src/main/kotlin/com/tencent/devops/process/permission/config/PipelineNotifyConfiguration.kt b/src/backend/ci/core/process/biz-process-sample/src/main/kotlin/com/tencent/devops/process/permission/config/PipelineNotifyConfiguration.kt index 7d8eca0ed31..57aee4ea770 100644 --- a/src/backend/ci/core/process/biz-process-sample/src/main/kotlin/com/tencent/devops/process/permission/config/PipelineNotifyConfiguration.kt +++ b/src/backend/ci/core/process/biz-process-sample/src/main/kotlin/com/tencent/devops/process/permission/config/PipelineNotifyConfiguration.kt @@ -33,11 +33,8 @@ class PipelineNotifyConfiguration { @Bean @ConditionalOnMissingBean(NotifyUrlBuildCmd::class) - fun notifyUrlBuildCmd( - pipelineRepositoryService: PipelineRepositoryService, - pipelineRuntimeService: PipelineRuntimeService, - pipelineBuildFacadeService: PipelineBuildFacadeService - ) = BluekingNotifyUrlCmdImpl(pipelineRepositoryService, pipelineRuntimeService, pipelineBuildFacadeService) + fun notifyUrlBuildCmd(pipelineRepositoryService: PipelineRepositoryService) = + BluekingNotifyUrlCmdImpl(pipelineRepositoryService) @Bean @ConditionalOnMissingBean(NotifyPipelineCmd::class) @@ -52,7 +49,8 @@ class PipelineNotifyConfiguration { pipelineRuntimeService = pipelineRuntimeService, pipelineBuildFacadeService = pipelineBuildFacadeService, client = client, - buildVariableService = buildVariableService) + buildVariableService = buildVariableService + ) @Bean @ConditionalOnMissingBean(NotifyReceiversCmd::class) diff --git a/src/backend/ci/core/process/biz-process-sample/src/main/kotlin/com/tencent/devops/process/permission/notify/BluekingNotifyUrlCmdImpl.kt b/src/backend/ci/core/process/biz-process-sample/src/main/kotlin/com/tencent/devops/process/permission/notify/BluekingNotifyUrlCmdImpl.kt index f6699d51149..fbb43cd284e 100644 --- a/src/backend/ci/core/process/biz-process-sample/src/main/kotlin/com/tencent/devops/process/permission/notify/BluekingNotifyUrlCmdImpl.kt +++ b/src/backend/ci/core/process/biz-process-sample/src/main/kotlin/com/tencent/devops/process/permission/notify/BluekingNotifyUrlCmdImpl.kt @@ -1,21 +1,14 @@ package com.tencent.devops.process.permission.notify import com.tencent.devops.common.pipeline.enums.ChannelCode -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxCodeCCScriptElement -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement import com.tencent.devops.common.service.utils.HomeHostUtil import com.tencent.devops.process.engine.service.PipelineRepositoryService -import com.tencent.devops.process.engine.service.PipelineRuntimeService import com.tencent.devops.process.notify.command.BuildNotifyContext import com.tencent.devops.process.notify.command.impl.NotifyUrlBuildCmd -import com.tencent.devops.process.pojo.pipeline.ModelDetail -import com.tencent.devops.process.service.builds.PipelineBuildFacadeService import org.springframework.beans.factory.annotation.Autowired class BluekingNotifyUrlCmdImpl @Autowired constructor( - val pipelineRepositoryService: PipelineRepositoryService, - val pipelineRuntimeService: PipelineRuntimeService, - val pipelineBuildFacadeService: PipelineBuildFacadeService + private val pipelineRepositoryService: PipelineRepositoryService ) : NotifyUrlBuildCmd() { override fun canExecute(commandContext: BuildNotifyContext): Boolean { return true @@ -26,23 +19,11 @@ class BluekingNotifyUrlCmdImpl @Autowired constructor( val pipelineId = commandContext.pipelineId val buildId = commandContext.buildId val pipelineInfo = pipelineRepositoryService.getPipelineInfo(projectId, pipelineId) ?: return - var pipelineName = pipelineInfo.pipelineName - val buildInfo = pipelineRuntimeService.getBuildInfo(projectId, buildId) ?: return + val pipelineName = pipelineInfo.pipelineName // 判断codecc类型更改查看详情链接 val detailUrl = if (pipelineInfo.channelCode == ChannelCode.CODECC) { - val detail = pipelineBuildFacadeService.getBuildDetail(userId = buildInfo.startUser, - projectId = projectId, - pipelineId = pipelineId, - buildId = buildId, - channelCode = ChannelCode.BS, - checkPermission = false) - val codeccModel = getCodeccTaskName(detail) - if (codeccModel != null) { - pipelineName = codeccModel.codeCCTaskName.toString() - } - val taskId = pipelineName - "${HomeHostUtil.innerServerHost()}/console/codecc/$projectId/task/$taskId/detail" + "${HomeHostUtil.innerServerHost()}/console/codecc/$projectId/task/$pipelineName/detail" } else { detailUrl(projectId, pipelineId, buildId) } @@ -54,23 +35,6 @@ class BluekingNotifyUrlCmdImpl @Autowired constructor( commandContext.notifyValue.putAll(urlMap) } - @Suppress("NestedBlockDepth") - private fun getCodeccTaskName(detail: ModelDetail): LinuxCodeCCScriptElement? { - for (stage in detail.model.stages) { - stage.containers.forEach { container -> - var codeccElemet = - container.elements.filter { it is LinuxCodeCCScriptElement || it is LinuxPaasCodeCCScriptElement } - if (codeccElemet.isNotEmpty()) return codeccElemet.first() as LinuxCodeCCScriptElement - container.fetchGroupContainers()?.forEach { - codeccElemet = - it.elements.filter { it is LinuxCodeCCScriptElement || it is LinuxPaasCodeCCScriptElement } - if (codeccElemet.isNotEmpty()) return codeccElemet.first() as LinuxCodeCCScriptElement - } - } - } - return null - } - private fun detailUrl(projectId: String, pipelineId: String, processInstanceId: String) = "${HomeHostUtil.outerServerHost()}/console/pipeline/$projectId/$pipelineId/detail/$processInstanceId" } diff --git a/src/backend/ci/core/process/biz-process/build.gradle.kts b/src/backend/ci/core/process/biz-process/build.gradle.kts index 27ec764702c..56596469ed1 100644 --- a/src/backend/ci/core/process/biz-process/build.gradle.kts +++ b/src/backend/ci/core/process/biz-process/build.gradle.kts @@ -42,7 +42,6 @@ dependencies { api(project(":core:artifactory:api-artifactory")) api(project(":core:process:api-process")) api(project(":core:plugin:api-plugin")) - api(project(":core:plugin:codecc-plugin:common-codecc")) api(project(":core:notify:api-notify")) api(project(":core:process:biz-base")) api(project(":core:log:api-log")) diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/template/ServiceTemplateInstanceResourceImpl.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/template/ServiceTemplateInstanceResourceImpl.kt index bdbc12edaed..6001fd7b230 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/template/ServiceTemplateInstanceResourceImpl.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/api/template/ServiceTemplateInstanceResourceImpl.kt @@ -92,6 +92,24 @@ class ServiceTemplateInstanceResourceImpl @Autowired constructor( ) } + override fun updateTemplate( + userId: String, + projectId: String, + templateId: String, + versionName: String, + useTemplateSettings: Boolean, + instances: List + ): TemplateOperationRet { + return templateFacadeService.updateTemplateInstances( + projectId = projectId, + userId = userId, + templateId = templateId, + versionName = versionName, + useTemplateSettings = useTemplateSettings, + instances = instances + ) + } + override fun listTemplate( userId: String, projectId: String, diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/notify/command/impl/NotifyPipelineCmd.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/notify/command/impl/NotifyPipelineCmd.kt index c1691e5b8bc..a35293edecf 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/notify/command/impl/NotifyPipelineCmd.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/notify/command/impl/NotifyPipelineCmd.kt @@ -41,6 +41,10 @@ abstract class NotifyPipelineCmd @Autowired constructor( vars = commandContextBuild.variables as MutableMap) val buildInfo = pipelineRuntimeService.getBuildInfo(projectId, buildId) ?: return val timeDuration = commandContextBuild.variables[PIPELINE_TIME_DURATION]?.toLong() ?: 0L + if (timeDuration > 0) { + // 处理发送消息的耗时展示 + commandContextBuild.variables[PIPELINE_TIME_DURATION] = DateTimeUtil.formatMillSecond(timeDuration * 1000) + } val trigger = executionVar.trigger val buildNum = buildInfo.buildNum diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/template/TemplateFacadeService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/template/TemplateFacadeService.kt index 79d97a5be3a..803f8148fdf 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/template/TemplateFacadeService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/template/TemplateFacadeService.kt @@ -29,6 +29,7 @@ package com.tencent.devops.process.service.template import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.module.kotlin.readValue +import com.tencent.devops.common.api.constant.CommonMessageCode import com.tencent.devops.common.api.enums.RepositoryConfig import com.tencent.devops.common.api.enums.RepositoryType import com.tencent.devops.common.api.exception.ErrorCodeException @@ -49,7 +50,6 @@ import com.tencent.devops.common.pipeline.pojo.element.Element import com.tencent.devops.common.pipeline.pojo.element.agent.CodeGitElement import com.tencent.devops.common.pipeline.pojo.element.agent.CodeSvnElement import com.tencent.devops.common.pipeline.pojo.element.agent.GithubElement -import com.tencent.devops.common.pipeline.pojo.element.agent.LinuxPaasCodeCCScriptElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGithubWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeSVNWebHookTriggerElement @@ -167,6 +167,9 @@ class TemplateFacadeService @Autowired constructor( @Value("\${template.maxSaveVersionNum:300}") private val maxSaveVersionNum: Int = 300 + @Value("\${template.maxUpdateInstanceNum:100}") + private val maxUpdateInstanceNum: Int = 100 + @Value("\${template.maxSaveVersionRecordNum:2}") private val maxSaveVersionRecordNum: Int = 2 @@ -1121,15 +1124,15 @@ class TemplateFacadeService @Autowired constructor( return true } - val v1Map = v1Properties.map { + val v1Map = v1Properties.associate { it.isAccessible = true it.name to it.get(e1) - }.toMap() + } - val v2Map = v2Properties.map { + val v2Map = v2Properties.associate { it.isAccessible = true it.name to it.get(e2) - }.toMap() + } if (v1Map.size != v2Map.size) { return true @@ -1318,42 +1321,57 @@ class TemplateFacadeService @Autowired constructor( projectId: String, userId: String, templateId: String, - version: Long, + version: Long? = null, + versionName: String? = null, useTemplateSettings: Boolean, instances: List ): TemplateOperationRet { logger.info("UPDATE_TEMPLATE_INST[$projectId|$userId|$templateId|$version|$instances|$useTemplateSettings]") - + if (instances.size > maxUpdateInstanceNum) { + throw ErrorCodeException( + errorCode = ProcessMessageCode.FAIL_TEMPLATE_UPDATE_NUM_TOO_BIG, + params = arrayOf("${instances.size}", "$maxUpdateInstanceNum") + ) + } val successPipelines = ArrayList() val failurePipelines = ArrayList() val messages = HashMap() - - val template = templateDao.getTemplate(dslContext = dslContext, version = version) - - instances.forEach { - try { - updateTemplateInstanceInfo( - userId = userId, - useTemplateSettings = useTemplateSettings, - projectId = projectId, - templateId = templateId, - templateVersion = template.version, - versionName = template.versionName, - templateContent = template.template, - templateInstanceUpdate = it - ) - successPipelines.add(it.pipelineName) - } catch (t: DuplicateKeyException) { - logger.warn("Fail to update the pipeline $it of project $projectId by user $userId", t) - failurePipelines.add(it.pipelineName) - messages[it.pipelineName] = "流水线已经存在" - } catch (t: Throwable) { - logger.warn("Fail to update the pipeline $it of project $projectId by user $userId", t) - failurePipelines.add(it.pipelineName) - messages[it.pipelineName] = t.message ?: "更新流水线失败" - } + if (version == null && versionName.isNullOrBlank()) { + throw ErrorCodeException( + errorCode = CommonMessageCode.ERROR_NEED_PARAM_, + params = arrayOf("version or versionName") + ) } - + val template = templateDao.getTemplate( + dslContext = dslContext, + projectId = projectId, + templateId = templateId, + versionName = versionName, + version = version + ) + instances.forEach { + try { + updateTemplateInstanceInfo( + userId = userId, + useTemplateSettings = useTemplateSettings, + projectId = projectId, + templateId = templateId, + templateVersion = template.version, + versionName = template.versionName, + templateContent = template.template, + templateInstanceUpdate = it + ) + successPipelines.add(it.pipelineName) + } catch (t: DuplicateKeyException) { + logger.warn("Fail to update the pipeline $it of project $projectId by user $userId", t) + failurePipelines.add(it.pipelineName) + messages[it.pipelineName] = "流水线已经存在" + } catch (t: Throwable) { + logger.warn("Fail to update the pipeline $it of project $projectId by user $userId", t) + failurePipelines.add(it.pipelineName) + messages[it.pipelineName] = t.message ?: "更新流水线失败" + } + } return TemplateOperationRet(0, TemplateOperationMessage(successPipelines, failurePipelines, messages), "") } @@ -1404,15 +1422,17 @@ class TemplateFacadeService @Autowired constructor( } tmpLabels } - val instanceModel = getInstanceModel( - projectId = projectId, - pipelineId = templateInstanceUpdate.pipelineId, + + val instanceModel = PipelineUtils.instanceModel( templateModel = templateModel, pipelineName = templateInstanceUpdate.pipelineName, buildNo = templateInstanceUpdate.buildNo, param = templateInstanceUpdate.param, - labels = labels + instanceFromTemplate = true, + labels = labels, + defaultStageTagId = stageTagService.getDefaultStageTag().data?.id ) + instanceModel.templateId = templateId pipelineInfoFacadeService.editPipeline( userId = userId, @@ -1532,63 +1552,6 @@ class TemplateFacadeService @Autowired constructor( return true } - /** - * 实例内有codeccId则用实例内的数据 - */ - private fun getInstanceModel( - projectId: String, - pipelineId: String, - templateModel: Model, - pipelineName: String, - buildNo: BuildNo?, - param: List?, - labels: List? = null - ): Model { - - val model = PipelineUtils.instanceModel( - templateModel = templateModel, - pipelineName = pipelineName, - buildNo = buildNo, - param = param, - instanceFromTemplate = true, - labels = labels, - defaultStageTagId = stageTagService.getDefaultStageTag().data?.id - ) - - val instanceModelStr = pipelineResDao.getLatestVersionModelString(dslContext, projectId, pipelineId) - val instanceModel = objectMapper.readValue(instanceModelStr, Model::class.java) - var codeCCTaskId: String? = null - var codeCCTaskCnName: String? = null - var codeCCTaskName: String? = null - - instanceModel.stages.forEach outer@{ stage -> - stage.containers.forEach { container -> - container.elements.forEach { element -> - if (element is LinuxPaasCodeCCScriptElement) { - codeCCTaskId = element.codeCCTaskId - codeCCTaskCnName = element.codeCCTaskCnName - codeCCTaskName = element.codeCCTaskName - return@outer - } - } - } - } - if (codeCCTaskId != null) { - model.stages.forEach { stage -> - stage.containers.forEach { container -> - container.elements.forEach { element -> - if (element is LinuxPaasCodeCCScriptElement) { - element.codeCCTaskId = codeCCTaskId - element.codeCCTaskName = codeCCTaskName - element.codeCCTaskCnName = codeCCTaskCnName - } - } - } - } - } - return model - } - fun copySetting(setting: PipelineSetting, pipelineId: String, templateName: String): PipelineSetting { with(setting) { return PipelineSetting( diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/ModelContainer.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/ModelContainer.kt index 0a1b076643d..796eae5256b 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/ModelContainer.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/ModelContainer.kt @@ -37,6 +37,7 @@ import com.tencent.devops.common.pipeline.container.NormalContainer import com.tencent.devops.common.pipeline.container.VMBuildContainer import com.tencent.devops.common.pipeline.enums.DependOnType import com.tencent.devops.common.pipeline.enums.JobRunCondition +import com.tencent.devops.common.pipeline.matrix.DispatchInfo import com.tencent.devops.common.pipeline.matrix.MatrixConfig.Companion.MATRIX_CONTEXT_KEY_PREFIX import com.tencent.devops.common.pipeline.option.JobControlOption import com.tencent.devops.common.pipeline.option.MatrixControlOption @@ -113,7 +114,7 @@ class ModelContainer @Autowired(required = false) constructor( protected fun getMatrixControlOption( job: Job, - dispatchInfo: StreamDispatchInfo? + dispatchInfo: DispatchInfo? ): MatrixControlOption? { val strategy = job.strategy ?: return null diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/ModelElement.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/ModelElement.kt index 4eeecc1262e..faeeb3f7e28 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/ModelElement.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/ModelElement.kt @@ -89,7 +89,7 @@ class ModelElement @Autowired(required = false) constructor( additionalOptions.enable = jobEnable && PathMatchUtils.isIncludePathMatch(step.ifModify, changeSet) // bash - val element: Element = when { + val element: Element? = when { step.run != null -> { makeRunElement(step, job, additionalOptions) } @@ -97,25 +97,17 @@ class ModelElement @Autowired(required = false) constructor( inner!!.makeCheckoutElement(step, event, additionalOptions) } else -> { - val data = mutableMapOf() - data["input"] = step.with ?: Any() - MarketBuildAtomElement( - id = step.taskId, - name = step.name ?: step.uses!!.split('@')[0], - stepId = step.id, - atomCode = step.uses!!.split('@')[0], - version = step.uses!!.split('@')[1], - data = data, - additionalOptions = additionalOptions - ) + inner!!.makeMarketBuildAtomElement(job, step, event, additionalOptions) } } - elementList.add(element) + if (element != null) { + elementList.add(element) - if (element is MarketBuildAtomElement) { - logger.info("install market atom: ${element.getAtomCode()}") - ModelCommon.installMarketAtom(client, event.projectCode, event.userId, element.getAtomCode()) + if (element is MarketBuildAtomElement) { + logger.info("install market atom: ${element.getAtomCode()}") + ModelCommon.installMarketAtom(client, event.projectCode, event.userId, element.getAtomCode()) + } } } diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/inner/InnerModelCreator.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/inner/InnerModelCreator.kt index 844a5262c6a..55461c796d1 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/inner/InnerModelCreator.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/inner/InnerModelCreator.kt @@ -27,8 +27,10 @@ package com.tencent.devops.process.yaml.modelCreate.inner +import com.tencent.devops.common.client.Client import com.tencent.devops.common.pipeline.pojo.element.ElementAdditionalOptions import com.tencent.devops.common.pipeline.pojo.element.market.MarketBuildAtomElement +import com.tencent.devops.process.yaml.v2.models.job.Job import com.tencent.devops.process.yaml.v2.models.step.Step /** @@ -58,4 +60,22 @@ interface InnerModelCreator { event: ModelCreateEvent, additionalOptions: ElementAdditionalOptions ): MarketBuildAtomElement + + /** + * 构造编译类的插件 + */ + fun makeMarketBuildAtomElement( + job: Job, + step: Step, + event: ModelCreateEvent, + additionalOptions: ElementAdditionalOptions + ): MarketBuildAtomElement? + + /** + * 预安装插件市场的插件 + */ + fun preInstallMarketAtom( + client: Client, + event: ModelCreateEvent + ) } diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/inner/ModelCreateEvent.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/inner/ModelCreateEvent.kt index 7c67f10f6c6..1f0ec9796a1 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/inner/ModelCreateEvent.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/modelCreate/inner/ModelCreateEvent.kt @@ -47,7 +47,8 @@ data class ModelCreateEvent( val gitData: GitData? = null, val streamData: StreamData? = null, val changeSet: Set? = null, - val jobTemplateAcrossInfo: Map? = null + val jobTemplateAcrossInfo: Map? = null, + val preCIData: PreCIData? = null ) /** @@ -86,3 +87,21 @@ data class StreamData( val requestEventId: Long, val objectKind: StreamObjectKind ) + +/** + * preci + */ +data class PreCIData( + val agentId: String, + val workspace: String, + val userId: String, + val projectId: String = "_$userId", + val extraParam: ExtraParam? +) + +data class ExtraParam( + val codeccScanPath: String? = null, + val incrementFileList: List? = null, + val ideVersion: String? = null, + val pluginVersion: String? = null +) diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/devops/process/yaml/v2/models/Concurrency.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/Concurrency.kt similarity index 97% rename from src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/devops/process/yaml/v2/models/Concurrency.kt rename to src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/Concurrency.kt index a309cd25596..a52efc76906 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/devops/process/yaml/v2/models/Concurrency.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/Concurrency.kt @@ -25,7 +25,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.devops.process.yaml.v2.models +package com.tencent.devops.process.yaml.v2.models import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonInclude diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/PreScriptBuildYaml.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/PreScriptBuildYaml.kt index 31539f8ba59..93703127b21 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/PreScriptBuildYaml.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/PreScriptBuildYaml.kt @@ -27,7 +27,6 @@ package com.tencent.devops.process.yaml.v2.models -import com.devops.process.yaml.v2.models.Concurrency import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonInclude import com.tencent.devops.process.yaml.v2.models.job.PreJob diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/PreTemplateScriptBuildYaml.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/PreTemplateScriptBuildYaml.kt index 2a671764bc8..a866f5a1a32 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/PreTemplateScriptBuildYaml.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/PreTemplateScriptBuildYaml.kt @@ -27,7 +27,6 @@ package com.tencent.devops.process.yaml.v2.models -import com.devops.process.yaml.v2.models.Concurrency import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonInclude import com.tencent.devops.process.yaml.v2.models.on.PreTriggerOn diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/ScriptBuildYaml.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/ScriptBuildYaml.kt index 0610d250b51..7ad011153da 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/ScriptBuildYaml.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/models/ScriptBuildYaml.kt @@ -27,7 +27,6 @@ package com.tencent.devops.process.yaml.v2.models -import com.devops.process.yaml.v2.models.Concurrency import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonInclude import com.tencent.devops.process.yaml.v2.models.job.Job diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/parsers/template/YamlObjects.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/parsers/template/YamlObjects.kt index b2a9138e4d2..d506ec237bd 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/parsers/template/YamlObjects.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/parsers/template/YamlObjects.kt @@ -37,8 +37,8 @@ import com.tencent.devops.process.yaml.v2.models.TemplateInfo import com.tencent.devops.process.yaml.v2.models.Variable import com.tencent.devops.process.yaml.v2.models.job.Container import com.tencent.devops.process.yaml.v2.models.job.Credentials -import com.tencent.devops.process.yaml.v2.models.job.PreJob import com.tencent.devops.process.yaml.v2.models.job.Mutex +import com.tencent.devops.process.yaml.v2.models.job.PreJob import com.tencent.devops.process.yaml.v2.models.job.Service import com.tencent.devops.process.yaml.v2.models.job.ServiceWith import com.tencent.devops.process.yaml.v2.models.job.Strategy diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/utils/ScriptYmlUtils.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/utils/ScriptYmlUtils.kt index 74dd965de74..6728a110d84 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/utils/ScriptYmlUtils.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/main/kotlin/com/tencent/devops/process/yaml/v2/utils/ScriptYmlUtils.kt @@ -277,7 +277,7 @@ object ScriptYmlUtils { return sb.toString() } - private fun formatStage(preScriptBuildYaml: PreScriptBuildYaml, transferData: YamlTransferData?): List { + fun formatStage(preScriptBuildYaml: PreScriptBuildYaml, transferData: YamlTransferData?): List { return when { preScriptBuildYaml.steps != null -> { val jobId = randomString(jobNamespace) @@ -313,7 +313,7 @@ object ScriptYmlUtils { } } - private fun preJobs2Jobs(preJobs: Map?, transferData: YamlTransferData?): List { + fun preJobs2Jobs(preJobs: Map?, transferData: YamlTransferData?): List { if (preJobs == null) { return emptyList() } diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/CiYamlUtilsTest.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/CiYamlUtilsTest.kt similarity index 98% rename from src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/CiYamlUtilsTest.kt rename to src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/CiYamlUtilsTest.kt index 6f44e8202d6..d0fa4436f6a 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/CiYamlUtilsTest.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/CiYamlUtilsTest.kt @@ -25,7 +25,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.devops.process.yaml +package com.tencent.devops.process.yaml.parsers import com.tencent.devops.common.api.util.YamlUtil import com.tencent.devops.process.yaml.v2.models.ScriptBuildYaml diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/parsers/template/YamlTemplateTest.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/template/YamlTemplateTest.kt similarity index 99% rename from src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/parsers/template/YamlTemplateTest.kt rename to src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/template/YamlTemplateTest.kt index 775fe29d40a..415f749e024 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/parsers/template/YamlTemplateTest.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/template/YamlTemplateTest.kt @@ -25,7 +25,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.devops.process.yaml.parsers.template +package com.tencent.devops.process.yaml.parsers.template import com.tencent.devops.common.api.util.JsonUtil import com.tencent.devops.common.api.util.YamlUtil diff --git a/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/utils/ScriptYmlUtilsTest.kt b/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/utils/ScriptYmlUtilsTest.kt similarity index 98% rename from src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/utils/ScriptYmlUtilsTest.kt rename to src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/utils/ScriptYmlUtilsTest.kt index eda9007ff9e..47898aeef3d 100644 --- a/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/devops/process/yaml/utils/ScriptYmlUtilsTest.kt +++ b/src/backend/ci/core/process/common-pipeline-yaml/src/test/kotlin/com/tencent/devops/process/yaml/parsers/utils/ScriptYmlUtilsTest.kt @@ -25,7 +25,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.devops.process.yaml.utils +package com.tencent.devops.process.yaml.parsers.utils import com.tencent.devops.common.api.util.YamlUtil import com.tencent.devops.process.yaml.v2.models.PreScriptBuildYaml diff --git a/src/backend/ci/core/project/api-project/src/main/kotlin/com/tencent/devops/project/pojo/Notice.kt b/src/backend/ci/core/project/api-project/src/main/kotlin/com/tencent/devops/project/pojo/Notice.kt index 6180919c6fb..ba84875fec8 100644 --- a/src/backend/ci/core/project/api-project/src/main/kotlin/com/tencent/devops/project/pojo/Notice.kt +++ b/src/backend/ci/core/project/api-project/src/main/kotlin/com/tencent/devops/project/pojo/Notice.kt @@ -46,5 +46,7 @@ data class Notice( @ApiModelProperty("跳转地址") val redirectUrl: String = "", @ApiModelProperty("公告类型:0 弹框 1跑马灯") - val noticeType: Int = 0 + val noticeType: Int = 0, + @ApiModelProperty("公告服务") + val noticeService: List? = null ) diff --git a/src/backend/ci/core/project/api-project/src/main/kotlin/com/tencent/devops/project/pojo/NoticeRequest.kt b/src/backend/ci/core/project/api-project/src/main/kotlin/com/tencent/devops/project/pojo/NoticeRequest.kt index 6926e97ddb9..66d327df80f 100644 --- a/src/backend/ci/core/project/api-project/src/main/kotlin/com/tencent/devops/project/pojo/NoticeRequest.kt +++ b/src/backend/ci/core/project/api-project/src/main/kotlin/com/tencent/devops/project/pojo/NoticeRequest.kt @@ -40,5 +40,7 @@ data class NoticeRequest( @ApiModelProperty("跳转地址") val redirectUrl: String = "", @ApiModelProperty("公告类型:0 弹框 1跑马灯") - val noticeType: Int = 0 + val noticeType: Int = 0, + @ApiModelProperty("公告服务") + val noticeService: List? = null ) diff --git a/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/dao/NoticeDao.kt b/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/dao/NoticeDao.kt index 224b761cba6..2b812d5ffee 100644 --- a/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/dao/NoticeDao.kt +++ b/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/dao/NoticeDao.kt @@ -95,6 +95,7 @@ class NoticeDao { .set(UPDATE_DATE, Timestamp(currentTimestamp).toLocalDateTime()) .set(NOTICE_CONTENT, noticeRequest.noticeContent) .set(REDIRECT_URL, noticeRequest.redirectUrl) + .set(SERVICE_NAME, noticeRequest.noticeService?.joinToString(",")) .set(NOTICE_TYPE, noticeRequest.noticeType.toByte()) .where(ID.eq(id)) .execute() @@ -106,14 +107,16 @@ class NoticeDao { INVALID_DATE, NOTICE_CONTENT, REDIRECT_URL, - NOTICE_TYPE + NOTICE_TYPE, + SERVICE_NAME ).values( noticeRequest.noticeTitle, effectDate, invalidDate, noticeRequest.noticeContent, noticeRequest.redirectUrl, - noticeRequest.noticeType.toByte() + noticeRequest.noticeType.toByte(), + noticeRequest.noticeService?.joinToString(",") ).execute() } } diff --git a/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/service/NoticeService.kt b/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/service/NoticeService.kt index 8d2f5f62ca8..763d62cadf6 100644 --- a/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/service/NoticeService.kt +++ b/src/backend/ci/core/project/biz-project/src/main/kotlin/com/tencent/devops/project/service/NoticeService.kt @@ -69,7 +69,8 @@ class NoticeService @Autowired constructor( updateDate = it.updateDate.timestampmilli(), noticeContent = it.noticeContent, redirectUrl = it.redirectUrl, - noticeType = it.noticeType.toInt() + noticeType = it.noticeType.toInt(), + noticeService = if (it.serviceName.isNullOrBlank()) null else it.serviceName?.split(",") ) ) } @@ -110,7 +111,9 @@ class NoticeService @Autowired constructor( updateDate = noticeRecord.updateDate.timestampmilli(), noticeContent = noticeRecord.noticeContent, redirectUrl = noticeRecord.redirectUrl, - noticeType = noticeRecord.noticeType.toInt() + noticeType = noticeRecord.noticeType.toInt(), + noticeService = if (noticeRecord.serviceName.isNullOrBlank()) null + else noticeRecord.serviceName?.split(",") ) } } diff --git a/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/api/scm/ServiceGitResource.kt b/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/api/scm/ServiceGitResource.kt index 381bc14bc17..774c6248f5b 100644 --- a/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/api/scm/ServiceGitResource.kt +++ b/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/api/scm/ServiceGitResource.kt @@ -59,6 +59,7 @@ import com.tencent.devops.scm.pojo.GitMember import com.tencent.devops.scm.pojo.GitProjectGroupInfo import com.tencent.devops.scm.pojo.GitRepositoryResp import com.tencent.devops.scm.pojo.Project +import com.tencent.devops.scm.pojo.TapdWorkItem import io.swagger.annotations.Api import io.swagger.annotations.ApiOperation import io.swagger.annotations.ApiParam @@ -802,4 +803,25 @@ interface ServiceGitResource { @QueryParam("minAccessLevel") minAccessLevel: GitAccessLevelEnum? ): Result> + + @ApiOperation("获取mr关联的tapd单") + @GET + @Path("/getTapdWorkItems") + fun getTapdWorkItems( + @ApiParam("accessToken", required = true) + @QueryParam("accessToken") + accessToken: String, + @ApiParam(value = "token类型 0:oauth 1:privateKey", required = true) + @QueryParam("tokenType") + tokenType: TokenTypeEnum = TokenTypeEnum.OAUTH, + @ApiParam(value = "gitProjectId") + @QueryParam("gitProjectId") + gitProjectId: String, + @ApiParam(value = "类型,可选mr,cr,issue") + @QueryParam("type") + type: String, + @ApiParam(value = "iid,类型对应的iid") + @QueryParam("iid") + iid: Long + ): Result> } diff --git a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/resources/scm/ServiceGitResourceImpl.kt b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/resources/scm/ServiceGitResourceImpl.kt index 3bd8a204fef..c1ae9d8f97c 100644 --- a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/resources/scm/ServiceGitResourceImpl.kt +++ b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/resources/scm/ServiceGitResourceImpl.kt @@ -61,6 +61,7 @@ import com.tencent.devops.scm.pojo.GitMember import com.tencent.devops.scm.pojo.GitProjectGroupInfo import com.tencent.devops.scm.pojo.GitRepositoryResp import com.tencent.devops.scm.pojo.Project +import com.tencent.devops.scm.pojo.TapdWorkItem import org.springframework.beans.factory.annotation.Autowired import javax.servlet.http.HttpServletResponse @@ -587,4 +588,20 @@ class ServiceGitResourceImpl @Autowired constructor( minAccessLevel = minAccessLevel ) } + + override fun getTapdWorkItems( + accessToken: String, + tokenType: TokenTypeEnum, + gitProjectId: String, + type: String, + iid: Long + ): Result> { + return gitService.getTapdWorkItems( + accessToken = accessToken, + tokenType = tokenType, + gitProjectId = gitProjectId, + type = type, + iid = iid + ) + } } diff --git a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/RepositoryService.kt b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/RepositoryService.kt index e3ad5a98857..d1be7d22320 100644 --- a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/RepositoryService.kt +++ b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/RepositoryService.kt @@ -444,7 +444,8 @@ class RepositoryService @Autowired constructor( private fun generateFinalTokenType(tokenType: TokenTypeEnum, repoProjectName: String): TokenTypeEnum { // 兼容历史插件的代码库不在公共group下的情况,历史插件的代码库信息更新要用用户的token更新 var finalTokenType = tokenType - if (!repoProjectName.startsWith(devopsGroupName)) { + if (!repoProjectName.startsWith(devopsGroupName) && !repoProjectName + .contains("bkdevops-extension-service", true)) { finalTokenType = TokenTypeEnum.OAUTH } return finalTokenType diff --git a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/scm/GitService.kt b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/scm/GitService.kt index 633541dd4b9..e2ea83f95ee 100644 --- a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/scm/GitService.kt +++ b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/scm/GitService.kt @@ -84,6 +84,7 @@ import com.tencent.devops.scm.pojo.GitProjectGroupInfo import com.tencent.devops.scm.pojo.GitRepositoryDirItem import com.tencent.devops.scm.pojo.GitRepositoryResp import com.tencent.devops.scm.pojo.Project +import com.tencent.devops.scm.pojo.TapdWorkItem import com.tencent.devops.scm.utils.code.git.GitUtils import com.tencent.devops.store.pojo.common.BK_FRONTEND_DIR_NAME import okhttp3.MediaType @@ -1767,4 +1768,27 @@ class GitService @Autowired constructor( } return sb.toString() } + + override fun getTapdWorkItems( + accessToken: String, + tokenType: TokenTypeEnum, + gitProjectId: String, + type: String, + iid: Long + ): Result> { + val gitApi = if (tokenType == TokenTypeEnum.OAUTH) { + GitOauthApi() + } else { + GitApi() + } + return Result( + gitApi.getTapdWorkitems( + host = gitConfig.gitApiUrl, + token = accessToken, + id = gitProjectId, + type = type, + iid = iid + ) + ) + } } diff --git a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/scm/IGitService.kt b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/scm/IGitService.kt index 6f141583e3a..ace0d35c8b9 100644 --- a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/scm/IGitService.kt +++ b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/scm/IGitService.kt @@ -59,6 +59,7 @@ import com.tencent.devops.scm.pojo.GitProjectGroupInfo import com.tencent.devops.scm.pojo.GitRepositoryDirItem import com.tencent.devops.scm.pojo.GitRepositoryResp import com.tencent.devops.scm.pojo.Project +import com.tencent.devops.scm.pojo.TapdWorkItem import javax.servlet.http.HttpServletResponse @Suppress("ALL") @@ -335,4 +336,12 @@ interface IGitService { owned: Boolean?, minAccessLevel: GitAccessLevelEnum? ): Result> + + fun getTapdWorkItems( + accessToken: String, + tokenType: TokenTypeEnum, + gitProjectId: String, + type: String, + iid: Long + ): Result> } diff --git a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/api/atom/UserAtomResource.kt b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/api/atom/UserAtomResource.kt index b2ab12ff4db..a5b354f7785 100644 --- a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/api/atom/UserAtomResource.kt +++ b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/api/atom/UserAtomResource.kt @@ -32,13 +32,16 @@ import com.tencent.devops.common.api.auth.AUTH_HEADER_USER_ID import com.tencent.devops.common.api.auth.AUTH_HEADER_USER_ID_DEFAULT_VALUE import com.tencent.devops.common.api.pojo.Page import com.tencent.devops.common.api.pojo.Result +import com.tencent.devops.common.web.annotation.BkField +import com.tencent.devops.common.web.constant.BkStyleEnum import com.tencent.devops.store.pojo.atom.AtomBaseInfoUpdateRequest import com.tencent.devops.store.pojo.atom.AtomResp import com.tencent.devops.store.pojo.atom.AtomRespItem import com.tencent.devops.store.pojo.atom.InstalledAtom import com.tencent.devops.store.pojo.atom.PipelineAtom -import com.tencent.devops.store.pojo.common.VersionInfo +import com.tencent.devops.store.pojo.atom.enums.AtomCategoryEnum import com.tencent.devops.store.pojo.common.UnInstallReq +import com.tencent.devops.store.pojo.common.VersionInfo import io.swagger.annotations.Api import io.swagger.annotations.ApiOperation import io.swagger.annotations.ApiParam @@ -73,6 +76,9 @@ interface UserAtomResource { @ApiParam("支持的服务范围(pipeline/quality/all 分别表示流水线/质量红线/全部)", required = false) @QueryParam("serviceScope") serviceScope: String?, + @ApiParam("job类型,AGENT: 编译环境,AGENT_LESS:无编译环境", required = false) + @QueryParam("jobType") + jobType: String?, @ApiParam("操作系统(ALL/WINDOWS/LINUX/MACOS)", required = false) @QueryParam("os") os: String?, @@ -81,16 +87,32 @@ interface UserAtomResource { projectCode: String, @ApiParam("插件所属范畴,TRIGGER:触发器类插件 TASK:任务类插件", required = false) @QueryParam("category") - category: String?, + category: String? = AtomCategoryEnum.TASK.name, @ApiParam("插件分类id", required = false) @QueryParam("classifyId") classifyId: String?, - @ApiParam("页码", required = false) + @ApiParam("是否推荐", required = false) + @QueryParam("recommendFlag") + recommendFlag: Boolean?, + @ApiParam("搜索关键字", required = false) + @QueryParam("keyword") + keyword: String?, + @ApiParam("查询项目插件标识", required = true) + @QueryParam("queryProjectAtomFlag") + queryProjectAtomFlag: Boolean = true, + @ApiParam("是否适配操作系统标识", required = false) + @QueryParam("fitOsFlag") + fitOsFlag: Boolean? = true, + @ApiParam("查询支持有编译环境下的无编译环境插件标识", required = false) + @QueryParam("queryFitAgentBuildLessAtomFlag") + queryFitAgentBuildLessAtomFlag: Boolean? = true, + @ApiParam("页码", required = true) @QueryParam("page") - page: Int?, - @ApiParam("每页数量", required = false) + page: Int = 1, + @ApiParam("每页数量", required = true) @QueryParam("pageSize") - pageSize: Int? + @BkField(patternStyle = BkStyleEnum.PAGE_SIZE_STYLE) + pageSize: Int = 10 ): Result?> @ApiOperation("根据插件代码和版本号获取流水线插件详细信息") @@ -122,7 +144,7 @@ interface UserAtomResource { @ApiOperation("获取项目下已安装的插件列表") @GET - @Path("/projectCodes/{projectCode}/list") + @Path("/projectCodes/{projectCode}/installedAtoms/list") fun getInstalledAtoms( @ApiParam("userId", required = true) @HeaderParam(AUTH_HEADER_USER_ID) @@ -133,12 +155,16 @@ interface UserAtomResource { @ApiParam("插件分类", required = false) @QueryParam("classifyCode") classifyCode: String?, - @ApiParam("页码", required = false) + @ApiParam("名称", required = false) + @QueryParam("name") + name: String?, + @ApiParam("页码", required = true) @QueryParam("page") - page: Int?, - @ApiParam("每页数量", required = false) + page: Int = 1, + @ApiParam("每页数量", required = true) @QueryParam("pageSize") - pageSize: Int? + @BkField(patternStyle = BkStyleEnum.PAGE_SIZE_STYLE) + pageSize: Int = 10 ): Result> @ApiOperation("更新流水线插件信息") diff --git a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/api/common/UserStoreEnvVarResource.kt b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/api/common/UserStoreEnvVarResource.kt index 85f56586867..cb89f7bd1fa 100644 --- a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/api/common/UserStoreEnvVarResource.kt +++ b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/api/common/UserStoreEnvVarResource.kt @@ -38,15 +38,15 @@ import io.swagger.annotations.Api import io.swagger.annotations.ApiOperation import io.swagger.annotations.ApiParam import javax.validation.Valid -import javax.ws.rs.Consumes -import javax.ws.rs.DELETE +import javax.ws.rs.PathParam import javax.ws.rs.GET +import javax.ws.rs.DELETE +import javax.ws.rs.QueryParam import javax.ws.rs.HeaderParam +import javax.ws.rs.Consumes import javax.ws.rs.POST import javax.ws.rs.Path -import javax.ws.rs.PathParam import javax.ws.rs.Produces -import javax.ws.rs.QueryParam import javax.ws.rs.core.MediaType @Api(tags = ["USER_STORE_ENV_VAR"], description = "环境变量") @@ -67,6 +67,22 @@ interface UserStoreEnvVarResource { storeEnvVarRequest: StoreEnvVarRequest ): Result + @ApiOperation("更新环境变量") + @POST + @Path("/update") + fun update( + @ApiParam("userId", required = true) + @HeaderParam(AUTH_HEADER_USER_ID) + userId: String, + @ApiParam("变量ID", required = true) + @BkField(patternStyle = BkStyleEnum.ID_STYLE) + @QueryParam("variableId") + variableId: String, + @ApiParam("环境变量请求报文体", required = true) + @Valid + storeEnvVarRequest: StoreEnvVarRequest + ): Result + @ApiOperation("删除环境变量") @DELETE @Path("/types/{storeType}/codes/{storeCode}") @@ -82,6 +98,10 @@ interface UserStoreEnvVarResource { @PathParam("storeCode") @BkField(patternStyle = BkStyleEnum.CODE_STYLE) storeCode: String, + @ApiParam("生效范围 TEST:测试 PRD:正式 ALL:所有", required = true) + @QueryParam("scope") + @BkField(patternStyle = BkStyleEnum.SCOPE_STYLE, required = true) + scope: String, @ApiParam("环境变量名称集合,用\",\"分隔进行拼接(如1,2,3)", required = true) @QueryParam("varNames") @BkField(patternStyle = BkStyleEnum.COMMON_STYLE) @@ -103,10 +123,10 @@ interface UserStoreEnvVarResource { @PathParam("storeCode") @BkField(patternStyle = BkStyleEnum.CODE_STYLE) storeCode: String, - @ApiParam("生效范围 TEST:测试 PRD:正式 ALL:所有,用\",\"分隔进行拼接", required = false) - @QueryParam("scopes") + @ApiParam("生效范围 TEST:测试 PRD:正式 ALL:所有", required = false) + @QueryParam("scope") @BkField(patternStyle = BkStyleEnum.SCOPE_STYLE, required = false) - scopes: String?, + scope: String?, @ApiParam("变量名", required = false) @QueryParam("varName") @BkField(patternStyle = BkStyleEnum.CODE_STYLE, required = false) @@ -128,6 +148,10 @@ interface UserStoreEnvVarResource { @PathParam("storeCode") @BkField(patternStyle = BkStyleEnum.CODE_STYLE) storeCode: String, + @ApiParam("生效范围 TEST:测试 PRD:正式 ALL:所有", required = true) + @QueryParam("scope") + @BkField(patternStyle = BkStyleEnum.SCOPE_STYLE, required = true) + scope: String, @ApiParam("变量名", required = true) @PathParam("varName") @BkField(patternStyle = BkStyleEnum.CODE_STYLE) diff --git a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/AtomRespItem.kt b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/AtomRespItem.kt index 198569a53aa..8bc80d7f560 100644 --- a/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/AtomRespItem.kt +++ b/src/backend/ci/core/store/api-store/src/main/kotlin/com/tencent/devops/store/pojo/atom/AtomRespItem.kt @@ -27,6 +27,7 @@ package com.tencent.devops.store.pojo.atom +import com.tencent.devops.store.pojo.common.Label import io.swagger.annotations.ApiModel import io.swagger.annotations.ApiModelProperty @@ -70,6 +71,12 @@ data class AtomRespItem( val publisher: String?, @ApiModelProperty("创建人", required = true) val creator: String, + @ApiModelProperty("修改人") + val modifier: String, + @ApiModelProperty("创建时间") + val createTime: String, + @ApiModelProperty("修改时间") + val updateTime: String, @ApiModelProperty("是否为默认原子(默认原子默认所有项目可见)true:默认原子 false:普通原子", required = true) val defaultFlag: Boolean, @ApiModelProperty("是否为最新版本原子 true:最新 false:非最新", required = true) @@ -81,5 +88,17 @@ data class AtomRespItem( @ApiModelProperty("权重(数值越大代表权重越高)", required = false) val weight: Int?, @ApiModelProperty("是否推荐标识 true:推荐,false:不推荐", required = false) - val recommendFlag: Boolean? + val recommendFlag: Boolean?, + @ApiModelProperty("评分", required = false) + val score: Double? = null, + @ApiModelProperty("最近执行次数", required = false) + val recentExecuteNum: Int? = null, + @ApiModelProperty("是否能卸载标识", required = false) + val uninstallFlag: Boolean? = null, + @ApiModelProperty("标签列表", required = false) + val labelList: List