From 9a781229adbcdb575c024b779f49740ed974f7c0 Mon Sep 17 00:00:00 2001 From: ruotiantang Date: Thu, 25 May 2023 09:30:42 +0800 Subject: [PATCH 001/633] =?UTF-8?q?kubernetes-manager=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?docker=20inspect=20image=20#8862?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kubernetes-management/Chart.yaml | 4 +- .../templates/deployment.yaml | 30 ++- .../kubernetes-manager-configmap.yaml | 3 + .../kubernetes-management/values.yaml | 15 +- src/backend/dispatch-k8s-manager/Makefile | 5 +- .../cmd/apiserver/apiserver.go | 8 +- src/backend/dispatch-k8s-manager/go.mod | 44 ++-- src/backend/dispatch-k8s-manager/go.sum | 83 ++++--- .../pkg/apiserver/apis/apis.go | 1 + .../pkg/apiserver/apis/docker.go | 44 ++++ .../pkg/apiserver/apis/task.go | 4 +- .../pkg/apiserver/service/docker.go | 106 +++++++++ .../pkg/apiserver/service/docker_type.go | 18 ++ .../pkg/config/config_type.go | 5 + .../pkg/constant/constant.go | 5 + .../dispatch-k8s-manager/pkg/docker/docker.go | 91 ++++++++ .../dispatch-k8s-manager/pkg/docker/type.go | 12 + .../dispatch-k8s-manager/pkg/logs/logs.go | 15 +- .../pkg/task/builder_task.go | 29 +-- .../dispatch-k8s-manager/pkg/task/job_task.go | 23 +- .../dispatch-k8s-manager/pkg/task/task.go | 20 +- .../pkg/types/task_type.go | 6 + .../resources/config.yaml | 11 +- .../swagger/apiserver/docs.go | 212 ++++++++++++++++-- .../swagger/apiserver/swagger.json | 206 +++++++++++++++-- .../swagger/apiserver/swagger.yaml | 134 +++++++++-- .../swagger/init-swager.sh | 0 27 files changed, 1002 insertions(+), 132 deletions(-) create mode 100644 src/backend/dispatch-k8s-manager/pkg/apiserver/apis/docker.go create mode 100644 src/backend/dispatch-k8s-manager/pkg/apiserver/service/docker.go create mode 100644 src/backend/dispatch-k8s-manager/pkg/apiserver/service/docker_type.go create mode 100644 src/backend/dispatch-k8s-manager/pkg/constant/constant.go create mode 100644 src/backend/dispatch-k8s-manager/pkg/docker/docker.go create mode 100644 src/backend/dispatch-k8s-manager/pkg/docker/type.go mode change 100644 => 100755 src/backend/dispatch-k8s-manager/swagger/init-swager.sh diff --git a/helm-charts/core/ci/local_chart/kubernetes-management/Chart.yaml b/helm-charts/core/ci/local_chart/kubernetes-management/Chart.yaml index ccd88943079..fcfbe3d23f5 100644 --- a/helm-charts/core/ci/local_chart/kubernetes-management/Chart.yaml +++ b/helm-charts/core/ci/local_chart/kubernetes-management/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: kubernetes-manager description: A Helm chart for BlueKing CI Kubernetes Manager type: application -version: 0.0.36 -appVersion: 0.0.31 +version: 0.0.37 +appVersion: 0.0.32 home: https://github.com/Tencent/bk-ci dependencies: diff --git a/helm-charts/core/ci/local_chart/kubernetes-management/templates/deployment.yaml b/helm-charts/core/ci/local_chart/kubernetes-management/templates/deployment.yaml index ab40cdc0ca6..63110efdd33 100644 --- a/helm-charts/core/ci/local_chart/kubernetes-management/templates/deployment.yaml +++ b/helm-charts/core/ci/local_chart/kubernetes-management/templates/deployment.yaml @@ -67,6 +67,14 @@ spec: value: {{ .Values.multiCluster.enabled | quote }} - name: DEFAULT_NAMESPACE value: {{ .Values.multiCluster.defaultNamespace }} + {{- if .Values.kubernetesManager.docker.enable }} + - name: DOCKER_HOST + value: tcp://localhost:2375 + {{- end}} + {{- if .Values.kubernetesManager.debug }} + - name: KUBERNETES_MANAGER_DEBUG_ENABLE + value: true + {{- end}} workingDir: /data/workspace/kubernetes-manager livenessProbe: tcpSocket: @@ -90,8 +98,22 @@ spec: mountPath: /data/workspace/kubernetes-manager/config readOnly: true {{- end}} - {{- if .Values.configmap.enabled}} + {{- if .Values.kubernetesManager.docker.enable }} + - name: kuberentes-manager-docker + image: {{ .Values.kubernetesManager.docker.image }} + command: ["dockerd", "--host", "tcp://localhost:2375"] + {{- if .Values.kubernetesManager.docker.resources }} + resources: {{- toYaml .Values.kubernetesManager.docker.resources | nindent 12 }} + {{- end }} + securityContext: + privileged: true + volumeMounts: + - name: docker-graph-storage + mountPath: /var/lib/docker + {{- end }} + volumes: + {{- if .Values.configmap.enabled}} - name: kubernetes-manager-config configMap: name: kubernetes-manager @@ -101,6 +123,10 @@ spec: {{- if .Values.kubeConfig.useKubeConfig}} - key: kubeConfig.yaml path: kubeConfig.yaml - {{- end}} + {{- end}} + {{- if .Values.kubernetesManager.docker.enable }} + - name: docker-graph-storage + emptyDir: {} + {{- end}} {{- end}} {{- end -}} diff --git a/helm-charts/core/ci/local_chart/kubernetes-management/templates/kubernetes-manager-configmap.yaml b/helm-charts/core/ci/local_chart/kubernetes-management/templates/kubernetes-manager-configmap.yaml index 0b8c359d842..37da7e85e0d 100644 --- a/helm-charts/core/ci/local_chart/kubernetes-management/templates/kubernetes-manager-configmap.yaml +++ b/helm-charts/core/ci/local_chart/kubernetes-management/templates/kubernetes-manager-configmap.yaml @@ -109,6 +109,9 @@ data: rsaPrivateKey: | {{- .Values.kubernetesManager.apiserver.auth.rsaPrivateKey | nindent 10 }} + docker: + enable: {{ .Values.kubernetesManager.docker.enable }} + {{ if .Values.kubeConfig.useKubeConfig -}} kubeConfig.yaml: | {{- .Values.kubeConfig.content | nindent 4 }} diff --git a/helm-charts/core/ci/local_chart/kubernetes-management/values.yaml b/helm-charts/core/ci/local_chart/kubernetes-management/values.yaml index 01782a5852b..d418a1bc864 100644 --- a/helm-charts/core/ci/local_chart/kubernetes-management/values.yaml +++ b/helm-charts/core/ci/local_chart/kubernetes-management/values.yaml @@ -94,6 +94,7 @@ service: # kubernetesManager Deployment kubernetesManager: enabled: true + debug: false replicas: 1 resources: requests: @@ -147,11 +148,23 @@ kubernetesManager: apiToken: key: Devops-Token value: landun - rsaPrivateKey: | + rsaPrivateKey: "" volumeMount: # 流水线构建工作空间和agent日志在容器内的挂载点 dataPath: /data/devops/workspace logPath: /data/devops/logs + # manager使用docker相关配置 + docker: + enable: true + image: docker:24.0.1-dind + resources: + requests: + cpu: 50m + memory: 512Mi + limits: + cpu: 100m + memory: 1024Mi + dockerInit: # 是否使用当前chart的 dockerinit.sh useDockerInit: true diff --git a/src/backend/dispatch-k8s-manager/Makefile b/src/backend/dispatch-k8s-manager/Makefile index e6b0b5e5b93..030f21133e7 100644 --- a/src/backend/dispatch-k8s-manager/Makefile +++ b/src/backend/dispatch-k8s-manager/Makefile @@ -1,5 +1,5 @@ LOCAL_REGISTRY=bkci -LOCAL_IMAGE=kubernetes-manager:0.0.31 +LOCAL_IMAGE=kubernetes-manager:0.0.32 CONFIG_DIR=/data/workspace/kubernetes-manager/config OUT_DIR=/data/workspace/kubernetes-manager/out @@ -13,6 +13,9 @@ GOFLAGS := # gin export GIN_MODE=release +format: + find ./ -name "*.go" | xargs gofmt -w + test: test-unit .PHONY: test-unit diff --git a/src/backend/dispatch-k8s-manager/cmd/apiserver/apiserver.go b/src/backend/dispatch-k8s-manager/cmd/apiserver/apiserver.go index 159a82572b4..37076b1e838 100644 --- a/src/backend/dispatch-k8s-manager/cmd/apiserver/apiserver.go +++ b/src/backend/dispatch-k8s-manager/cmd/apiserver/apiserver.go @@ -3,9 +3,11 @@ package main import ( "disaptch-k8s-manager/pkg/apiserver" "disaptch-k8s-manager/pkg/config" + "disaptch-k8s-manager/pkg/constant" "disaptch-k8s-manager/pkg/cron" "disaptch-k8s-manager/pkg/db/mysql" "disaptch-k8s-manager/pkg/db/redis" + "disaptch-k8s-manager/pkg/docker" "disaptch-k8s-manager/pkg/kubeclient" "disaptch-k8s-manager/pkg/logs" "disaptch-k8s-manager/pkg/task" @@ -60,6 +62,10 @@ func main() { os.Exit(1) } + if config.Config.Docker.Enable { + docker.InitDockerCli() + } + if err := apiserver.InitApiServer(filepath.Join(outDir, "logs", config.AccessLog)); err != nil { fmt.Printf("init api server error %v\n", err) os.Exit(1) @@ -69,7 +75,7 @@ func main() { } func initConfig(configDir string) { - if debug == "true" { + if debug == "true" || os.Getenv(constant.KubernetesManagerDebugEnable) == "true" { config.Envs.IsDebug = true } else { config.Envs.IsDebug = false diff --git a/src/backend/dispatch-k8s-manager/go.mod b/src/backend/dispatch-k8s-manager/go.mod index b9803b9a281..67106179c12 100644 --- a/src/backend/dispatch-k8s-manager/go.mod +++ b/src/backend/dispatch-k8s-manager/go.mod @@ -1,8 +1,9 @@ module disaptch-k8s-manager -go 1.18 +go 1.19 require ( + github.com/docker/docker v24.0.1+incompatible github.com/gin-gonic/gin v1.8.1 github.com/go-playground/locales v0.14.0 github.com/go-playground/universal-translator v0.18.0 @@ -12,12 +13,13 @@ require ( github.com/gorilla/websocket v1.4.2 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.0 - github.com/sirupsen/logrus v1.8.1 + github.com/sirupsen/logrus v1.9.0 github.com/spf13/viper v1.11.0 - github.com/stretchr/testify v1.8.0 + github.com/stretchr/testify v1.8.1 github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe github.com/swaggo/gin-swagger v1.5.1 - github.com/swaggo/swag v1.8.4 + github.com/swaggo/swag v1.16.1 + golang.org/x/net v0.10.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0 k8s.io/api v0.24.0 k8s.io/apimachinery v0.24.0 @@ -25,18 +27,21 @@ require ( ) require ( + github.com/BurntSushi/toml v1.2.1 // indirect github.com/KyleBanks/depth v1.2.1 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful v2.16.0+incompatible // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-logr/logr v1.2.0 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.6 // indirect - github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/swag v0.19.15 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/spec v0.20.9 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/goccy/go-json v0.9.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -49,12 +54,16 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/magiconair/properties v1.8.6 // indirect - github.com/mailru/easyjson v0.7.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.0.2 // indirect github.com/pelletier/go-toml v1.9.4 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -65,23 +74,24 @@ require ( github.com/subosito/gotenv v1.2.0 // indirect github.com/ugorji/go/codec v1.2.7 // indirect golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect - golang.org/x/net v0.7.0 // indirect + golang.org/x/mod v0.10.0 // indirect golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - golang.org/x/tools v0.1.12 // indirect + golang.org/x/tools v0.9.1 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.4.0 // indirect k8s.io/klog/v2 v2.60.1 // indirect k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/src/backend/dispatch-k8s-manager/go.sum b/src/backend/dispatch-k8s-manager/go.sum index 91cd0f1b950..3c7e9993f6d 100644 --- a/src/backend/dispatch-k8s-manager/go.sum +++ b/src/backend/dispatch-k8s-manager/go.sum @@ -39,6 +39,7 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= @@ -46,15 +47,16 @@ github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSY github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= @@ -72,6 +74,14 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 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/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v24.0.1+incompatible h1:NxN81beIxDlUaVt46iUQrYHD9/W3u9EGl52r86O/IGw= +github.com/docker/docker v24.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +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.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= 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= @@ -107,18 +117,23 @@ github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= 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/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= +github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -249,20 +264,25 @@ github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamh github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= 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 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -279,6 +299,10 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGV github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +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.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= +github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= @@ -304,8 +328,8 @@ github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUA github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= 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/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -322,6 +346,7 @@ github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUs github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 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/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -329,8 +354,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 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/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe h1:K8pHPVoTgxFJt1lXuIzzOX7zZhZFldJQK/CgKx9BFIc= @@ -338,8 +364,8 @@ github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe/go.mod h1:lKJPbtWzJ9J github.com/swaggo/gin-swagger v1.5.1 h1:PFmlJU1LPn8DjrR0meVLX5gyFdgcPOkLcoFRRFx7WcY= github.com/swaggo/gin-swagger v1.5.1/go.mod h1:Cbj/MlHApPOjZdf4joWFXLLgmZVPyh54GPvPPyVjVZM= github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= -github.com/swaggo/swag v1.8.4 h1:oGB351qH1JqUqK1tsMYEE5qTBbPk394BhsZxmUfebcI= -github.com/swaggo/swag v1.8.4/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= +github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= +github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= @@ -404,7 +430,8 @@ 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.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -448,8 +475,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= 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= @@ -475,6 +502,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ 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/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -488,7 +516,6 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -528,12 +555,13 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= 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= @@ -543,8 +571,8 @@ 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/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= 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/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -603,8 +631,8 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= 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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -743,6 +771,8 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= 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= @@ -774,5 +804,6 @@ sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/apis.go b/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/apis.go index d0e71d6ec6c..73f04e2083d 100644 --- a/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/apis.go +++ b/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/apis.go @@ -36,6 +36,7 @@ func InitApis(r *gin.Engine, handlers ...gin.HandlerFunc) { initJobsApis(apis) initBuilderApis(apis) initTasksApis(apis) + initDockerApis(apis) } func ok(c *gin.Context, data interface{}) { diff --git a/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/docker.go b/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/docker.go new file mode 100644 index 00000000000..c065d92cd2c --- /dev/null +++ b/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/docker.go @@ -0,0 +1,44 @@ +package apis + +import ( + "disaptch-k8s-manager/pkg/apiserver/service" + "net/http" + + "github.com/gin-gonic/gin" +) + +const ( + dockerPrefix = "/docker" +) + +func initDockerApis(r *gin.RouterGroup) { + docker := r.Group(dockerPrefix) + { + docker.POST("/inspect", dockerInspect) + } +} + +// @Tags docker +// @Summary docker inspect命令(同时会pull) +// @Accept json +// @Product json +// @Param Devops-Token header string true "凭证信息" +// @Param info body service.DockerInspectInfo true "构建机信息" +// @Success 200 {object} types.Result{data=service.TaskId} "任务ID" +// @Router /docker/inspect [post] +func dockerInspect(c *gin.Context) { + info := &service.DockerInspectInfo{} + + if err := c.BindJSON(info); err != nil { + fail(c, http.StatusBadRequest, err) + return + } + + taskId, err := service.DockerInspect(info) + if err != nil { + fail(c, http.StatusInternalServerError, err) + return + } + + ok(c, service.TaskId{TaskId: taskId}) +} diff --git a/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/task.go b/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/task.go index e7bcbd6e7cd..216c0ea27ac 100644 --- a/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/task.go +++ b/src/backend/dispatch-k8s-manager/pkg/apiserver/apis/task.go @@ -8,9 +8,9 @@ import ( ) func initTasksApis(r *gin.RouterGroup) { - jobs := r.Group("/tasks") + tasks := r.Group("/tasks") { - jobs.GET("/:taskId/status", getTaskStatus) + tasks .GET("/:taskId/status", getTaskStatus) } } diff --git a/src/backend/dispatch-k8s-manager/pkg/apiserver/service/docker.go b/src/backend/dispatch-k8s-manager/pkg/apiserver/service/docker.go new file mode 100644 index 00000000000..9179adf5e96 --- /dev/null +++ b/src/backend/dispatch-k8s-manager/pkg/apiserver/service/docker.go @@ -0,0 +1,106 @@ +package service + +import ( + "context" + "disaptch-k8s-manager/pkg/db/mysql" + "disaptch-k8s-manager/pkg/docker" + "disaptch-k8s-manager/pkg/logs" + "disaptch-k8s-manager/pkg/task" + "disaptch-k8s-manager/pkg/types" + "encoding/json" + "strings" + "time" + + dockerTypes "github.com/docker/docker/api/types" + "github.com/pkg/errors" +) + +func DockerInspect(info *DockerInspectInfo) (string, error) { + taskId := generateTaskId() + + if err := mysql.InsertTask(types.Task{ + TaskId: taskId, + TaskKey: info.Name, + TaskBelong: types.TaskBelongDocker, + Action: types.TaskDockerActionInspect, + Status: types.TaskWaiting, + Message: nil, + ActionTime: time.Now(), + UpdateTime: time.Now(), + }); err != nil { + return "", err + } + + go inspect(taskId, info) + + return taskId, nil +} + +func inspect(taskId string, info *DockerInspectInfo) { + task.UpdateTask(taskId, types.TaskRunning) + + ctx := context.Background() + + // 拉取镜像 + pullMsg, err := docker.ImagePull(ctx, info.Ref, info.Credential.Username, info.Credential.Password) + if err != nil { + logs.Error("inspect ImagePull error", err) + task.FailTask(taskId, err.Error()) + return + } + + // 寻找ID + imageName := strings.TrimSpace(info.Ref) + imageStr := strings.TrimPrefix(strings.TrimPrefix(imageName, "http://"), "https://") + images, err := docker.ImageList(ctx) + if err != nil { + logs.Error("get image list error", err) + task.FailTask(taskId, err.Error()) + return + } + id := "" + for _, image := range images { + for _, tagName := range image.RepoTags { + if tagName == imageStr { + id = image.ID + } + } + } + if id == "" { + err = errors.Errorf("image %s not found", imageName) + logs.Errorf("pullMsg %s error %s", pullMsg, err.Error()) + task.FailTask(taskId, err.Error()) + return + } + + defer func() { + // 完事后删除镜像 + if err = docker.ImageRemove(ctx, id, dockerTypes.ImageRemoveOptions{Force: true}); err != nil { + logs.Errorf("remove image %s id %s error %s", info.Ref, id, err.Error()) + } + }() + + // 分析镜像 + image, err := docker.ImageInspect(ctx, info.Ref) + if err != nil { + logs.Error("inspect ImageInspect error", err) + task.FailTask(taskId, err.Error()) + return + } + + msg := &DockerInspectResp{ + Architecture: image.Architecture, + Os: image.Os, + Size: image.Size, + } + + msgStr, err := json.Marshal(msg) + if err != nil { + logs.Error("inspect jsonMarshal error", err) + task.FailTask(taskId, err.Error()) + return + } + + task.OkTaskWithMessage(taskId, string(msgStr)) + +} diff --git a/src/backend/dispatch-k8s-manager/pkg/apiserver/service/docker_type.go b/src/backend/dispatch-k8s-manager/pkg/apiserver/service/docker_type.go new file mode 100644 index 00000000000..4cee25c7c13 --- /dev/null +++ b/src/backend/dispatch-k8s-manager/pkg/apiserver/service/docker_type.go @@ -0,0 +1,18 @@ +package service + +type DockerInspectInfo struct { + Name string `json:"name" binding:"required"` // 任务名称,唯一 + Ref string `json:"ref" binding:"required"` // docker镜像信息 如:docker:latest + Credential Credential `json:"cred"` // 拉取镜像凭据 +} + +type Credential struct { + Username string `json:"username"` + Password string `json:"password"` +} + +type DockerInspectResp struct { + Architecture string `json:"arch"` // 架构 + Os string `json:"os"` // 系统 + Size int64 `json:"size"` // 大小 +} diff --git a/src/backend/dispatch-k8s-manager/pkg/config/config_type.go b/src/backend/dispatch-k8s-manager/pkg/config/config_type.go index 1b8ae7e51e6..7d8d44d3256 100644 --- a/src/backend/dispatch-k8s-manager/pkg/config/config_type.go +++ b/src/backend/dispatch-k8s-manager/pkg/config/config_type.go @@ -9,6 +9,7 @@ type ConfigYaml struct { Dispatch Dispatch `json:"dispatch"` BuildAndPushImage BuildAndPushImage `json:"buildAndPushImage"` ApiServer ApiServer `json:"apiServer"` + Docker Docker `json:"docker"` } type Server struct { @@ -135,3 +136,7 @@ type ApiToken struct { Key string `json:"key"` Value string `json:"value"` } + +type Docker struct { + Enable bool `json:"enable"` +} diff --git a/src/backend/dispatch-k8s-manager/pkg/constant/constant.go b/src/backend/dispatch-k8s-manager/pkg/constant/constant.go new file mode 100644 index 00000000000..444b4a13be6 --- /dev/null +++ b/src/backend/dispatch-k8s-manager/pkg/constant/constant.go @@ -0,0 +1,5 @@ +package constant + +const ( + KubernetesManagerDebugEnable = "KUBERNETES_MANAGER_DEBUG_ENABLE" +) diff --git a/src/backend/dispatch-k8s-manager/pkg/docker/docker.go b/src/backend/dispatch-k8s-manager/pkg/docker/docker.go new file mode 100644 index 00000000000..ca4991f3a5a --- /dev/null +++ b/src/backend/dispatch-k8s-manager/pkg/docker/docker.go @@ -0,0 +1,91 @@ +package docker + +import ( + "encoding/base64" + "encoding/json" + "io" + "strings" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/client" + "github.com/pkg/errors" + "golang.org/x/net/context" +) + +var cli *client.Client + +func InitDockerCli() error { + c, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) + if err != nil { + return err + } + cli = c + + return nil +} + +func ImageList(ctx context.Context) ([]types.ImageSummary, error) { + images, err := cli.ImageList(ctx, types.ImageListOptions{}) + if err != nil { + return nil, errors.Wrap(err, "list image error") + } + + return images, nil +} + +func ImagePull( + ctx context.Context, + ref string, + username string, + password string, +) (string, error) { + imageName := strings.TrimSpace(ref) + + reader, err := cli.ImagePull(ctx, imageName, types.ImagePullOptions{ + RegistryAuth: generateDockerAuth(username, password), + }) + if err != nil { + return "", errors.Wrap(err, "pull new image error") + } + defer reader.Close() + buf := new(strings.Builder) + _, _ = io.Copy(buf, reader) + + return buf.String(), nil +} + +func ImageInspect(ctx context.Context, imageId string) (*types.ImageInspect, error) { + image, _, err := cli.ImageInspectWithRaw(ctx, imageId) + if err != nil { + return nil, errors.Wrap(err, "image inspect error") + } + + return &image, nil +} + +func ImageRemove(ctx context.Context, imageId string, opts types.ImageRemoveOptions) error { + _, err := cli.ImageRemove(ctx, imageId, opts) + if err != nil { + return err + } + + return nil +} + +// generateDockerAuth 创建拉取docker凭据 +func generateDockerAuth(user, password string) string { + if user == "" || password == "" { + return "" + } + + authConfig := types.AuthConfig{ + Username: user, + Password: password, + } + encodedJSON, err := json.Marshal(authConfig) + if err != nil { + panic(err) + } + + return base64.URLEncoding.EncodeToString(encodedJSON) +} diff --git a/src/backend/dispatch-k8s-manager/pkg/docker/type.go b/src/backend/dispatch-k8s-manager/pkg/docker/type.go new file mode 100644 index 00000000000..c89a0d84d55 --- /dev/null +++ b/src/backend/dispatch-k8s-manager/pkg/docker/type.go @@ -0,0 +1,12 @@ +package docker + +type ImagePullPolicyEnum string + +const ( + ImagePullPolicyAlways ImagePullPolicyEnum = "always" + ImagePullPolicyIfNotPresent ImagePullPolicyEnum = "if-not-present" +) + +func (i ImagePullPolicyEnum) String() string { + return string(i) +} diff --git a/src/backend/dispatch-k8s-manager/pkg/logs/logs.go b/src/backend/dispatch-k8s-manager/pkg/logs/logs.go index 21b03f0c10d..78aa7a1ecfe 100644 --- a/src/backend/dispatch-k8s-manager/pkg/logs/logs.go +++ b/src/backend/dispatch-k8s-manager/pkg/logs/logs.go @@ -5,9 +5,6 @@ import ( "disaptch-k8s-manager/pkg/config" "disaptch-k8s-manager/pkg/types" "fmt" - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" - "gopkg.in/natefinch/lumberjack.v2" "net" "net/http" "net/http/httputil" @@ -15,6 +12,10 @@ import ( "path/filepath" "runtime/debug" "strings" + + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "gopkg.in/natefinch/lumberjack.v2" ) var Logs *logrus.Logger @@ -118,3 +119,11 @@ func Warn(args ...interface{}) { func Error(args ...interface{}) { Logs.Error(args...) } + +func Errorf(format string, args ...interface{}) { + Logs.Errorf(format, args...) +} + +func WithError(err error) *logrus.Entry { + return Logs.WithError(err) +} diff --git a/src/backend/dispatch-k8s-manager/pkg/task/builder_task.go b/src/backend/dispatch-k8s-manager/pkg/task/builder_task.go index e0c8f6ed7bb..469a9d31652 100644 --- a/src/backend/dispatch-k8s-manager/pkg/task/builder_task.go +++ b/src/backend/dispatch-k8s-manager/pkg/task/builder_task.go @@ -9,17 +9,18 @@ import ( "disaptch-k8s-manager/pkg/prometheus" "disaptch-k8s-manager/pkg/types" "fmt" + "time" + "github.com/pkg/errors" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/watch" - "time" ) func DoCreateBuilder(taskId string, dep *kubeclient.Deployment) { _, err := kubeclient.CreateDockerRegistry(dep.Pod.PullImageSecret) if err != nil { - failTask(taskId, errors.Wrap(err, "create builder pull image secret error").Error()) + FailTask(taskId, errors.Wrap(err, "create builder pull image secret error").Error()) return } @@ -29,14 +30,14 @@ func DoCreateBuilder(taskId string, dep *kubeclient.Deployment) { } // 创建失败后的操作 - failTask(taskId, errors.Wrap(err, "create builder error").Error()) + FailTask(taskId, errors.Wrap(err, "create builder error").Error()) deleteBuilderLinkRes(dep.Name) } func DoStartBuilder(taskId string, builderName string, data []byte) { err := kubeclient.PatchDeployment(builderName, data) if err != nil { - failTask(taskId, errors.Wrap(err, "start builder error").Error()) + FailTask(taskId, errors.Wrap(err, "start builder error").Error()) return } } @@ -55,7 +56,7 @@ func DoStopBuilder(taskId string, builderName string, data []byte) { err = kubeclient.PatchDeployment(builderName, data) if err != nil { - failTask(taskId, errors.Wrap(err, "stop builder error").Error()) + FailTask(taskId, errors.Wrap(err, "stop builder error").Error()) return } @@ -123,14 +124,14 @@ func saveRealResourceUsage(builderName string, pods []*corev1.Pod) error { func DoDeleteBuilder(taskId string, builderName string) { err := kubeclient.DeleteDeployment(builderName) if err != nil { - failTask(taskId, errors.Wrap(err, "delete builder error").Error()) + FailTask(taskId, errors.Wrap(err, "delete builder error").Error()) return } deleteBuilderLinkRes(builderName) deleteBuilderLinkDbData(builderName) - okTask(taskId) + OkTask(taskId) } // deleteBuilderLinkRes 删除构建机相关联的kubernetes资源 @@ -177,7 +178,7 @@ func watchBuilderTaskPodCreateOrStart(event watch.Event, pod *corev1.Pod, taskId { switch podStatus.Phase { case corev1.PodPending: - updateTask(taskId, types.TaskRunning) + UpdateTask(taskId, types.TaskRunning) // 对于task的start/create来说,启动了就算成功,而不关心启动成功还是失败了 case corev1.PodRunning, corev1.PodSucceeded, corev1.PodFailed: { @@ -206,7 +207,7 @@ func watchBuilderTaskPodCreateOrStart(event watch.Event, pod *corev1.Pod, taskId } defer redis.UnLock(key) - okTask(taskId) + OkTask(taskId) // mysql中保存分配至节点成功的构建机最近三次节点信息,用来做下一次调度的依据 if builderName == "" { @@ -222,13 +223,13 @@ func watchBuilderTaskPodCreateOrStart(event watch.Event, pod *corev1.Pod, taskId return } case corev1.PodUnknown: - updateTask(taskId, types.TaskUnknown) + UpdateTask(taskId, types.TaskUnknown) } } case watch.Error: { logs.Error("add job error. ", pod) - failTask(taskId, podStatus.Message+"|"+podStatus.Reason) + FailTask(taskId, podStatus.Message+"|"+podStatus.Reason) } } } @@ -265,14 +266,14 @@ func watchBuilderTaskDeploymentStop(event watch.Event, dep *appsv1.Deployment, t switch event.Type { case watch.Modified: if dep.Spec.Replicas != nil && *dep.Spec.Replicas == 0 { - okTask(taskId) + OkTask(taskId) } case watch.Error: logs.Error("stop builder error. ", dep) if len(dep.Status.Conditions) > 0 { - failTask(taskId, dep.Status.Conditions[0].String()) + FailTask(taskId, dep.Status.Conditions[0].String()) } else { - failTask(taskId, "stop builder error") + FailTask(taskId, "stop builder error") } } } diff --git a/src/backend/dispatch-k8s-manager/pkg/task/job_task.go b/src/backend/dispatch-k8s-manager/pkg/task/job_task.go index 0c8abc352c4..478363cdd98 100644 --- a/src/backend/dispatch-k8s-manager/pkg/task/job_task.go +++ b/src/backend/dispatch-k8s-manager/pkg/task/job_task.go @@ -5,6 +5,7 @@ import ( "disaptch-k8s-manager/pkg/logs" "disaptch-k8s-manager/pkg/types" "fmt" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/watch" @@ -18,12 +19,12 @@ func DoCreateBuildAndPushImageJob( // 创建镜像拉取凭据 _, err := kubeclient.CreateDockerRegistry(job.Pod.PullImageSecret) if err != nil { - failTask(taskId, errors.Wrap(err, "create build and push image job pull image secret error").Error()) + FailTask(taskId, errors.Wrap(err, "create build and push image job pull image secret error").Error()) return } if _, err = kubeclient.CreateDockerRegistry(kanikoSecret); err != nil { - failTask(taskId, errors.Wrap(err, "create build and push image push secret error").Error()) + FailTask(taskId, errors.Wrap(err, "create build and push image push secret error").Error()) return } @@ -32,14 +33,14 @@ func DoCreateBuildAndPushImageJob( return } - failTask(taskId, errors.Wrap(err, "create job error").Error()) + FailTask(taskId, errors.Wrap(err, "create job error").Error()) deleteJobLinkRes(job.Name) } func DoCreateJob(taskId string, job *kubeclient.Job) { _, err := kubeclient.CreateDockerRegistry(job.Pod.PullImageSecret) if err != nil { - failTask(taskId, errors.Wrap(err, "create job pull image secret error").Error()) + FailTask(taskId, errors.Wrap(err, "create job pull image secret error").Error()) return } @@ -49,7 +50,7 @@ func DoCreateJob(taskId string, job *kubeclient.Job) { } // 创建失败后的操作 - failTask(taskId, errors.Wrap(err, "create job error").Error()) + FailTask(taskId, errors.Wrap(err, "create job error").Error()) deleteJobLinkRes(job.Name) } @@ -57,13 +58,13 @@ func DoCreateJob(taskId string, job *kubeclient.Job) { func DoDeleteJob(taskId string, jobName string) { err := kubeclient.DeleteJob(jobName) if err != nil { - failTask(taskId, errors.Wrap(err, "delete job error").Error()) + FailTask(taskId, errors.Wrap(err, "delete job error").Error()) return } deleteJobLinkRes(jobName) - okTask(taskId) + OkTask(taskId) } // deleteJobLinkRes 删除JOB相关联的kubernetes资源 @@ -103,18 +104,18 @@ func watchJobTaskPodCreateOrStart(event watch.Event, pod *corev1.Pod, taskId str { switch podStatus.Phase { case corev1.PodPending: - updateTask(taskId, types.TaskRunning) + UpdateTask(taskId, types.TaskRunning) // 对于task的start/create来说,启动了就算成功,而不关系启动成功还是失败了 case corev1.PodRunning, corev1.PodSucceeded, corev1.PodFailed: - okTask(taskId) + OkTask(taskId) case corev1.PodUnknown: - updateTask(taskId, types.TaskUnknown) + UpdateTask(taskId, types.TaskUnknown) } } case watch.Error: { logs.Error("add job error. ", pod) - failTask(taskId, podStatus.Message+"|"+podStatus.Reason) + FailTask(taskId, podStatus.Message+"|"+podStatus.Reason) } } } diff --git a/src/backend/dispatch-k8s-manager/pkg/task/task.go b/src/backend/dispatch-k8s-manager/pkg/task/task.go index dc9fbf4c388..bb9bbf4fbff 100644 --- a/src/backend/dispatch-k8s-manager/pkg/task/task.go +++ b/src/backend/dispatch-k8s-manager/pkg/task/task.go @@ -4,7 +4,6 @@ import ( "disaptch-k8s-manager/pkg/db/mysql" "disaptch-k8s-manager/pkg/logs" "disaptch-k8s-manager/pkg/types" - "github.com/pkg/errors" ) func InitTask() { @@ -12,23 +11,30 @@ func InitTask() { go WatchTaskDeployment() } -func okTask(taskId string) { +func OkTask(taskId string) { err := mysql.UpdateTask(taskId, types.TaskSucceeded, "") if err != nil { - logs.Error(errors.Wrapf(err, "save okTask %s %s error. ", taskId, "")) + logs.Errorf("save OkTask %s error %s", taskId, err.Error()) } } -func updateTask(taskId string, state types.TaskState) { +func OkTaskWithMessage(taskId string, message string) { + err := mysql.UpdateTask(taskId, types.TaskSucceeded, message) + if err != nil { + logs.Errorf("save OkTaskWithMessage %s %s error %s", taskId, message, err.Error()) + } +} + +func UpdateTask(taskId string, state types.TaskState) { err := mysql.UpdateTask(taskId, state, "") if err != nil { - logs.Error(errors.Wrapf(err, "update okTask %s %s error. ", taskId, "")) + logs.Errorf("save UpdateTask %s %s error %s", taskId, state, err.Error()) } } -func failTask(taskId string, message string) { +func FailTask(taskId string, message string) { err := mysql.UpdateTask(taskId, types.TaskFailed, message) if err != nil { - logs.Error(errors.Wrapf(err, "save failTask %s %s error. ", taskId, message)) + logs.Errorf("save FailTask %s %s error %s", taskId, message, err.Error()) } } diff --git a/src/backend/dispatch-k8s-manager/pkg/types/task_type.go b/src/backend/dispatch-k8s-manager/pkg/types/task_type.go index ce8bdb9bdd9..75f5bc54043 100644 --- a/src/backend/dispatch-k8s-manager/pkg/types/task_type.go +++ b/src/backend/dispatch-k8s-manager/pkg/types/task_type.go @@ -23,6 +23,11 @@ const ( TaskActionDelete TaskAction = "delete" ) +// docker 交互操作 +const ( + TaskDockerActionInspect TaskAction = "inspect" +) + type TaskLabelType string const ( @@ -36,6 +41,7 @@ type TaskBelong string const ( TaskBelongBuilder = "builder" TaskBelongJob = "job" + TaskBelongDocker = "docker" ) type Task struct { diff --git a/src/backend/dispatch-k8s-manager/resources/config.yaml b/src/backend/dispatch-k8s-manager/resources/config.yaml index f54d2fc5e10..3b68ed3b474 100644 --- a/src/backend/dispatch-k8s-manager/resources/config.yaml +++ b/src/backend/dispatch-k8s-manager/resources/config.yaml @@ -2,7 +2,7 @@ server: port: 8081 mysql: - dataSourceName: root:123456@tcp(localhost:3306)/devops_kubernetes_manager?parseTime=true&loc=Local + dataSourceName: root:123456@tcp(localhost:3306)/devops_ci_kubernetes_manager?parseTime=true&loc=Local connMaxLifetime: 3 maxOpenConns: 10 maxIdleConns: 10 @@ -86,6 +86,9 @@ apiserver: apiToken: key: Devops-Token value: landun - rsaPrivateKey: | - # 在这里保存私钥用来解密apitoken - # 推荐使用rsa-generate生成公私钥,rsa-generate可通过make打包获得 + # 在这里保存私钥用来解密apitoken + # 推荐使用rsa-generate生成公私钥,rsa-generate可通过make打包获得 + rsaPrivateKey: "" + +docker: + enable: true diff --git a/src/backend/dispatch-k8s-manager/swagger/apiserver/docs.go b/src/backend/dispatch-k8s-manager/swagger/apiserver/docs.go index 609c9e87d6b..b1a5352f9bf 100644 --- a/src/backend/dispatch-k8s-manager/swagger/apiserver/docs.go +++ b/src/backend/dispatch-k8s-manager/swagger/apiserver/docs.go @@ -1,5 +1,5 @@ -// Package apiserver GENERATED BY SWAG; DO NOT EDIT -// This file was generated by swaggo/swag +// Code generated by swaggo/swag. DO NOT EDIT. + package apiserver import "github.com/swaggo/swag" @@ -309,6 +309,55 @@ const docTemplate = `{ } } }, + "/docker/inspect": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "docker" + ], + "summary": "docker inspect命令(同时会pull)", + "parameters": [ + { + "type": "string", + "description": "凭证信息", + "name": "Devops-Token", + "in": "header", + "required": true + }, + { + "description": "构建机信息", + "name": "info", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/service.DockerInspectInfo" + } + } + ], + "responses": { + "200": { + "description": "任务ID", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/types.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/service.TaskId" + } + } + } + ] + } + } + } + } + }, "/jobs": { "post": { "consumes": [ @@ -618,7 +667,11 @@ const docTemplate = `{ }, "info": { "description": "构建并推送镜像的具体信息", - "$ref": "#/definitions/service.buildImageInfo" + "allOf": [ + { + "$ref": "#/definitions/service.buildImageInfo" + } + ] }, "name": { "description": "唯一名称", @@ -627,11 +680,19 @@ const docTemplate = `{ }, "podNameSelector": { "description": "Pod名称调度", - "$ref": "#/definitions/service.PodNameSelector" + "allOf": [ + { + "$ref": "#/definitions/service.PodNameSelector" + } + ] }, "resource": { "description": "工作负载资源", - "$ref": "#/definitions/service.CommonWorkLoadResource" + "allOf": [ + { + "$ref": "#/definitions/service.CommonWorkLoadResource" + } + ] } } }, @@ -675,19 +736,35 @@ const docTemplate = `{ }, "privateBuilder": { "description": "私有构建机配置", - "$ref": "#/definitions/service.DedicatedBuilder" + "allOf": [ + { + "$ref": "#/definitions/service.DedicatedBuilder" + } + ] }, "registry": { "description": "镜像凭证", - "$ref": "#/definitions/types.Registry" + "allOf": [ + { + "$ref": "#/definitions/types.Registry" + } + ] }, "resource": { "description": "工作负载资源", - "$ref": "#/definitions/service.CommonWorkLoadResource" + "allOf": [ + { + "$ref": "#/definitions/service.CommonWorkLoadResource" + } + ] }, "specialBuilder": { "description": "特殊构建机配置", - "$ref": "#/definitions/service.DedicatedBuilder" + "allOf": [ + { + "$ref": "#/definitions/service.DedicatedBuilder" + } + ] } } }, @@ -708,6 +785,27 @@ const docTemplate = `{ } } }, + "service.BuilderState": { + "type": "string", + "enum": [ + "readyToRun", + "notExist", + "pending", + "running", + "succeeded", + "failed", + "unknown" + ], + "x-enum-varnames": [ + "BuilderReadyToRun", + "BuilderNotExist", + "BuilderPending", + "BuilderRunning", + "BuilderSucceeded", + "BuilderFailed", + "BuilderUnknown" + ] + }, "service.BuilderStatus": { "type": "object", "properties": { @@ -715,7 +813,7 @@ const docTemplate = `{ "type": "string" }, "status": { - "type": "string" + "$ref": "#/definitions/service.BuilderState" } } }, @@ -766,6 +864,17 @@ const docTemplate = `{ } } }, + "service.Credential": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, "service.DedicatedBuilder": { "type": "object", "properties": { @@ -774,6 +883,31 @@ const docTemplate = `{ } } }, + "service.DockerInspectInfo": { + "type": "object", + "required": [ + "name", + "ref" + ], + "properties": { + "cred": { + "description": "拉取镜像凭据", + "allOf": [ + { + "$ref": "#/definitions/service.Credential" + } + ] + }, + "name": { + "description": "任务名称,唯一", + "type": "string" + }, + "ref": { + "description": "docker镜像信息 如:docker:latest", + "type": "string" + } + } + }, "service.Job": { "type": "object", "required": [ @@ -818,18 +952,47 @@ const docTemplate = `{ }, "podNameSelector": { "description": "Pod名称调度选项", - "$ref": "#/definitions/service.PodNameSelector" + "allOf": [ + { + "$ref": "#/definitions/service.PodNameSelector" + } + ] }, "registry": { "description": "镜像凭证", - "$ref": "#/definitions/types.Registry" + "allOf": [ + { + "$ref": "#/definitions/types.Registry" + } + ] }, "resource": { "description": "工作负载资源", - "$ref": "#/definitions/service.CommonWorkLoadResource" + "allOf": [ + { + "$ref": "#/definitions/service.CommonWorkLoadResource" + } + ] } } }, + "service.JobState": { + "type": "string", + "enum": [ + "pending", + "running", + "succeeded", + "failed", + "unknown" + ], + "x-enum-varnames": [ + "JobPending", + "JobRunning", + "JobSucceeded", + "JobFailed", + "JobUnknown" + ] + }, "service.JobStatus": { "type": "object", "properties": { @@ -840,7 +1003,7 @@ const docTemplate = `{ "type": "string" }, "state": { - "type": "string" + "$ref": "#/definitions/service.JobState" } } }, @@ -875,7 +1038,7 @@ const docTemplate = `{ "type": "string" }, "status": { - "type": "string" + "$ref": "#/definitions/types.TaskState" } } }, @@ -958,6 +1121,23 @@ const docTemplate = `{ "type": "integer" } } + }, + "types.TaskState": { + "type": "string", + "enum": [ + "waiting", + "running", + "succeeded", + "failed", + "unknown" + ], + "x-enum-varnames": [ + "TaskWaiting", + "TaskRunning", + "TaskSucceeded", + "TaskFailed", + "TaskUnknown" + ] } } }` @@ -972,6 +1152,8 @@ var SwaggerInfo = &swag.Spec{ Description: "", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", } func init() { diff --git a/src/backend/dispatch-k8s-manager/swagger/apiserver/swagger.json b/src/backend/dispatch-k8s-manager/swagger/apiserver/swagger.json index d53e59cc2a0..66563b9aa23 100644 --- a/src/backend/dispatch-k8s-manager/swagger/apiserver/swagger.json +++ b/src/backend/dispatch-k8s-manager/swagger/apiserver/swagger.json @@ -300,6 +300,55 @@ } } }, + "/docker/inspect": { + "post": { + "consumes": [ + "application/json" + ], + "tags": [ + "docker" + ], + "summary": "docker inspect命令(同时会pull)", + "parameters": [ + { + "type": "string", + "description": "凭证信息", + "name": "Devops-Token", + "in": "header", + "required": true + }, + { + "description": "构建机信息", + "name": "info", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/service.DockerInspectInfo" + } + } + ], + "responses": { + "200": { + "description": "任务ID", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/types.Result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/service.TaskId" + } + } + } + ] + } + } + } + } + }, "/jobs": { "post": { "consumes": [ @@ -609,7 +658,11 @@ }, "info": { "description": "构建并推送镜像的具体信息", - "$ref": "#/definitions/service.buildImageInfo" + "allOf": [ + { + "$ref": "#/definitions/service.buildImageInfo" + } + ] }, "name": { "description": "唯一名称", @@ -618,11 +671,19 @@ }, "podNameSelector": { "description": "Pod名称调度", - "$ref": "#/definitions/service.PodNameSelector" + "allOf": [ + { + "$ref": "#/definitions/service.PodNameSelector" + } + ] }, "resource": { "description": "工作负载资源", - "$ref": "#/definitions/service.CommonWorkLoadResource" + "allOf": [ + { + "$ref": "#/definitions/service.CommonWorkLoadResource" + } + ] } } }, @@ -666,19 +727,35 @@ }, "privateBuilder": { "description": "私有构建机配置", - "$ref": "#/definitions/service.DedicatedBuilder" + "allOf": [ + { + "$ref": "#/definitions/service.DedicatedBuilder" + } + ] }, "registry": { "description": "镜像凭证", - "$ref": "#/definitions/types.Registry" + "allOf": [ + { + "$ref": "#/definitions/types.Registry" + } + ] }, "resource": { "description": "工作负载资源", - "$ref": "#/definitions/service.CommonWorkLoadResource" + "allOf": [ + { + "$ref": "#/definitions/service.CommonWorkLoadResource" + } + ] }, "specialBuilder": { "description": "特殊构建机配置", - "$ref": "#/definitions/service.DedicatedBuilder" + "allOf": [ + { + "$ref": "#/definitions/service.DedicatedBuilder" + } + ] } } }, @@ -699,6 +776,27 @@ } } }, + "service.BuilderState": { + "type": "string", + "enum": [ + "readyToRun", + "notExist", + "pending", + "running", + "succeeded", + "failed", + "unknown" + ], + "x-enum-varnames": [ + "BuilderReadyToRun", + "BuilderNotExist", + "BuilderPending", + "BuilderRunning", + "BuilderSucceeded", + "BuilderFailed", + "BuilderUnknown" + ] + }, "service.BuilderStatus": { "type": "object", "properties": { @@ -706,7 +804,7 @@ "type": "string" }, "status": { - "type": "string" + "$ref": "#/definitions/service.BuilderState" } } }, @@ -757,6 +855,17 @@ } } }, + "service.Credential": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, "service.DedicatedBuilder": { "type": "object", "properties": { @@ -765,6 +874,31 @@ } } }, + "service.DockerInspectInfo": { + "type": "object", + "required": [ + "name", + "ref" + ], + "properties": { + "cred": { + "description": "拉取镜像凭据", + "allOf": [ + { + "$ref": "#/definitions/service.Credential" + } + ] + }, + "name": { + "description": "任务名称,唯一", + "type": "string" + }, + "ref": { + "description": "docker镜像信息 如:docker:latest", + "type": "string" + } + } + }, "service.Job": { "type": "object", "required": [ @@ -809,18 +943,47 @@ }, "podNameSelector": { "description": "Pod名称调度选项", - "$ref": "#/definitions/service.PodNameSelector" + "allOf": [ + { + "$ref": "#/definitions/service.PodNameSelector" + } + ] }, "registry": { "description": "镜像凭证", - "$ref": "#/definitions/types.Registry" + "allOf": [ + { + "$ref": "#/definitions/types.Registry" + } + ] }, "resource": { "description": "工作负载资源", - "$ref": "#/definitions/service.CommonWorkLoadResource" + "allOf": [ + { + "$ref": "#/definitions/service.CommonWorkLoadResource" + } + ] } } }, + "service.JobState": { + "type": "string", + "enum": [ + "pending", + "running", + "succeeded", + "failed", + "unknown" + ], + "x-enum-varnames": [ + "JobPending", + "JobRunning", + "JobSucceeded", + "JobFailed", + "JobUnknown" + ] + }, "service.JobStatus": { "type": "object", "properties": { @@ -831,7 +994,7 @@ "type": "string" }, "state": { - "type": "string" + "$ref": "#/definitions/service.JobState" } } }, @@ -866,7 +1029,7 @@ "type": "string" }, "status": { - "type": "string" + "$ref": "#/definitions/types.TaskState" } } }, @@ -949,6 +1112,23 @@ "type": "integer" } } + }, + "types.TaskState": { + "type": "string", + "enum": [ + "waiting", + "running", + "succeeded", + "failed", + "unknown" + ], + "x-enum-varnames": [ + "TaskWaiting", + "TaskRunning", + "TaskSucceeded", + "TaskFailed", + "TaskUnknown" + ] } } } \ No newline at end of file diff --git a/src/backend/dispatch-k8s-manager/swagger/apiserver/swagger.yaml b/src/backend/dispatch-k8s-manager/swagger/apiserver/swagger.yaml index 03fecc91edb..96ebce4efc4 100644 --- a/src/backend/dispatch-k8s-manager/swagger/apiserver/swagger.yaml +++ b/src/backend/dispatch-k8s-manager/swagger/apiserver/swagger.yaml @@ -6,17 +6,20 @@ definitions: description: Job存活时间 type: integer info: - $ref: '#/definitions/service.buildImageInfo' + allOf: + - $ref: '#/definitions/service.buildImageInfo' description: 构建并推送镜像的具体信息 name: description: 唯一名称 maxLength: 32 type: string podNameSelector: - $ref: '#/definitions/service.PodNameSelector' + allOf: + - $ref: '#/definitions/service.PodNameSelector' description: Pod名称调度 resource: - $ref: '#/definitions/service.CommonWorkLoadResource' + allOf: + - $ref: '#/definitions/service.CommonWorkLoadResource' description: 工作负载资源 required: - info @@ -49,16 +52,20 @@ definitions: $ref: '#/definitions/types.NFS' type: array privateBuilder: - $ref: '#/definitions/service.DedicatedBuilder' + allOf: + - $ref: '#/definitions/service.DedicatedBuilder' description: 私有构建机配置 registry: - $ref: '#/definitions/types.Registry' + allOf: + - $ref: '#/definitions/types.Registry' description: 镜像凭证 resource: - $ref: '#/definitions/service.CommonWorkLoadResource' + allOf: + - $ref: '#/definitions/service.CommonWorkLoadResource' description: 工作负载资源 specialBuilder: - $ref: '#/definitions/service.DedicatedBuilder' + allOf: + - $ref: '#/definitions/service.DedicatedBuilder' description: 特殊构建机配置 required: - image @@ -76,12 +83,30 @@ definitions: type: string type: object type: object + service.BuilderState: + enum: + - readyToRun + - notExist + - pending + - running + - succeeded + - failed + - unknown + type: string + x-enum-varnames: + - BuilderReadyToRun + - BuilderNotExist + - BuilderPending + - BuilderRunning + - BuilderSucceeded + - BuilderFailed + - BuilderUnknown service.BuilderStatus: properties: message: type: string status: - type: string + $ref: '#/definitions/service.BuilderState' type: object service.CommonWorkLoadResource: properties: @@ -119,11 +144,34 @@ definitions: - requestDiskIO - requestMem type: object + service.Credential: + properties: + password: + type: string + username: + type: string + type: object service.DedicatedBuilder: properties: name: type: string type: object + service.DockerInspectInfo: + properties: + cred: + allOf: + - $ref: '#/definitions/service.Credential' + description: 拉取镜像凭据 + name: + description: 任务名称,唯一 + type: string + ref: + description: docker镜像信息 如:docker:latest + type: string + required: + - name + - ref + type: object service.Job: properties: activeDeadlineSeconds: @@ -152,19 +200,36 @@ definitions: $ref: '#/definitions/types.NFS' type: array podNameSelector: - $ref: '#/definitions/service.PodNameSelector' + allOf: + - $ref: '#/definitions/service.PodNameSelector' description: Pod名称调度选项 registry: - $ref: '#/definitions/types.Registry' + allOf: + - $ref: '#/definitions/types.Registry' description: 镜像凭证 resource: - $ref: '#/definitions/service.CommonWorkLoadResource' + allOf: + - $ref: '#/definitions/service.CommonWorkLoadResource' description: 工作负载资源 required: - image - name - resource type: object + service.JobState: + enum: + - pending + - running + - succeeded + - failed + - unknown + type: string + x-enum-varnames: + - JobPending + - JobRunning + - JobSucceeded + - JobFailed + - JobUnknown service.JobStatus: properties: message: @@ -172,7 +237,7 @@ definitions: podIp: type: string state: - type: string + $ref: '#/definitions/service.JobState' type: object service.PodNameSelector: properties: @@ -195,7 +260,7 @@ definitions: detail: type: string status: - type: string + $ref: '#/definitions/types.TaskState' type: object service.buildImageInfo: properties: @@ -252,6 +317,20 @@ definitions: status: type: integer type: object + types.TaskState: + enum: + - waiting + - running + - succeeded + - failed + - unknown + type: string + x-enum-varnames: + - TaskWaiting + - TaskRunning + - TaskSucceeded + - TaskFailed + - TaskUnknown info: contact: {} title: kubernetes-manager api文档 @@ -432,6 +511,35 @@ paths: summary: 获取远程登录链接 tags: - builder + /docker/inspect: + post: + consumes: + - application/json + parameters: + - description: 凭证信息 + in: header + name: Devops-Token + required: true + type: string + - description: 构建机信息 + in: body + name: info + required: true + schema: + $ref: '#/definitions/service.DockerInspectInfo' + responses: + "200": + description: 任务ID + schema: + allOf: + - $ref: '#/definitions/types.Result' + - properties: + data: + $ref: '#/definitions/service.TaskId' + type: object + summary: docker inspect命令(同时会pull) + tags: + - docker /jobs: post: consumes: diff --git a/src/backend/dispatch-k8s-manager/swagger/init-swager.sh b/src/backend/dispatch-k8s-manager/swagger/init-swager.sh old mode 100644 new mode 100755 From 59e0a949941ec68232d6ae0fa8122fca275807aa Mon Sep 17 00:00:00 2001 From: ruotiantang Date: Thu, 25 May 2023 09:44:31 +0800 Subject: [PATCH 002/633] =?UTF-8?q?kubernetes-manager=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?docker=20inspect=20image=20#8862?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../local_chart/kubernetes-management/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-charts/core/ci/local_chart/kubernetes-management/templates/deployment.yaml b/helm-charts/core/ci/local_chart/kubernetes-management/templates/deployment.yaml index 63110efdd33..8a3ea65fbc3 100644 --- a/helm-charts/core/ci/local_chart/kubernetes-management/templates/deployment.yaml +++ b/helm-charts/core/ci/local_chart/kubernetes-management/templates/deployment.yaml @@ -73,7 +73,7 @@ spec: {{- end}} {{- if .Values.kubernetesManager.debug }} - name: KUBERNETES_MANAGER_DEBUG_ENABLE - value: true + value: "true" {{- end}} workingDir: /data/workspace/kubernetes-manager livenessProbe: From 74b9dc6609230c8a0345ecb7c4a346df9739bc65 Mon Sep 17 00:00:00 2001 From: stubenhuang Date: Mon, 27 May 2024 20:06:08 +0800 Subject: [PATCH 003/633] =?UTF-8?q?feat:=20=E8=AE=A9worker=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=9C=A8JDK17=E4=B8=AD=E8=BF=90=E8=A1=8C=20#10412?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tencent/devops/common/api/util/EnumUtil.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/EnumUtil.kt b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/EnumUtil.kt index f30a88eb446..d60e44c923a 100644 --- a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/EnumUtil.kt +++ b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/EnumUtil.kt @@ -27,10 +27,9 @@ package com.tencent.devops.common.api.util -import sun.reflect.ConstructorAccessor -import sun.reflect.FieldAccessor import sun.reflect.ReflectionFactory import java.lang.reflect.AccessibleObject +import java.lang.reflect.Constructor import java.lang.reflect.Field import java.lang.reflect.Modifier import kotlin.reflect.full.isSubclassOf @@ -131,8 +130,7 @@ object EnumUtil { var modifiers: Int = modifiersField.getInt(field) modifiers = modifiers and Modifier.FINAL.inv() modifiersField.setInt(field, modifiers) - val fieldAccessor: FieldAccessor = reflectionFactory.newFieldAccessor(field, false) - fieldAccessor.set(target, value) + field.set(target, value) } @Throws(NoSuchFieldException::class, IllegalAccessException::class) @@ -155,7 +153,7 @@ object EnumUtil { inline fun getConstructorAccessor( enumClass: Class, additionalParameterTypes: Array> - ): ConstructorAccessor? { + ): Constructor? { val parameterTypes = arrayOfNulls?>(additionalParameterTypes.size + 2) parameterTypes[0] = String::class.java // enum class first field: field name parameterTypes[1] = Int::class.javaPrimitiveType // enum class second field: ordinal @@ -163,14 +161,17 @@ object EnumUtil { enumClass.declaredConstructors.forEach { constructor -> if (compareParameterType(constructor.parameterTypes, parameterTypes)) { try { - return reflectionFactory.newConstructorAccessor(constructor) + constructor.isAccessible = true + return constructor } catch (ignored: IllegalArgumentException) { // skip illegal argument try next one } } } - return reflectionFactory.newConstructorAccessor(enumClass.getDeclaredConstructor(*parameterTypes)) + val constructor = enumClass.getDeclaredConstructor(*parameterTypes) + constructor.isAccessible = true + return constructor } fun compareParameterType(constructorParameterType: Array>, parameterTypes: Array?>): Boolean { @@ -181,7 +182,8 @@ object EnumUtil { if (constructorParameterType[i] !== parameterTypes[i]) { if (constructorParameterType[i].isPrimitive && parameterTypes[i]!!.isPrimitive) { if (constructorParameterType[i].kotlin.javaPrimitiveType - !== parameterTypes[i]!!.kotlin.javaPrimitiveType) { + !== parameterTypes[i]!!.kotlin.javaPrimitiveType + ) { return false } } From 9a0bd1f264f07751aa6dff8385c361fd972fea9d Mon Sep 17 00:00:00 2001 From: stubenhuang Date: Tue, 28 May 2024 12:18:08 +0800 Subject: [PATCH 004/633] =?UTF-8?q?feat:=20=E8=AE=A9worker=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=9C=A8JDK17=E4=B8=AD=E8=BF=90=E8=A1=8C=20#10412?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ci/core/common/common-api/build.gradle.kts | 1 + .../tencent/devops/common/api/util/EnumUtil.kt | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/backend/ci/core/common/common-api/build.gradle.kts b/src/backend/ci/core/common/common-api/build.gradle.kts index da14be40068..5bb6780e936 100644 --- a/src/backend/ci/core/common/common-api/build.gradle.kts +++ b/src/backend/ci/core/common/common-api/build.gradle.kts @@ -53,4 +53,5 @@ dependencies { api("com.github.ben-manes.caffeine:caffeine") api("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") api("com.jakewharton:disklrucache") + api("org.apache.commons:commons-lang3") } diff --git a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/EnumUtil.kt b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/EnumUtil.kt index d60e44c923a..df20a35ee57 100644 --- a/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/EnumUtil.kt +++ b/src/backend/ci/core/common/common-api/src/main/kotlin/com/tencent/devops/common/api/util/EnumUtil.kt @@ -27,6 +27,7 @@ package com.tencent.devops.common.api.util +import org.apache.commons.lang3.reflect.MethodUtils import sun.reflect.ReflectionFactory import java.lang.reflect.AccessibleObject import java.lang.reflect.Constructor @@ -130,7 +131,15 @@ object EnumUtil { var modifiers: Int = modifiersField.getInt(field) modifiers = modifiers and Modifier.FINAL.inv() modifiersField.setInt(field, modifiers) - field.set(target, value) + + val fieldAccessor = MethodUtils.invokeMethod(field, true, "acquireFieldAccessor", false) + MethodUtils.invokeMethod( + fieldAccessor, + true, + "set", + arrayOf(target, value), + arrayOf>(Object::class.java, Object::class.java) + ) } @Throws(NoSuchFieldException::class, IllegalAccessException::class) @@ -150,7 +159,7 @@ object EnumUtil { } @Throws(NoSuchMethodException::class) - inline fun getConstructorAccessor( + inline fun getConstructor( enumClass: Class, additionalParameterTypes: Array> ): Constructor? { @@ -204,7 +213,10 @@ object EnumUtil { params[0] = value params[1] = Integer.valueOf(ordinal) System.arraycopy(additionalValues, 0, params, 2, additionalValues.size) - return enumClass.cast(getConstructorAccessor(enumClass, additionalTypes)!!.newInstance(params)) + val constructor = getConstructor(enumClass, additionalTypes) + val constructorAccessor = MethodUtils.invokeMethod(constructor, true, "acquireConstructorAccessor") + val instance = MethodUtils.invokeMethod(constructorAccessor, true, "newInstance", params) + return enumClass.cast(instance) } val reflectionFactory: ReflectionFactory = ReflectionFactory.getReflectionFactory() From c5752d415468c21cba6d2b96975bffe6ebd4bff5 Mon Sep 17 00:00:00 2001 From: v_yjjiaoyu <1981190393@qq.com> Date: Tue, 4 Jun 2024 14:24:04 +0800 Subject: [PATCH 005/633] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E6=88=90?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=20#9620=20#=20Reviewed,=20transacti?= =?UTF-8?q?on=20id:=209225?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/devops-manage/package.json | 8 +- .../permission-manage/group-aside.vue | 16 +- .../children/permission-manage/manage-all.vue | 478 +++++++++++++++++ .../permission-manage/manage-aside.vue | 442 ++++++++++++++++ .../permission-manage/permission-manage.vue | 16 +- .../permission-manage/select-group.vue | 52 ++ .../components/user-group/svg/user-active.svg | 1 + .../devops-manage/src/css/svg/close.svg | 1 + .../devops-manage/src/router/index.ts | 7 + .../src/views/manage/manage-entry.vue | 4 + .../manage/permission/permission-manage.vue | 494 ++++++++++++++++++ 11 files changed, 1511 insertions(+), 8 deletions(-) create mode 100644 src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue create mode 100644 src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-aside.vue create mode 100644 src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/select-group.vue create mode 100644 src/frontend/devops-manage/src/components/user-group/svg/user-active.svg create mode 100644 src/frontend/devops-manage/src/css/svg/close.svg create mode 100644 src/frontend/devops-manage/src/views/manage/permission/permission-manage.vue diff --git a/src/frontend/devops-manage/package.json b/src/frontend/devops-manage/package.json index 8ab4ee1959d..c9757f0355e 100644 --- a/src/frontend/devops-manage/package.json +++ b/src/frontend/devops-manage/package.json @@ -23,7 +23,7 @@ "license": "ISC", "dependencies": { "bk-permission": "^0.0.28", - "bkui-vue": "0.0.1-beta.456", + "bkui-vue": "2.0.1-beta.15", "dayjs": "^1.11.2", "pinia": "^2.0.23", "vue": "^3.2.41", @@ -45,6 +45,8 @@ "postcss-preset-env": "^7.8.2", "postcss-simple-vars": "^7.0.0", "postcss-url": "^10.1.3", - "typescript": "^4.8.4" + "typescript": "^4.8.4", + "less": "^4.2.0", + "less-loader": "^12.2.0" } -} +} \ No newline at end of file diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-aside.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-aside.vue index a1c00f80310..922fd3fd0dc 100644 --- a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-aside.vue +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-aside.vue @@ -22,8 +22,8 @@
+ > + {{ group.name }} @@ -218,7 +218,17 @@ export default { .get(`${this.ajaxPrefix}/auth/api/user/auth/resource/${this.projectCode}/${this.resourceType}/${this.resourceCode}/listGroup?page=${this.page}&pageSize=${pageSize}`) .then(({ data }) => { this.hasLoadEnd = !data.hasNext; - this.groupList.push(...data.records); + // this.groupList.push(...data.records); + this.groupList.push({ + "managerId": 13034, + "defaultGroup": true, + "groupId": 0, + "name": "全部项目成员", + "displayName": "全部项目成员", + "userCount": 9, + "departmentCount": 0, + "allProjectMembersFlag": true + }); // 首页需要加载 if (this.page === 1) { const chooseGroup = this.groupList.find(group => +group.groupId === +this.$route.query?.groupId) || this.groupList[0]; diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue new file mode 100644 index 00000000000..985ba5862ec --- /dev/null +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue @@ -0,0 +1,478 @@ + + + + + diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-aside.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-aside.vue new file mode 100644 index 00000000000..f6b04f1db05 --- /dev/null +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-aside.vue @@ -0,0 +1,442 @@ + + + + + \ No newline at end of file diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/permission-manage.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/permission-manage.vue index b32520199b1..4f6e16678cb 100644 --- a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/permission-manage.vue +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/permission-manage.vue @@ -12,15 +12,19 @@ @change-group-detail-tab="handleChangeGroupDetailTab" /> + + + diff --git a/src/frontend/devops-manage/src/components/user-group/svg/user-active.svg b/src/frontend/devops-manage/src/components/user-group/svg/user-active.svg new file mode 100644 index 00000000000..13e6fc235da --- /dev/null +++ b/src/frontend/devops-manage/src/components/user-group/svg/user-active.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/frontend/devops-manage/src/css/svg/close.svg b/src/frontend/devops-manage/src/css/svg/close.svg new file mode 100644 index 00000000000..9910df9f4d7 --- /dev/null +++ b/src/frontend/devops-manage/src/css/svg/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/frontend/devops-manage/src/router/index.ts b/src/frontend/devops-manage/src/router/index.ts index 30a36c2d4e2..04fe97d5b8f 100644 --- a/src/frontend/devops-manage/src/router/index.ts +++ b/src/frontend/devops-manage/src/router/index.ts @@ -12,6 +12,8 @@ const ShowProject = () => import(/* webpackChunkName: "ShowProject" */ '../views // 用户组管理 const UserGroup = () => import(/* webpackChunkName: "UserGroup" */ '../views/manage/group/group-entry.vue'); const ExpandManage = () => import(/* webpackChunkName: "ExpandManage" */ '../views/manage/expand/expand-manage.vue'); +// 授权管理 +const Permission = () => import(/* webpackChunkName: "ExpandManage" */ '../views/manage/permission/permission-manage.vue'); const router = createRouter({ history: createWebHistory('manage'), @@ -55,6 +57,11 @@ const router = createRouter({ name: 'group', component: UserGroup, }, + { + path: 'permission', + name: 'permission', + component: Permission, + }, { path: 'expand', name: 'expand', diff --git a/src/frontend/devops-manage/src/views/manage/manage-entry.vue b/src/frontend/devops-manage/src/views/manage/manage-entry.vue index 1a0e72062de..d3750cb21cd 100644 --- a/src/frontend/devops-manage/src/views/manage/manage-entry.vue +++ b/src/frontend/devops-manage/src/views/manage/manage-entry.vue @@ -23,6 +23,10 @@ const manageTabs = ref([ title: t('用户管理'), name: 'group', }, + { + title: t('授权管理'), + name: 'permission', + }, // { // title: t('微扩展管理'), // name: 'expand', diff --git a/src/frontend/devops-manage/src/views/manage/permission/permission-manage.vue b/src/frontend/devops-manage/src/views/manage/permission/permission-manage.vue new file mode 100644 index 00000000000..b7716003018 --- /dev/null +++ b/src/frontend/devops-manage/src/views/manage/permission/permission-manage.vue @@ -0,0 +1,494 @@ + + + + + \ No newline at end of file From 4ea20bebaa7fb2e943f6549cf4244b9ab9b656c8 Mon Sep 17 00:00:00 2001 From: v_yjjiaoyu <1981190393@qq.com> Date: Tue, 4 Jun 2024 15:49:44 +0800 Subject: [PATCH 006/633] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E6=88=90?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=20#9620=20#=20Reviewed,=20transacti?= =?UTF-8?q?on=20id:=209239?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../children/permission-manage/manage-all.vue | 209 +++++++++++++++++- .../manage/permission/permission-manage.vue | 1 - 2 files changed, 204 insertions(+), 6 deletions(-) diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue index 985ba5862ec..b32711e1c59 100644 --- a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue @@ -51,10 +51,23 @@ diff --git a/src/frontend/devops-manage/src/views/manage/permission/permission-manage.vue b/src/frontend/devops-manage/src/views/manage/permission/permission-manage.vue index b7716003018..4586c7a5a03 100644 --- a/src/frontend/devops-manage/src/views/manage/permission/permission-manage.vue +++ b/src/frontend/devops-manage/src/views/manage/permission/permission-manage.vue @@ -33,7 +33,6 @@ :columns="columns" height="100%" show-overflow-tooltip - v-bkloading="{ isLoading }" :scroll-loading="isScrollLoading" @select-all="handleSelectAll" @selection-change="handleSelectionChange" From b10cfdcb724eb6983d37f0c191c04d5d2f94dc2d Mon Sep 17 00:00:00 2001 From: v_yjjiaoyu <1981190393@qq.com> Date: Thu, 6 Jun 2024 11:26:58 +0800 Subject: [PATCH 007/633] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E6=88=90?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=20#9620=20#=20Reviewed,=20transacti?= =?UTF-8?q?on=20id:=209378?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../permission-manage/group-table.vue | 437 ++++++++++++ .../children/permission-manage/manage-all.vue | 674 +++++++++--------- .../children/permission-manage/time-limit.vue | 127 ++++ 3 files changed, 888 insertions(+), 350 deletions(-) create mode 100644 src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-table.vue create mode 100644 src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/time-limit.vue diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-table.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-table.vue new file mode 100644 index 00000000000..edf430237a0 --- /dev/null +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-table.vue @@ -0,0 +1,437 @@ + + + + + diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue index b32711e1c59..b5a1bfe041e 100644 --- a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/manage-all.vue @@ -37,170 +37,42 @@ 批量移交 批量移出
-
-

项目级用户组

-
- - - - - - -
+
+
-
-

资源级用户组

-
-

- 流水线-流水线组 - 3 -

- -
- - - - - - - - - - -
-
-
-
-

- 流水线-流水线组 - 3 +

+ +

+ 由于该用户仍有部分授权未移交,未能自动移出项目;如有需要,可前往「 + + 授权管理 + + 」处理

- -
- - - - - - - - - - -
-
-
+
- - diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/time-limit.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/time-limit.vue new file mode 100644 index 00000000000..07cfb35dad1 --- /dev/null +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/time-limit.vue @@ -0,0 +1,127 @@ + + + + + From 1a692b8eaa004b57d83ff019c47abffd15aeced8 Mon Sep 17 00:00:00 2001 From: v_yjjiaoyu <1981190393@qq.com> Date: Tue, 11 Jun 2024 20:04:53 +0800 Subject: [PATCH 008/633] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E6=88=90?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=20#9620=20#=20Reviewed,=20transacti?= =?UTF-8?q?on=20id:=209577?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/devops-manage/package.json | 2 +- .../permission-manage/group-table.vue | 438 ++++++++++++------ .../children/permission-manage/manage-all.vue | 5 +- .../permission-manage/manage-aside.vue | 23 +- 4 files changed, 317 insertions(+), 151 deletions(-) diff --git a/src/frontend/devops-manage/package.json b/src/frontend/devops-manage/package.json index c9757f0355e..bdbe181b5df 100644 --- a/src/frontend/devops-manage/package.json +++ b/src/frontend/devops-manage/package.json @@ -23,7 +23,7 @@ "license": "ISC", "dependencies": { "bk-permission": "^0.0.28", - "bkui-vue": "2.0.1-beta.15", + "bkui-vue": "2.0.1-beta.15.table.9", "dayjs": "^1.11.2", "pinia": "^2.0.23", "vue": "^3.2.41", diff --git a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-table.vue b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-table.vue index edf430237a0..c68872c34bc 100644 --- a/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-table.vue +++ b/src/frontend/devops-manage/src/components/user-group/components/children/permission-manage/group-table.vue @@ -15,13 +15,11 @@ - - + + + + + + + + + - - - -