mirror of https://github.com/kubevela/velaux.git
Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
|
9c8cc5d816 | |
|
0d00d92f55 | |
|
021024e4af | |
|
d9b7ae102f | |
|
8e11f93ed7 | |
|
5704854899 | |
|
73334e7516 | |
|
127f5325e9 | |
|
d5ea29f5ab | |
|
2ab672c09a | |
|
4579408f62 | |
|
d14a2b6538 |
|
@ -15,7 +15,7 @@ on:
|
|||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
GO_VERSION: '1.22.0'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
@ -23,13 +23,13 @@ permissions:
|
|||
jobs:
|
||||
|
||||
detect-noop:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
|
||||
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
|
@ -37,23 +37,23 @@ jobs:
|
|||
continue-on-error: true
|
||||
|
||||
arm64-build-test:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4
|
||||
- name: Build linux/arm64 image
|
||||
id: docker_build_2
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@1a162644f9a7e87d8f4b053101d1d9a712edc18c
|
||||
with:
|
||||
context: ./
|
||||
build-args: |
|
||||
|
|
|
@ -7,16 +7,16 @@ on:
|
|||
jobs:
|
||||
# align with crossplane's choice https://github.com/crossplane/crossplane/blob/master/.github/workflows/backport.yml
|
||||
open-pr:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
if: github.event.pull_request.merged
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Open Backport PR
|
||||
uses: zeebe-io/backport-action@v0.0.6
|
||||
uses: zeebe-io/backport-action@v0.0.9
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_workspace: ${{ github.workspace }}
|
||||
|
|
|
@ -24,18 +24,18 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
queries: +security-and-quality
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{ matrix.language }}"
|
||||
|
|
|
@ -11,9 +11,11 @@ on:
|
|||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: thehanimo/pr-title-checker@v1.4.0
|
||||
- uses: thehanimo/pr-title-checker@v1.4.2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
pass_on_octokit_error: true
|
||||
configuration_path: ".github/pr-title-checker-config.json"
|
||||
configuration_path: '.github/pr-title-checker-config.json'
|
||||
|
|
|
@ -10,7 +10,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
|
||||
- name: Build Vela Core image from Dockerfile
|
||||
run: |
|
||||
|
@ -23,7 +23,7 @@ jobs:
|
|||
output: 'trivy-results.sarif'
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
if: always()
|
||||
with:
|
||||
sarif_file: 'trivy-results.sarif'
|
||||
sarif_file: 'trivy-results.sarif'
|
||||
|
|
|
@ -10,18 +10,18 @@ permissions:
|
|||
|
||||
jobs:
|
||||
bot:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
|
||||
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
with:
|
||||
repository: "oam-dev/kubevela-github-actions"
|
||||
path: ./actions
|
||||
ref: v0.4.2
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
|
||||
with:
|
||||
node-version: '14'
|
||||
node-version: '16'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: ./actions/package-lock.json
|
||||
- name: Install Dependencies
|
||||
|
@ -51,7 +51,7 @@ jobs:
|
|||
allow-edits: "false"
|
||||
permission-level: read
|
||||
- name: Handle Command
|
||||
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
|
||||
env:
|
||||
VERSION: ${{ steps.command.outputs.command-arguments }}
|
||||
with:
|
||||
|
@ -72,11 +72,11 @@ jobs:
|
|||
})
|
||||
console.log("Added '" + label + "' label.")
|
||||
- name: Checkout
|
||||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
|
||||
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Open Backport PR
|
||||
uses: zeebe-io/backport-action@a759fd2d7d3314c9bb57d97a0350a12e878d3c7a
|
||||
uses: zeebe-io/backport-action@v0.0.9
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_workspace: ${{ github.workspace }}
|
||||
|
@ -91,7 +91,7 @@ jobs:
|
|||
issues: write
|
||||
steps:
|
||||
- name: Retest the current pull request
|
||||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
|
||||
env:
|
||||
PULL_REQUEST_ID: ${{ github.event.issue.number }}
|
||||
COMMENT_ID: ${{ github.event.comment.id }}
|
||||
|
|
|
@ -10,7 +10,7 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
|
@ -25,18 +25,18 @@ jobs:
|
|||
run: |
|
||||
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
- uses: docker/setup-qemu-action@v3.1.0
|
||||
- uses: docker/setup-buildx-action@v3.4.0
|
||||
with:
|
||||
driver-opts: image=moby/buildkit:master
|
||||
- name: Build docker image
|
||||
id: acr_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6.3.0
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
|
|
|
@ -15,7 +15,7 @@ on:
|
|||
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
GO_VERSION: '1.22.0'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
@ -23,13 +23,13 @@ permissions:
|
|||
jobs:
|
||||
|
||||
detect-noop:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
|
||||
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
|
@ -37,24 +37,24 @@ jobs:
|
|||
continue-on-error: true
|
||||
|
||||
server-unit-tests:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
needs: detect-noop
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Cache Go Dependencies
|
||||
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .work/pkg
|
||||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
|
||||
|
@ -72,16 +72,6 @@ jobs:
|
|||
mysql database: 'kubevela'
|
||||
mysql root password: 'kubevelaSQL123'
|
||||
|
||||
- name: Set up OpenGauss
|
||||
uses: lgj101/opengauss-action@v1.6
|
||||
with:
|
||||
GS_VERSION: '5.0.0'
|
||||
GS_DB: 'kubevela'
|
||||
GS_USERNAME: 'kubevela'
|
||||
GS_PASSWORD: 'Kubevela-123'
|
||||
HOST_PORT: 15432
|
||||
CONTAINER_PORT: 5432
|
||||
|
||||
- name: Set up Postgres
|
||||
uses: Harmon758/postgresql-action@v1
|
||||
with:
|
||||
|
@ -91,17 +81,17 @@ jobs:
|
|||
postgresql password: 'Kubevela-123'
|
||||
|
||||
- name: Start MongoDB
|
||||
uses: supercharge/mongodb-github-action@d26215f71b2ce60420a2a3776a25893d11a65f85 # 1.9.0
|
||||
uses: supercharge/mongodb-github-action@5a87bd81f88e2a8b195f8b7b656f5cda1350815a # 1.11.0
|
||||
with:
|
||||
mongodb-version: '5.0'
|
||||
|
||||
# TODO need update action version to resolve node 12 deprecated.
|
||||
- name: install Kubebuilder
|
||||
uses: RyanSiu1995/kubebuilder-action@ff52bff1bae252239223476e5ab0d71d6ba02343
|
||||
uses: RyanSiu1995/kubebuilder-action@e7e4de1c1eaf1d089b9a186f7526239acadf0b40
|
||||
with:
|
||||
version: 3.1.0
|
||||
kubebuilderOnly: false
|
||||
kubernetesVersion: v1.21.2
|
||||
kubernetesVersion: v1.26.0
|
||||
|
||||
- name: Run api server unit test
|
||||
run: make unit-test-server
|
||||
|
@ -115,30 +105,30 @@ jobs:
|
|||
name: codecov-umbrella
|
||||
|
||||
server-e2e-tests:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [ detect-noop ]
|
||||
if: needs.detect-noop.outputs.noop != 'true'
|
||||
strategy:
|
||||
matrix:
|
||||
k8s-version: ["v1.21", "v1.26"]
|
||||
k8s-version: ["v1.26"]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||
uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
with:
|
||||
submodules: true
|
||||
- name: Build docker image
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@1a162644f9a7e87d8f4b053101d1d9a712edc18c
|
||||
with:
|
||||
context: ./
|
||||
build-args: |
|
||||
|
@ -203,7 +193,7 @@ jobs:
|
|||
make enable-addon
|
||||
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: /tmp/e2e_apiserver_test.out
|
||||
|
|
|
@ -12,17 +12,17 @@ on:
|
|||
- release-*
|
||||
env:
|
||||
# Common versions
|
||||
GO_VERSION: '1.19'
|
||||
GO_VERSION: '1.22.0'
|
||||
|
||||
jobs:
|
||||
detect-noop:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
noop: ${{ steps.noop.outputs.should_skip }}
|
||||
steps:
|
||||
- name: Detect No-op Changes
|
||||
id: noop
|
||||
uses: fkirc/skip-duplicate-actions@v3.3.0
|
||||
uses: fkirc/skip-duplicate-actions@v5.3.1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
|
||||
|
@ -30,17 +30,20 @@ jobs:
|
|||
concurrent_skipping: false
|
||||
|
||||
check:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6
|
||||
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
|
||||
with:
|
||||
node-version: '16'
|
||||
cache: 'yarn'
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
|
||||
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
- name: Install Yarn
|
||||
run: npm install --global yarn
|
||||
- name: upgrade yarn
|
||||
run: yarn set version 3.6.0
|
||||
- run: yarn install
|
||||
|
|
2
Makefile
2
Makefile
|
@ -27,7 +27,7 @@ ifeq (, $(shell which staticcheck))
|
|||
@{ \
|
||||
set -e ;\
|
||||
echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\
|
||||
go install honnef.co/go/tools/cmd/staticcheck@d7e217c1ff411395475b2971c0824e1e7cc1af98 ;\
|
||||
go install honnef.co/go/tools/cmd/staticcheck@v0.4.7 ;\
|
||||
}
|
||||
STATICCHECK=$(GOBIN)/staticcheck
|
||||
else
|
||||
|
|
|
@ -46,7 +46,7 @@ func NewAPIServerCommand() *cobra.Command {
|
|||
Long: `The KubeVela API server validates and configures data for the API objects.
|
||||
The API Server services REST operations and provides the frontend to the
|
||||
cluster's shared state through which all other components interact.`,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, args []string) error { //nolint:revive,unused
|
||||
if err := s.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ cluster's shared state through which all other components interact.`,
|
|||
buildSwaggerCmd := &cobra.Command{
|
||||
Use: "build-swagger",
|
||||
Short: "Build swagger documentation of KubeVela apiserver",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, args []string) error { //nolint:revive,unused
|
||||
name := "docs/apidoc/latest-swagger.json"
|
||||
if len(args) > 0 {
|
||||
name = args[0]
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
|||
module github.com/kubevela/velaux
|
||||
|
||||
go 1.19
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
cuelang.org/go v0.5.0
|
||||
|
|
46
go.sum
46
go.sum
|
@ -2,7 +2,9 @@ cloud.google.com/go v0.100.2 h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y=
|
|||
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
|
||||
cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
|
||||
cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg=
|
||||
cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
|
||||
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
|
||||
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
|
||||
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
cuelang.org/go v0.5.0 h1:D6N0UgTGJCOxFKU8RU+qYvavKNsVc/+ZobmifStVJzU=
|
||||
|
@ -28,6 +30,7 @@ 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/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
|
||||
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
|
||||
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
|
||||
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
|
||||
|
@ -49,6 +52,7 @@ github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v
|
|||
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/Microsoft/hcsshim v0.10.0-rc.8 h1:YSZVvlIIDD1UxQpJp0h+dnpLUw+TrY0cx8obKsp3bek=
|
||||
github.com/Microsoft/hcsshim v0.10.0-rc.8/go.mod h1:OEthFdQv/AD2RAdzR6Mm1N1KPCztGKDurW1Z8b8VGMM=
|
||||
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
||||
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
|
||||
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
|
||||
|
@ -60,6 +64,7 @@ github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903/go.mod h1:8TI
|
|||
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs=
|
||||
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
|
||||
github.com/a8m/expect v1.0.0/go.mod h1:4IwSCMumY49ScypDnjNbYEjgVeqy1/U2cEs3Lat96eA=
|
||||
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
|
||||
github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
|
||||
|
@ -109,6 +114,7 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704/go.mod h1:RcDobYh8k5VP6TNybz9m
|
|||
github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY=
|
||||
github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
|
||||
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
|
||||
|
@ -135,6 +141,7 @@ github.com/barnettZQG/inject v0.0.1/go.mod h1:o83X2SlEKFliJx6UHai8bzFj+5isdBfOZs
|
|||
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
|
||||
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
|
@ -148,11 +155,15 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y
|
|||
github.com/briandowns/spinner v1.23.0 h1:alDF2guRWqa/FOZZYWjlMIx2L6H0wyewPxo/CH4Pt2A=
|
||||
github.com/briandowns/spinner v1.23.0/go.mod h1:rPG4gmXeN3wQV/TsAY4w8lPdIM6RX3yqeBQJSrbXjuE=
|
||||
github.com/bshuster-repo/logrus-logstash-hook v1.0.0 h1:e+C0SB5R1pu//O4MQ3f9cFuPGoOVeF2fE4Og9otCc70=
|
||||
github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
|
||||
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
|
||||
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd h1:rFt+Y/IK1aEZkEHchZRSq9OQbsSzIT/OrI8YFFmRIng=
|
||||
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
|
||||
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembjv71DPz3uX/V/6MMlSyD9JBQ6kQ=
|
||||
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
|
||||
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXer/kZD8Ri1aaunCxIEsOst1BVJswV0o=
|
||||
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
|
||||
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
||||
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
|
||||
github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
|
||||
|
@ -195,9 +206,11 @@ github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h
|
|||
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
|
||||
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
|
||||
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
|
||||
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
|
||||
github.com/containerd/containerd v1.7.2 h1:UF2gdONnxO8I6byZXDi5sXWiWvlW3D/sci7dTQimEJo=
|
||||
github.com/containerd/containerd v1.7.2/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
|
||||
github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU=
|
||||
github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k=
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
|
@ -220,6 +233,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
|
|||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
|
||||
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
||||
github.com/crossplane/crossplane-runtime v0.19.2 h1:9qBnhpqKN4x6apF2siaQ6PvgxqBXbGcKmgeD8mSIDO8=
|
||||
github.com/crossplane/crossplane-runtime v0.19.2/go.mod h1:OJQ1NxtQK2ZTRmvtnQPoy8LsXsARTnVydRVDQEgIuz4=
|
||||
github.com/cue-exp/kubevelafix v0.0.0-20220922150317-aead819d979d h1:VNJA1nSKA8Xna5wjUIMItHlWmEej8Bb9fZ3vCNtIAX0=
|
||||
|
@ -233,6 +247,7 @@ github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27N
|
|||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aBfCb7iqHmDEIp6fBvC/hQUddQfg+3qdYjwzaiP9Hnc=
|
||||
github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI=
|
||||
github.com/docker/cli v20.10.9+incompatible h1:OJ7YkwQA+k2Oi51lmCojpjiygKpi76P7bg91b2eJxYU=
|
||||
github.com/docker/cli v20.10.9+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
||||
|
@ -242,16 +257,19 @@ github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNk
|
|||
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-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
|
||||
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
|
||||
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
|
||||
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/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4=
|
||||
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
|
||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
|
||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
|
||||
github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 h1:RIB4cRk+lBqKK3Oy0r2gRX4ui7tuhiZq2SuTtTCi0/0=
|
||||
github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
|
||||
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||
github.com/emicklei/go-restful-openapi/v2 v2.9.1 h1:Of8B1rXdG81il5TTiSY+9Qrh7pYOr8aLdynHIpvo7fM=
|
||||
|
@ -259,6 +277,7 @@ github.com/emicklei/go-restful-openapi/v2 v2.9.1/go.mod h1:VKNgZyYviM1hnyrjD9RDz
|
|||
github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw=
|
||||
github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
|
||||
github.com/emicklei/proto v1.10.0 h1:pDGyFRVV5RvV+nkBK9iy3q67FBy9Xa7vwrOTE+g5aGw=
|
||||
github.com/emicklei/proto v1.10.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
|
@ -280,10 +299,13 @@ github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2Vvl
|
|||
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM=
|
||||
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
|
||||
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0=
|
||||
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64=
|
||||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
|
||||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg=
|
||||
github.com/facebookgo/structtag v0.0.0-20150214074306-217e25fb9691 h1:KnnwHN59Jxec0htA2pe/i0/WI9vxXLQifdhBrP3lqcQ=
|
||||
github.com/facebookgo/structtag v0.0.0-20150214074306-217e25fb9691/go.mod h1:sKLL1iua/0etWfo/nPCmyz+v2XDMXy+Ho53W7RAuZNY=
|
||||
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk=
|
||||
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0=
|
||||
github.com/fatih/color v0.0.0-20180516100307-2d684516a886/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||
|
@ -315,7 +337,9 @@ github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5
|
|||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
|
||||
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
|
||||
github.com/gdamore/tcell/v2 v2.6.0 h1:OKbluoP9VYmJwZwq/iLb4BxwKcwGthaa1YNBJIyCySg=
|
||||
github.com/gdamore/tcell/v2 v2.6.0/go.mod h1:be9omFATkdr0D9qewWW3d+MEvl5dha+Etb5y65J2H8Y=
|
||||
github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
|
||||
github.com/getkin/kin-openapi v0.118.0 h1:z43njxPmJ7TaPpMSCQb7PN0dEYno4tyBPQcrFdHoLuM=
|
||||
github.com/getkin/kin-openapi v0.118.0/go.mod h1:l5e9PaFUo9fyLJCPGQeXI2ML8c3P8BHOEV2VaAVf/pc=
|
||||
|
@ -324,6 +348,7 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME
|
|||
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew=
|
||||
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I=
|
||||
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
|
||||
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
|
||||
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
|
||||
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
|
||||
|
@ -331,6 +356,7 @@ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmS
|
|||
github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4=
|
||||
github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f h1:Pz0DHeFij3XFhoBRGUDPzSJ+w2UcK5/0JvF8DRI58r8=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo=
|
||||
github.com/go-git/go-git/v5 v5.7.0 h1:t9AudWVLmqzlo+4bqdf7GY+46SUuRsx59SboFxkq2aE=
|
||||
github.com/go-git/go-git/v5 v5.7.0/go.mod h1:coJHKEOk5kUClpsNlXrUvPrDxY3w3gjHvhcZd8Fodw8=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
|
@ -450,6 +476,7 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW
|
|||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
|
||||
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
|
||||
|
@ -507,6 +534,7 @@ github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97Dwqy
|
|||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
|
||||
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
|
||||
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
|
||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
|
@ -542,6 +570,7 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n
|
|||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=
|
||||
github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
|
@ -560,6 +589,7 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA
|
|||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
|
||||
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
|
@ -617,6 +647,7 @@ github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Cc
|
|||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||
github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg=
|
||||
github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
||||
|
@ -661,6 +692,7 @@ github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3x
|
|||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI=
|
||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
|
@ -685,6 +717,7 @@ github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
|||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||
|
@ -703,6 +736,7 @@ github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI=
|
|||
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
|
||||
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
||||
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
|
||||
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
|
@ -725,6 +759,7 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh
|
|||
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
||||
|
@ -764,6 +799,7 @@ github.com/moby/moby v20.10.20+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBm
|
|||
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
|
||||
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
|
||||
github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78=
|
||||
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
|
||||
github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A=
|
||||
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw=
|
||||
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw=
|
||||
|
@ -869,6 +905,7 @@ github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0V
|
|||
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 h1:Ii+DKncOVM8Cu1Hc+ETb5K+23HdAMvESYE3ZJ5b5cMI=
|
||||
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
|
||||
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
|
||||
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
|
@ -933,7 +970,9 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi
|
|||
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/protocolbuffers/txtpbfmt v0.0.0-20220428173112-74888fd59c2b h1:zd/2RNzIRkoGGMjE+YIsZ85CnDIz672JK2F3Zl4vux4=
|
||||
github.com/protocolbuffers/txtpbfmt v0.0.0-20220428173112-74888fd59c2b/go.mod h1:KjY0wibdYKc4DYkerHSbguaf3JeIPGhNJBp2BNiFH78=
|
||||
github.com/rivo/tview v0.0.0-20221128165837-db36428c92d9 h1:ccTgRxA37ypj3q8zB8G4k3xGPfBbIaMwrf3Yw6k50NY=
|
||||
github.com/rivo/tview v0.0.0-20221128165837-db36428c92d9/go.mod h1:YX2wUZOcJGOIycErz2s9KvDaP0jnWwRCirQMPLPpQ+Y=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
|
||||
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
|
@ -945,6 +984,7 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
|
|||
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/rubenv/sql-migrate v1.3.1 h1:Vx+n4Du8X8VTYuXbhNxdEUoh6wiJERA0GlWocR5FrbA=
|
||||
github.com/rubenv/sql-migrate v1.3.1/go.mod h1:YzG/Vh82CwyhTFXy+Mf5ahAiiEOpAlHurg+23VEzcsk=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
|
@ -1076,14 +1116,18 @@ github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
|
|||
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43 h1:+lm10QQTNSBd8DVTNGHx7o/IKu9HYDvLMffDhbyLccI=
|
||||
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
|
||||
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50 h1:hlE8//ciYMztlGpl/VA+Zm1AcTPHYkHJPbHqE6WJUXE=
|
||||
github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
|
||||
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1:ERexzlUfuTvpE74urLSbIQW0Z/6hF9t8U4NsJLaioAY=
|
||||
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
|
||||
github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
|
||||
github.com/zclconf/go-cty v1.13.0 h1:It5dfKTTZHe9aeppbNOda3mN7Ag7sg6QkBNm6TkyFa0=
|
||||
github.com/zclconf/go-cty v1.13.0/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
|
||||
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
|
||||
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
|
||||
go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c h1:/RwRVN9EdXAVtdHxP7Ndn/tfmM9/goiwU0QTnLBgS4w=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||
go.etcd.io/etcd/api/v3 v3.5.5 h1:BX4JIbQ7hl7+jL+g+2j5UAr0o1bctCm6/Ct+ArBGkf0=
|
||||
|
@ -1111,6 +1155,7 @@ go.mongodb.org/mongo-driver v1.11.2/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sf
|
|||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
||||
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
||||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||
go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0/go.mod h1:E5NNboN0UqSAki0Atn9kVwaN7I+l25gGxDqBueo/74E=
|
||||
|
@ -1171,6 +1216,7 @@ go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ
|
|||
go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
|
||||
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
|
||||
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
|
||||
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
SHELL := /bin/bash
|
||||
|
||||
GOLANGCILINT_VERSION ?= 1.53.3
|
||||
GOLANGCILINT_VERSION ?= 1.59.1
|
||||
|
||||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
|
||||
ifeq (,$(shell go env GOBIN))
|
||||
|
|
|
@ -14,6 +14,8 @@ const HelmValueShow: React.FC<Props> = (props: Props) => {
|
|||
const [valueFile, setValueFile] = React.useState<string>('values.yaml');
|
||||
return (
|
||||
<Dialog
|
||||
style={{ width: '60vw' }}
|
||||
closeMode={["close", "mask"]}
|
||||
className={'helmValueDialog'}
|
||||
overflowScroll={true}
|
||||
visible={true}
|
||||
|
|
|
@ -109,7 +109,7 @@ class EditPlatFormUserDialog extends Component<Props, State> {
|
|||
{
|
||||
required: true,
|
||||
pattern: checkName,
|
||||
message: <Translation>You must input a valid name</Translation>,
|
||||
message: <Translation>You must input a valid name with alphanumeric character only</Translation>,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -139,7 +139,7 @@ class EditPlatFormUserDialog extends Component<Props, State> {
|
|||
pattern: checkUserPassword,
|
||||
message: (
|
||||
<Translation>
|
||||
Password should be 8-16 bits and contain at least one number and one letter
|
||||
Password must be alphanumeric, contain at least one letter and one number, and be 8-16 characters long
|
||||
</Translation>
|
||||
),
|
||||
},
|
||||
|
|
|
@ -329,6 +329,7 @@
|
|||
"Only support github repo url(master branch)": "仅支持 GitHub repo(主分支) 链接",
|
||||
"Are you sure to delete?": "确认要删除吗?",
|
||||
"Please enter a valid name": "请输入一个有效的名称",
|
||||
"Please enter a valid name having alphanumeric characters only": "请输入仅包含字母数字字符的有效名称",
|
||||
"This addon is experimental, please don't use it in production": "本插件是试用性,请不要在生产环境中使用",
|
||||
"Dependencies": "依赖",
|
||||
"Enable the addon to obtain the following extension capabilities": "启用插件以使用如下扩展能力",
|
||||
|
@ -534,6 +535,7 @@
|
|||
"Environment binding deleted successfully": "成功移除环境绑定",
|
||||
"Retry": "重试",
|
||||
"Password should be 8-16 bits and contain at least one number and one letter": "密码应为8-16位, 并至少包含一个数字和一个字母",
|
||||
"Password must be alphanumeric, contain at least one letter and one number, and be 8-16 characters long": "密码必须是字母数字,至少包含一个字母和一个数字,长度为 8-16 个字符",
|
||||
"Please input a valid email": "请输入有效的电子邮件地址",
|
||||
"Please input a email": "请输入电子邮箱地址",
|
||||
"User updated successfully": "用户更新成功",
|
||||
|
@ -652,4 +654,4 @@
|
|||
"Click me to open the dex login page": "点击我打开 Dex 登录页面",
|
||||
"Setting the default projects for the dex login user": "设置 Dex 登录用户的默认项目",
|
||||
"Join Time": "加入时间"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -517,7 +517,7 @@ class AddonDetailDialog extends React.Component<Props, State> {
|
|||
schema
|
||||
? [
|
||||
<Button
|
||||
style={{ marginTop: '-12px', alignItems: 'center', display: 'flex' }}
|
||||
style={{ alignItems: 'center', display: 'flex' }}
|
||||
onClick={() => {
|
||||
if (propertiesMode === 'native') {
|
||||
this.setState({ propertiesMode: 'code' });
|
||||
|
|
|
@ -195,14 +195,28 @@ class TraitDialog extends React.Component<Props, State> {
|
|||
.then((re) => {
|
||||
if (re) {
|
||||
this.setState({ definitionDetail: re, definitionLoading: false });
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
this.setDefaultProperties(re)
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(() => this.setState({ definitionLoading: false }));
|
||||
};
|
||||
|
||||
setDefaultProperties = (definitionDetail: any) => {
|
||||
const properties = definitionDetail.schema?.properties;
|
||||
if (properties) {
|
||||
const defaultValues: Record<string, any> = {};
|
||||
for (const key in properties) {
|
||||
if (properties[key].default !== undefined) {
|
||||
defaultValues[key] = properties[key].default;
|
||||
}
|
||||
}
|
||||
this.field.setValues({ properties: defaultValues });
|
||||
}
|
||||
};
|
||||
|
||||
handleTypeChange = (value: string) => {
|
||||
this.removeProperties();
|
||||
this.field.setValues({ type: value });
|
||||
|
|
|
@ -55,7 +55,7 @@ class AddClusterDialog extends React.Component<Props, State> {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onClose = () => {
|
||||
this.props.onClose();
|
||||
this.resetField();
|
||||
|
@ -69,13 +69,13 @@ class AddClusterDialog extends React.Component<Props, State> {
|
|||
}
|
||||
if (editMode) {
|
||||
updateCluster({
|
||||
name: cluster.name,
|
||||
name: cluster?.name,
|
||||
alias: values.alias,
|
||||
icon: cluster.icon,
|
||||
icon: cluster?.icon,
|
||||
description: values.description,
|
||||
dashboardURL: values.dashboardURL,
|
||||
kubeConfig: values.kubeConfig,
|
||||
labels: cluster.labels,
|
||||
labels: cluster?.labels,
|
||||
}).then((re: any) => {
|
||||
if (re) {
|
||||
Message.success(<Translation>cluster update success</Translation>);
|
||||
|
@ -140,7 +140,7 @@ class AddClusterDialog extends React.Component<Props, State> {
|
|||
};
|
||||
const init = this.field.init;
|
||||
const values: { kubeConfig: string } = this.field.getValues();
|
||||
const valueInfo = cluster.kubeConfig || values.kubeConfig || '';
|
||||
const valueInfo = cluster?.kubeConfig || values.kubeConfig || '';
|
||||
return (
|
||||
<Dialog
|
||||
locale={locale().Dialog}
|
||||
|
@ -170,7 +170,7 @@ class AddClusterDialog extends React.Component<Props, State> {
|
|||
name="name"
|
||||
disabled={editMode}
|
||||
{...init('name', {
|
||||
initValue: cluster.name,
|
||||
initValue: cluster?.name || editClusterName,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
|
@ -187,7 +187,7 @@ class AddClusterDialog extends React.Component<Props, State> {
|
|||
<Input
|
||||
name="alias"
|
||||
{...init('alias', {
|
||||
initValue: cluster.alias,
|
||||
initValue: cluster?.alias,
|
||||
rules: [
|
||||
{
|
||||
minLength: 2,
|
||||
|
@ -204,10 +204,10 @@ class AddClusterDialog extends React.Component<Props, State> {
|
|||
<Col span={12} style={{ padding: '0 8px' }}>
|
||||
<FormItem label={<Translation>Description</Translation>}>
|
||||
<Input
|
||||
defaultValue={cluster.description}
|
||||
defaultValue={cluster?.description}
|
||||
name="description"
|
||||
{...init('description', {
|
||||
initValue: cluster.description,
|
||||
initValue: cluster?.description,
|
||||
rules: [
|
||||
{
|
||||
maxLength: 256,
|
||||
|
@ -223,7 +223,7 @@ class AddClusterDialog extends React.Component<Props, State> {
|
|||
<Input
|
||||
name="dashboardURL"
|
||||
{...init('dashboardURL', {
|
||||
initValue: cluster.dashboardURL,
|
||||
initValue: cluster?.dashboardURL,
|
||||
rules: [
|
||||
{
|
||||
required: false,
|
||||
|
@ -252,7 +252,7 @@ class AddClusterDialog extends React.Component<Props, State> {
|
|||
language={'yaml'}
|
||||
readOnly={false}
|
||||
{...init('kubeConfig', {
|
||||
initValue: cluster.kubeConfig,
|
||||
initValue: cluster?.kubeConfig,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
|
|
|
@ -101,7 +101,7 @@ class Cluster extends React.Component<Props, State> {
|
|||
(enableAddon || []).forEach((ele: { name: string; phase: boolean }) => {
|
||||
addonList.forEach((item: Addon) => {
|
||||
const isMatchName = ele.name === item.name;
|
||||
const deploy = item.deployTo || { runtimeCluster: false, runtime_cluster: false };
|
||||
const deploy = item.deployTo || { runtimeCluster: false };
|
||||
if (isMatchName && deploy.runtimeCluster) {
|
||||
addonMessage.push({ name: item.name, path: item.url || '' });
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ class CreateUser extends React.Component<Props, State> {
|
|||
{
|
||||
required: true,
|
||||
pattern: checkName,
|
||||
message: <Translation>Please enter a valid name</Translation>,
|
||||
message: <Translation>Please enter a valid name having alphanumeric characters only</Translation>,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -209,7 +209,7 @@ class CreateUser extends React.Component<Props, State> {
|
|||
pattern: checkUserPassword,
|
||||
message: (
|
||||
<Translation>
|
||||
Password should be 8-16 bits and contain at least one number and one letter
|
||||
Password must be alphanumeric, contain at least one letter and one number, and be 8-16 characters long
|
||||
</Translation>
|
||||
),
|
||||
},
|
||||
|
|
|
@ -117,7 +117,7 @@ class ResetPassword extends React.Component<Props, State> {
|
|||
pattern: checkUserPassword,
|
||||
message: (
|
||||
<Translation>
|
||||
Password should be 8-16 bits and contain at least one number and one letter
|
||||
Password must be alphanumeric, contain at least one letter and one number, and be 8-16 characters long
|
||||
</Translation>
|
||||
),
|
||||
},
|
||||
|
|
|
@ -1669,12 +1669,13 @@ func (c *applicationServiceImpl) DryRunAppOrRevision(ctx context.Context, appMod
|
|||
}
|
||||
|
||||
func genWebhookToken() string {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
source := rand.NewSource(time.Now().UnixNano()) //nolint:gosec
|
||||
rng := rand.New(source) //nolint:gosec
|
||||
runes := []rune("abcdefghijklmnopqrstuvwxyz0123456789")
|
||||
|
||||
b := make([]rune, defaultTokenLen)
|
||||
for i := range b {
|
||||
b[i] = runes[rand.Intn(len(runes))] // #nosec
|
||||
b[i] = runes[rng.Intn(len(runes))] //nolint:gosec
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ func (a *authenticationServiceImpl) RefreshToken(_ context.Context, refreshToken
|
|||
|
||||
// ParseToken parses and verifies a token
|
||||
func ParseToken(tokenString string) (*model.CustomClaims, error) {
|
||||
token, err := jwt.ParseWithClaims(tokenString, &model.CustomClaims{}, func(token *jwt.Token) (interface{}, error) {
|
||||
token, err := jwt.ParseWithClaims(tokenString, &model.CustomClaims{}, func(token *jwt.Token) (interface{}, error) { //nolint:revive,unused
|
||||
return []byte(signedKey), nil
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -449,6 +449,14 @@ func (a *authenticationServiceImpl) GetLoginType(ctx context.Context) (*apisv1.G
|
|||
}, nil
|
||||
}
|
||||
|
||||
func getUserName(sub string) string {
|
||||
username := strings.ToLower(sub)
|
||||
if len(sub) > datastore.PrimaryKeyMaxLength {
|
||||
return sub[:datastore.PrimaryKeyMaxLength]
|
||||
}
|
||||
return username
|
||||
}
|
||||
|
||||
func (d *dexHandlerImpl) login(ctx context.Context) (*apisv1.UserBase, error) {
|
||||
var claims struct {
|
||||
Email string `json:"email"`
|
||||
|
@ -492,14 +500,8 @@ func (d *dexHandlerImpl) login(ctx context.Context) (*apisv1.UserBase, error) {
|
|||
klog.Errorf("failed to get the system info %s", err.Error())
|
||||
}
|
||||
user := &model.User{
|
||||
Email: claims.Email,
|
||||
Name: func() string {
|
||||
sub := strings.ToLower(claims.Sub)
|
||||
if len(sub) > datastore.PrimaryKeyMaxLength {
|
||||
return sub[:datastore.PrimaryKeyMaxLength]
|
||||
}
|
||||
return sub
|
||||
}(),
|
||||
Email: claims.Email,
|
||||
Name: getUserName(claims.Sub),
|
||||
DexSub: claims.Sub,
|
||||
Alias: claims.Name,
|
||||
LastLoginTime: time.Now(),
|
||||
|
@ -514,7 +516,7 @@ func (d *dexHandlerImpl) login(ctx context.Context) (*apisv1.UserBase, error) {
|
|||
if systemInfo != nil {
|
||||
for _, project := range systemInfo.DexUserDefaultProjects {
|
||||
_, err := d.projectService.AddProjectUser(ctx, project.Name, apisv1.AddProjectUserRequest{
|
||||
UserName: strings.ToLower(claims.Sub),
|
||||
UserName: getUserName(claims.Sub),
|
||||
UserRoles: project.Roles,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -381,7 +381,7 @@ func (c *cloudShellServiceImpl) newCloudShell(ctx context.Context) (*v1alpha1.Cl
|
|||
|
||||
func checkReadOnly(projectName string, permissions []*model.Permission) bool {
|
||||
ra := &RequestResourceAction{}
|
||||
ra.SetResourceWithName("project:{projectName}/application:*", func(name string) string {
|
||||
ra.SetResourceWithName("project:{projectName}/application:*", func(name string) string { //nolint:revive,unused
|
||||
return projectName
|
||||
})
|
||||
ra.SetActions([]string{"deploy"})
|
||||
|
|
|
@ -696,7 +696,7 @@ func getResourceLogs(ctx context.Context, config *rest.Config, cli client.Client
|
|||
|
||||
order := make([]string, 0)
|
||||
sort.Strings(order)
|
||||
logMap.Range(func(key, value any) bool {
|
||||
logMap.Range(func(key, value any) bool { //nolint:revive,unused
|
||||
order = append(order, key.(string))
|
||||
return true
|
||||
})
|
||||
|
|
|
@ -32,7 +32,7 @@ func guaranteePolicyExist(c []string, policy string) ([]string, bool) {
|
|||
return append(c, policy), true
|
||||
}
|
||||
|
||||
// guaranteePolicyNotExist check the slice whether caontain the target policy, if yes delete
|
||||
// guaranteePolicyNotExist check the slice whether contain the target policy, if yes delete
|
||||
// and tell invoker whether should update the policy
|
||||
func guaranteePolicyNotExist(c []string, policy string) ([]string, bool) {
|
||||
res := make([]string, len(c))
|
||||
|
|
|
@ -76,7 +76,7 @@ func (i *InfoCalculateCronJob) start(cronSpec string) {
|
|||
_, _ = c.AddFunc(cronSpec, func() {
|
||||
|
||||
// ExponentialBackoff retry this job
|
||||
err := retry.OnError(waitBackOff, func(err error) bool {
|
||||
err := retry.OnError(waitBackOff, func(err error) bool { //nolint:revive,unused
|
||||
// always retry
|
||||
return true
|
||||
}, func() error {
|
||||
|
|
|
@ -122,7 +122,7 @@ func (a *ApplicationSync) Start(ctx context.Context, errorChan chan error) {
|
|||
AddFunc: func(obj interface{}) {
|
||||
addOrUpdateHandler(obj)
|
||||
},
|
||||
UpdateFunc: func(oldObj, obj interface{}) {
|
||||
UpdateFunc: func(oldObj, obj interface{}) { //nolint:revive,unused
|
||||
addOrUpdateHandler(obj)
|
||||
},
|
||||
DeleteFunc: func(obj interface{}) {
|
||||
|
|
|
@ -90,28 +90,6 @@ func initPostgresTestDs() (datastore.DataStore, error) {
|
|||
return postgresDriver, nil
|
||||
}
|
||||
|
||||
// initOpenGaussTestDs Postgres Driver is also compatible with OpenGaussian databases
|
||||
func initOpenGaussTestDs() (datastore.DataStore, error) {
|
||||
db, err := gorm.Open(postgresorm.Open("postgres://gaussdb:Kubevela-123@127.0.0.1:15432/kubevela?sslmode=disable&client_encoding=UTF-8&connect_timeout=1"), &gorm.Config{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, v := range model.GetRegisterModels() {
|
||||
err := db.Migrator().DropTable(&v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
openGaussDriver, err := postgres.New(context.TODO(), datastore.Config{
|
||||
URL: "postgres://gaussdb:Kubevela-123@127.0.0.1:15432/kubevela?sslmode=disable&client_encoding=UTF-8&connect_timeout=1",
|
||||
Database: "kubevela",
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return openGaussDriver, nil
|
||||
}
|
||||
|
||||
func initKubeapiTestDs() (datastore.DataStore, error) {
|
||||
var testScheme = runtime.NewScheme()
|
||||
testEnv := &envtest.Environment{
|
||||
|
@ -196,7 +174,6 @@ var _ = Describe("Test datastore methods", func() {
|
|||
DriverTest(initMysqlTestDs)
|
||||
DriverTest(initMongodbTestDs)
|
||||
DriverTest(initKubeapiTestDs)
|
||||
DriverTest(initOpenGaussTestDs)
|
||||
DriverTest(initPostgresTestDs)
|
||||
})
|
||||
|
||||
|
|
|
@ -18,25 +18,19 @@ package mysql
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
mysqlgorm "gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/kubevela/velaux/pkg/server/domain/model"
|
||||
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
|
||||
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/sql"
|
||||
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/sqlnamer"
|
||||
)
|
||||
|
||||
type mysql struct {
|
||||
client gorm.DB
|
||||
database string
|
||||
sql.Driver
|
||||
}
|
||||
|
||||
// New new mysql datastore instance
|
||||
|
@ -44,6 +38,7 @@ func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error)
|
|||
db, err := gorm.Open(mysqlgorm.Open(cfg.URL), &gorm.Config{
|
||||
NamingStrategy: sqlnamer.SQLNamer{},
|
||||
Logger: logger.Default.LogMode(logger.Silent),
|
||||
TranslateError: true,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -56,262 +51,9 @@ func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error)
|
|||
}
|
||||
|
||||
m := &mysql{
|
||||
client: *db.WithContext(ctx),
|
||||
database: cfg.Database,
|
||||
Driver: sql.Driver{
|
||||
Client: *db.WithContext(ctx),
|
||||
},
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// Add add data model
|
||||
func (m *mysql) Add(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
entity.SetCreateTime(time.Now())
|
||||
entity.SetUpdateTime(time.Now())
|
||||
|
||||
if dbAdd := m.client.WithContext(ctx).Create(entity); dbAdd.Error != nil {
|
||||
if match := errors.Is(dbAdd.Error, gorm.ErrDuplicatedKey); match {
|
||||
return datastore.ErrRecordExist
|
||||
}
|
||||
return datastore.NewDBError(dbAdd.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// BatchAdd batch add entity, this operation has some atomicity.
|
||||
func (m *mysql) BatchAdd(ctx context.Context, entities []datastore.Entity) error {
|
||||
notRollback := make(map[string]bool)
|
||||
for i, saveEntity := range entities {
|
||||
if err := m.Add(ctx, saveEntity); err != nil {
|
||||
if errors.Is(err, datastore.ErrRecordExist) {
|
||||
notRollback[saveEntity.PrimaryKey()] = true
|
||||
}
|
||||
for _, deleteEntity := range entities[:i] {
|
||||
if _, exit := notRollback[deleteEntity.PrimaryKey()]; !exit {
|
||||
if err := m.Delete(ctx, deleteEntity); err != nil {
|
||||
if !errors.Is(err, datastore.ErrRecordNotExist) {
|
||||
klog.Errorf("rollback delete entity failure %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return datastore.NewDBError(fmt.Errorf("save entities occur error, %w", err))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get get data model
|
||||
func (m *mysql) Get(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
|
||||
if dbGet := m.client.WithContext(ctx).First(entity); dbGet.Error != nil {
|
||||
if errors.Is(dbGet.Error, gorm.ErrRecordNotFound) {
|
||||
return datastore.ErrRecordNotExist
|
||||
}
|
||||
return datastore.NewDBError(dbGet.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Put update data model
|
||||
func (m *mysql) Put(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
entity.SetUpdateTime(time.Now())
|
||||
if dbPut := m.client.WithContext(ctx).Model(entity).Updates(entity); dbPut.Error != nil {
|
||||
if errors.Is(dbPut.Error, gorm.ErrRecordNotFound) {
|
||||
return datastore.ErrRecordNotExist
|
||||
}
|
||||
return datastore.NewDBError(dbPut.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsExist determine whether data exists.
|
||||
func (m *mysql) IsExist(ctx context.Context, entity datastore.Entity) (bool, error) {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return false, datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return false, datastore.ErrTableNameEmpty
|
||||
}
|
||||
|
||||
if dbExist := m.client.WithContext(ctx).First(entity); dbExist.Error != nil {
|
||||
if errors.Is(dbExist.Error, gorm.ErrRecordNotFound) {
|
||||
return false, nil
|
||||
}
|
||||
return false, datastore.NewDBError(dbExist.Error)
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// Delete delete data
|
||||
func (m *mysql) Delete(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
// check entity is exist
|
||||
if err := m.Get(ctx, entity); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if dbDelete := m.client.WithContext(ctx).Model(entity).Delete(entity); dbDelete.Error != nil {
|
||||
klog.Errorf("delete document failure %w", dbDelete.Error)
|
||||
return datastore.NewDBError(dbDelete.Error)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// _toColumnName converts keys of the models to lowercase as the column name are in lowercase in the database
|
||||
func _toColumnName(columnName string) string {
|
||||
return strings.ToLower(columnName)
|
||||
}
|
||||
|
||||
func _applyFilterOptions(clauses []clause.Expression, filterOptions datastore.FilterOptions) []clause.Expression {
|
||||
for _, queryOp := range filterOptions.Queries {
|
||||
clauses = append(clauses, clause.Like{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Value: fmt.Sprintf("%%%s%%", queryOp.Query),
|
||||
})
|
||||
}
|
||||
for _, queryOp := range filterOptions.In {
|
||||
values := make([]interface{}, len(queryOp.Values))
|
||||
for i, v := range queryOp.Values {
|
||||
values[i] = v
|
||||
}
|
||||
clauses = append(clauses, clause.IN{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Values: values,
|
||||
})
|
||||
}
|
||||
for _, queryOp := range filterOptions.IsNotExist {
|
||||
clauses = append(clauses, clause.Eq{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Value: "",
|
||||
})
|
||||
}
|
||||
return clauses
|
||||
}
|
||||
|
||||
// List list entity function
|
||||
func (m *mysql) List(ctx context.Context, entity datastore.Entity, op *datastore.ListOptions) ([]datastore.Entity, error) {
|
||||
if entity.TableName() == "" {
|
||||
return nil, datastore.ErrTableNameEmpty
|
||||
}
|
||||
var (
|
||||
clauses []clause.Expression
|
||||
exprs []clause.Expression
|
||||
limit int
|
||||
offset int
|
||||
)
|
||||
if op != nil && op.PageSize > 0 && op.Page > 0 {
|
||||
limit = op.PageSize
|
||||
offset = op.PageSize * (op.Page - 1)
|
||||
clauses = append(clauses, clause.Limit{
|
||||
Limit: &limit,
|
||||
Offset: offset,
|
||||
})
|
||||
}
|
||||
for k, v := range entity.Index() {
|
||||
exprs = append(exprs, clause.Eq{
|
||||
Column: strings.ToLower(k),
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
if op != nil {
|
||||
exprs = _applyFilterOptions(exprs, op.FilterOptions)
|
||||
}
|
||||
if len(exprs) > 0 {
|
||||
clauses = append(clauses, clause.Where{
|
||||
Exprs: exprs,
|
||||
})
|
||||
}
|
||||
if op != nil && op.SortBy != nil {
|
||||
var sortOption []clause.OrderByColumn
|
||||
for _, v := range op.SortBy {
|
||||
sortOption = append(sortOption, clause.OrderByColumn{
|
||||
Column: clause.Column{
|
||||
Name: strings.ToLower(v.Key),
|
||||
},
|
||||
Desc: v.Order == datastore.SortOrderDescending,
|
||||
})
|
||||
}
|
||||
clauses = append(clauses, clause.OrderBy{
|
||||
Columns: sortOption,
|
||||
})
|
||||
}
|
||||
var list []datastore.Entity
|
||||
rows, err := m.client.WithContext(ctx).Model(entity).Clauses(clauses...).Rows()
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
defer func() {
|
||||
if err := rows.Close(); err != nil {
|
||||
klog.Warningf("close rows failure %s", err.Error())
|
||||
}
|
||||
}()
|
||||
for rows.Next() {
|
||||
item, err := datastore.NewEntity(entity)
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
err = m.client.WithContext(ctx).ScanRows(rows, &item)
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(fmt.Errorf("row scan failure %w", err))
|
||||
}
|
||||
list = append(list, item)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// Count counts entities
|
||||
func (m *mysql) Count(ctx context.Context, entity datastore.Entity, filterOptions *datastore.FilterOptions) (int64, error) {
|
||||
if entity.TableName() == "" {
|
||||
return 0, datastore.ErrTableNameEmpty
|
||||
}
|
||||
var (
|
||||
count int64
|
||||
exprs []clause.Expression
|
||||
clauses []clause.Expression
|
||||
)
|
||||
for k, v := range entity.Index() {
|
||||
exprs = append(exprs, clause.Eq{
|
||||
Column: strings.ToLower(k),
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
if filterOptions != nil {
|
||||
exprs = _applyFilterOptions(exprs, *filterOptions)
|
||||
}
|
||||
if len(exprs) > 0 {
|
||||
clauses = append(clauses, clause.Where{
|
||||
Exprs: exprs,
|
||||
})
|
||||
}
|
||||
if dbCount := m.client.WithContext(ctx).Model(entity).Clauses(clauses...).Count(&count); dbCount.Error != nil {
|
||||
return 0, datastore.NewDBError(dbCount.Error)
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
|
|
@ -18,25 +18,19 @@ package postgres
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
postgresorm "gorm.io/driver/postgres"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/kubevela/velaux/pkg/server/domain/model"
|
||||
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
|
||||
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/sql"
|
||||
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/sqlnamer"
|
||||
)
|
||||
|
||||
type postgres struct {
|
||||
client gorm.DB
|
||||
database string
|
||||
sql.Driver
|
||||
}
|
||||
|
||||
// New postgres datastore instance
|
||||
|
@ -46,6 +40,7 @@ func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error)
|
|||
NamingStrategy: sqlnamer.SQLNamer{},
|
||||
DisableForeignKeyConstraintWhenMigrating: true,
|
||||
Logger: logger.Default.LogMode(logger.Error),
|
||||
TranslateError: true,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
@ -58,263 +53,10 @@ func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error)
|
|||
}
|
||||
}
|
||||
|
||||
m := &postgres{
|
||||
client: *db.WithContext(ctx),
|
||||
database: cfg.Database,
|
||||
p := &postgres{
|
||||
Driver: sql.Driver{
|
||||
Client: *db.WithContext(ctx),
|
||||
},
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// Add add data model
|
||||
func (m *postgres) Add(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
entity.SetCreateTime(time.Now())
|
||||
entity.SetUpdateTime(time.Now())
|
||||
|
||||
if dbAdd := m.client.WithContext(ctx).Create(entity); dbAdd.Error != nil {
|
||||
if match := errors.Is(dbAdd.Error, gorm.ErrDuplicatedKey); match {
|
||||
return datastore.ErrRecordExist
|
||||
}
|
||||
return datastore.NewDBError(dbAdd.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// BatchAdd batch add entity, this operation has some atomicity.
|
||||
func (m *postgres) BatchAdd(ctx context.Context, entities []datastore.Entity) error {
|
||||
notRollback := make(map[string]bool)
|
||||
for i, saveEntity := range entities {
|
||||
if err := m.Add(ctx, saveEntity); err != nil {
|
||||
if errors.Is(err, datastore.ErrRecordExist) {
|
||||
notRollback[saveEntity.PrimaryKey()] = true
|
||||
}
|
||||
for _, deleteEntity := range entities[:i] {
|
||||
if _, exit := notRollback[deleteEntity.PrimaryKey()]; !exit {
|
||||
if err := m.Delete(ctx, deleteEntity); err != nil {
|
||||
if !errors.Is(err, datastore.ErrRecordNotExist) {
|
||||
klog.Errorf("rollback delete entity failure %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return datastore.NewDBError(fmt.Errorf("save entities occur error, %w", err))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get get data model
|
||||
func (m *postgres) Get(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
|
||||
if dbGet := m.client.WithContext(ctx).First(entity); dbGet.Error != nil {
|
||||
if errors.Is(dbGet.Error, gorm.ErrRecordNotFound) {
|
||||
return datastore.ErrRecordNotExist
|
||||
}
|
||||
return datastore.NewDBError(dbGet.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Put update data model
|
||||
func (m *postgres) Put(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
entity.SetUpdateTime(time.Now())
|
||||
if dbPut := m.client.WithContext(ctx).Model(entity).Updates(entity); dbPut.Error != nil {
|
||||
if errors.Is(dbPut.Error, gorm.ErrRecordNotFound) {
|
||||
return datastore.ErrRecordNotExist
|
||||
}
|
||||
return datastore.NewDBError(dbPut.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsExist determine whether data exists.
|
||||
func (m *postgres) IsExist(ctx context.Context, entity datastore.Entity) (bool, error) {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return false, datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return false, datastore.ErrTableNameEmpty
|
||||
}
|
||||
|
||||
if dbExist := m.client.WithContext(ctx).First(entity); dbExist.Error != nil {
|
||||
if errors.Is(dbExist.Error, gorm.ErrRecordNotFound) {
|
||||
return false, nil
|
||||
}
|
||||
return false, datastore.NewDBError(dbExist.Error)
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// Delete delete data
|
||||
func (m *postgres) Delete(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
// check entity is existed
|
||||
if err := m.Get(ctx, entity); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if dbDelete := m.client.WithContext(ctx).Model(entity).Delete(entity); dbDelete.Error != nil {
|
||||
klog.Errorf("delete document failure %w", dbDelete.Error)
|
||||
return datastore.NewDBError(dbDelete.Error)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// _toColumnName converts keys of the models to lowercase as the column name are in lowercase in the database
|
||||
func _toColumnName(columnName string) string {
|
||||
return strings.ToLower(columnName)
|
||||
}
|
||||
|
||||
func _applyFilterOptions(clauses []clause.Expression, filterOptions datastore.FilterOptions) []clause.Expression {
|
||||
for _, queryOp := range filterOptions.Queries {
|
||||
clauses = append(clauses, clause.Like{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Value: fmt.Sprintf("%%%s%%", queryOp.Query),
|
||||
})
|
||||
}
|
||||
for _, queryOp := range filterOptions.In {
|
||||
values := make([]interface{}, len(queryOp.Values))
|
||||
for i, v := range queryOp.Values {
|
||||
values[i] = v
|
||||
}
|
||||
clauses = append(clauses, clause.IN{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Values: values,
|
||||
})
|
||||
}
|
||||
for _, queryOp := range filterOptions.IsNotExist {
|
||||
clauses = append(clauses, clause.Eq{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Value: "",
|
||||
})
|
||||
}
|
||||
return clauses
|
||||
}
|
||||
|
||||
// List list entity function
|
||||
func (m *postgres) List(ctx context.Context, entity datastore.Entity, op *datastore.ListOptions) ([]datastore.Entity, error) {
|
||||
if entity.TableName() == "" {
|
||||
return nil, datastore.ErrTableNameEmpty
|
||||
}
|
||||
var (
|
||||
clauses []clause.Expression
|
||||
exprs []clause.Expression
|
||||
limit int
|
||||
offset int
|
||||
)
|
||||
if op != nil && op.PageSize > 0 && op.Page > 0 {
|
||||
limit = op.PageSize
|
||||
offset = op.PageSize * (op.Page - 1)
|
||||
clauses = append(clauses, clause.Limit{
|
||||
Limit: &limit,
|
||||
Offset: offset,
|
||||
})
|
||||
}
|
||||
for k, v := range entity.Index() {
|
||||
exprs = append(exprs, clause.Eq{
|
||||
Column: strings.ToLower(k),
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
if op != nil {
|
||||
exprs = _applyFilterOptions(exprs, op.FilterOptions)
|
||||
}
|
||||
if len(exprs) > 0 {
|
||||
clauses = append(clauses, clause.Where{
|
||||
Exprs: exprs,
|
||||
})
|
||||
}
|
||||
if op != nil && op.SortBy != nil {
|
||||
var sortOption []clause.OrderByColumn
|
||||
for _, v := range op.SortBy {
|
||||
sortOption = append(sortOption, clause.OrderByColumn{
|
||||
Column: clause.Column{
|
||||
Name: strings.ToLower(v.Key),
|
||||
},
|
||||
Desc: v.Order == datastore.SortOrderDescending,
|
||||
})
|
||||
}
|
||||
clauses = append(clauses, clause.OrderBy{
|
||||
Columns: sortOption,
|
||||
})
|
||||
}
|
||||
var list []datastore.Entity
|
||||
rows, err := m.client.WithContext(ctx).Model(entity).Clauses(clauses...).Rows()
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
defer func() {
|
||||
if err := rows.Close(); err != nil {
|
||||
klog.Warningf("close rows failure %s", err.Error())
|
||||
}
|
||||
}()
|
||||
for rows.Next() {
|
||||
item, err := datastore.NewEntity(entity)
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
err = m.client.WithContext(ctx).ScanRows(rows, &item)
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(fmt.Errorf("row scan failure %w", err))
|
||||
}
|
||||
list = append(list, item)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// Count counts entities
|
||||
func (m *postgres) Count(ctx context.Context, entity datastore.Entity, filterOptions *datastore.FilterOptions) (int64, error) {
|
||||
if entity.TableName() == "" {
|
||||
return 0, datastore.ErrTableNameEmpty
|
||||
}
|
||||
var (
|
||||
count int64
|
||||
exprs []clause.Expression
|
||||
clauses []clause.Expression
|
||||
)
|
||||
for k, v := range entity.Index() {
|
||||
exprs = append(exprs, clause.Eq{
|
||||
Column: strings.ToLower(k),
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
if filterOptions != nil {
|
||||
exprs = _applyFilterOptions(exprs, *filterOptions)
|
||||
}
|
||||
if len(exprs) > 0 {
|
||||
clauses = append(clauses, clause.Where{
|
||||
Exprs: exprs,
|
||||
})
|
||||
}
|
||||
if dbCount := m.client.WithContext(ctx).Model(entity).Clauses(clauses...).Count(&count); dbCount.Error != nil {
|
||||
return 0, datastore.NewDBError(dbCount.Error)
|
||||
}
|
||||
return count, nil
|
||||
return p, nil
|
||||
}
|
||||
|
|
|
@ -0,0 +1,290 @@
|
|||
/*
|
||||
Copyright 2021 The KubeVela Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package sql
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
|
||||
)
|
||||
|
||||
// Driver is a unified implementation of SQL driver of datastore
|
||||
type Driver struct {
|
||||
Client gorm.DB
|
||||
}
|
||||
|
||||
// Add data model
|
||||
func (m *Driver) Add(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
entity.SetCreateTime(time.Now())
|
||||
entity.SetUpdateTime(time.Now())
|
||||
|
||||
if dbAdd := m.Client.WithContext(ctx).Create(entity); dbAdd.Error != nil {
|
||||
if match := errors.Is(dbAdd.Error, gorm.ErrDuplicatedKey); match {
|
||||
return datastore.ErrRecordExist
|
||||
}
|
||||
return datastore.NewDBError(dbAdd.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// BatchAdd batch add entity, this operation has some atomicity.
|
||||
func (m *Driver) BatchAdd(ctx context.Context, entities []datastore.Entity) error {
|
||||
notRollback := make(map[string]bool)
|
||||
for i, saveEntity := range entities {
|
||||
if err := m.Add(ctx, saveEntity); err != nil {
|
||||
if errors.Is(err, datastore.ErrRecordExist) {
|
||||
notRollback[saveEntity.PrimaryKey()] = true
|
||||
}
|
||||
for _, deleteEntity := range entities[:i] {
|
||||
if _, exit := notRollback[deleteEntity.PrimaryKey()]; !exit {
|
||||
if err := m.Delete(ctx, deleteEntity); err != nil {
|
||||
if !errors.Is(err, datastore.ErrRecordNotExist) {
|
||||
klog.Errorf("rollback delete entity failure %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return datastore.NewDBError(fmt.Errorf("save entities occur error, %w", err))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get get data model
|
||||
func (m *Driver) Get(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
|
||||
if dbGet := m.Client.WithContext(ctx).First(entity); dbGet.Error != nil {
|
||||
if errors.Is(dbGet.Error, gorm.ErrRecordNotFound) {
|
||||
return datastore.ErrRecordNotExist
|
||||
}
|
||||
return datastore.NewDBError(dbGet.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Put update data model
|
||||
func (m *Driver) Put(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
entity.SetUpdateTime(time.Now())
|
||||
if dbPut := m.Client.WithContext(ctx).Model(entity).Updates(entity); dbPut.Error != nil {
|
||||
if errors.Is(dbPut.Error, gorm.ErrRecordNotFound) {
|
||||
return datastore.ErrRecordNotExist
|
||||
}
|
||||
return datastore.NewDBError(dbPut.Error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsExist determine whether data exists.
|
||||
func (m *Driver) IsExist(ctx context.Context, entity datastore.Entity) (bool, error) {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return false, datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return false, datastore.ErrTableNameEmpty
|
||||
}
|
||||
|
||||
if dbExist := m.Client.WithContext(ctx).First(entity); dbExist.Error != nil {
|
||||
if errors.Is(dbExist.Error, gorm.ErrRecordNotFound) {
|
||||
return false, nil
|
||||
}
|
||||
return false, datastore.NewDBError(dbExist.Error)
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// Delete delete data
|
||||
func (m *Driver) Delete(ctx context.Context, entity datastore.Entity) error {
|
||||
if entity.PrimaryKey() == "" {
|
||||
return datastore.ErrPrimaryEmpty
|
||||
}
|
||||
if entity.TableName() == "" {
|
||||
return datastore.ErrTableNameEmpty
|
||||
}
|
||||
// check entity is existed
|
||||
if err := m.Get(ctx, entity); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if dbDelete := m.Client.WithContext(ctx).Model(entity).Delete(entity); dbDelete.Error != nil {
|
||||
klog.Errorf("delete document failure %w", dbDelete.Error)
|
||||
return datastore.NewDBError(dbDelete.Error)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// _toColumnName converts keys of the models to lowercase as the column name are in lowercase in the database
|
||||
func _toColumnName(columnName string) string {
|
||||
return strings.ToLower(columnName)
|
||||
}
|
||||
|
||||
func _applyFilterOptions(clauses []clause.Expression, filterOptions datastore.FilterOptions) []clause.Expression {
|
||||
for _, queryOp := range filterOptions.Queries {
|
||||
clauses = append(clauses, clause.Like{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Value: fmt.Sprintf("%%%s%%", queryOp.Query),
|
||||
})
|
||||
}
|
||||
for _, queryOp := range filterOptions.In {
|
||||
values := make([]interface{}, len(queryOp.Values))
|
||||
for i, v := range queryOp.Values {
|
||||
values[i] = v
|
||||
}
|
||||
clauses = append(clauses, clause.IN{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Values: values,
|
||||
})
|
||||
}
|
||||
for _, queryOp := range filterOptions.IsNotExist {
|
||||
clauses = append(clauses, clause.Eq{
|
||||
Column: _toColumnName(queryOp.Key),
|
||||
Value: "",
|
||||
})
|
||||
}
|
||||
return clauses
|
||||
}
|
||||
|
||||
// List list entity function
|
||||
func (m *Driver) List(ctx context.Context, entity datastore.Entity, op *datastore.ListOptions) ([]datastore.Entity, error) {
|
||||
if entity.TableName() == "" {
|
||||
return nil, datastore.ErrTableNameEmpty
|
||||
}
|
||||
var (
|
||||
clauses []clause.Expression
|
||||
exprs []clause.Expression
|
||||
limit int
|
||||
offset int
|
||||
)
|
||||
if op != nil && op.PageSize > 0 && op.Page > 0 {
|
||||
limit = op.PageSize
|
||||
offset = op.PageSize * (op.Page - 1)
|
||||
clauses = append(clauses, clause.Limit{
|
||||
Limit: &limit,
|
||||
Offset: offset,
|
||||
})
|
||||
}
|
||||
for k, v := range entity.Index() {
|
||||
exprs = append(exprs, clause.Eq{
|
||||
Column: strings.ToLower(k),
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
if op != nil {
|
||||
exprs = _applyFilterOptions(exprs, op.FilterOptions)
|
||||
}
|
||||
if len(exprs) > 0 {
|
||||
clauses = append(clauses, clause.Where{
|
||||
Exprs: exprs,
|
||||
})
|
||||
}
|
||||
if op != nil && op.SortBy != nil {
|
||||
var sortOption []clause.OrderByColumn
|
||||
for _, v := range op.SortBy {
|
||||
sortOption = append(sortOption, clause.OrderByColumn{
|
||||
Column: clause.Column{
|
||||
Name: strings.ToLower(v.Key),
|
||||
},
|
||||
Desc: v.Order == datastore.SortOrderDescending,
|
||||
})
|
||||
}
|
||||
clauses = append(clauses, clause.OrderBy{
|
||||
Columns: sortOption,
|
||||
})
|
||||
}
|
||||
var list []datastore.Entity
|
||||
rows, err := m.Client.WithContext(ctx).Model(entity).Clauses(clauses...).Rows()
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
defer func() {
|
||||
if err := rows.Close(); err != nil {
|
||||
klog.Warningf("close rows failure %s", err.Error())
|
||||
}
|
||||
}()
|
||||
for rows.Next() {
|
||||
item, err := datastore.NewEntity(entity)
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
err = m.Client.WithContext(ctx).ScanRows(rows, &item)
|
||||
if err != nil {
|
||||
return nil, datastore.NewDBError(fmt.Errorf("row scan failure %w", err))
|
||||
}
|
||||
list = append(list, item)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, datastore.NewDBError(err)
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// Count counts entities
|
||||
func (m *Driver) Count(ctx context.Context, entity datastore.Entity, filterOptions *datastore.FilterOptions) (int64, error) {
|
||||
if entity.TableName() == "" {
|
||||
return 0, datastore.ErrTableNameEmpty
|
||||
}
|
||||
var (
|
||||
count int64
|
||||
exprs []clause.Expression
|
||||
clauses []clause.Expression
|
||||
)
|
||||
for k, v := range entity.Index() {
|
||||
exprs = append(exprs, clause.Eq{
|
||||
Column: strings.ToLower(k),
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
if filterOptions != nil {
|
||||
exprs = _applyFilterOptions(exprs, *filterOptions)
|
||||
}
|
||||
if len(exprs) > 0 {
|
||||
clauses = append(clauses, clause.Where{
|
||||
Exprs: exprs,
|
||||
})
|
||||
}
|
||||
if dbCount := m.Client.WithContext(ctx).Model(entity).Clauses(clauses...).Count(&count); dbCount.Error != nil {
|
||||
return 0, datastore.NewDBError(dbCount.Error)
|
||||
}
|
||||
return count, nil
|
||||
}
|
|
@ -494,7 +494,7 @@ func (c *application) GetWebServiceRoute() *restful.WebService {
|
|||
Filter(c.appCheckFilter).
|
||||
Filter(c.WorkflowAPI.workflowCheckFilter).
|
||||
Param(ws.PathParameter("appName", "identifier of the application.").DataType("string").Required(true)).
|
||||
Param(ws.PathParameter("workflowName", "identifier of the workfloc.").DataType("string")).
|
||||
Param(ws.PathParameter("workflowName", "identifier of the workflow.").DataType("string")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Filter(c.WorkflowAPI.workflowCheckFilter).
|
||||
Returns(200, "create success", apis.DetailWorkflowResponse{}).
|
||||
|
@ -513,7 +513,7 @@ func (c *application) GetWebServiceRoute() *restful.WebService {
|
|||
Writes(apis.DetailWorkflowResponse{}).Do(returns500))
|
||||
|
||||
ws.Route(ws.DELETE("/{appName}/workflows/{workflowName}").To(c.WorkflowAPI.deleteWorkflow).
|
||||
Doc("deletet workflow").
|
||||
Doc("delete workflow").
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Filter(c.RbacService.CheckPerm("application/workflow", "delete")).
|
||||
Filter(c.appCheckFilter).
|
||||
|
|
|
@ -161,7 +161,7 @@ func (c *CloudShellView) proxy(req *restful.Request, res *restful.Response) {
|
|||
proxy.Upgrader = &websocket.Upgrader{
|
||||
ReadBufferSize: 1024,
|
||||
WriteBufferSize: 1024,
|
||||
CheckOrigin: func(req *http.Request) bool {
|
||||
CheckOrigin: func(req *http.Request) bool { //nolint:revive,unused
|
||||
return true
|
||||
},
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ func (p *ManagePlugin) GetWebServiceRoute() *restful.WebService {
|
|||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Filter(p.RBACService.CheckPerm("managePlugin", "enable")).
|
||||
Param(ws.PathParameter("pluginId", "identifier of the plugin.").DataType("string")).
|
||||
Returns(200, "OK", struct{}{}).
|
||||
Returns(200, "OK", apis.EmptyResponse{}).
|
||||
Writes(apis.PluginDTO{}).Do(returns500))
|
||||
|
||||
ws.Route(ws.POST("/{pluginId}/enable").To(p.enablePlugin).
|
||||
|
|
|
@ -115,7 +115,7 @@ func (h repository) GetWebServiceRoute() *restful.WebService {
|
|||
Param(ws.PathParameter("version", "version of the helm chart").DataType("string").Required(true)).
|
||||
Param(ws.QueryParameter("repoUrl", "helm repository url").DataType("string")).
|
||||
Param(ws.QueryParameter("secretName", "secret of the repo").DataType("string")).
|
||||
Returns(200, "OK", map[string]interface{}{}).
|
||||
Returns(200, "OK", v1.Properties{}).
|
||||
Returns(400, "Bad Request", bcode.Bcode{}).
|
||||
Writes(map[string]interface{}{}))
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ func (dt *Target) GetWebServiceRoute() *restful.WebService {
|
|||
Writes(apis.DetailTargetResponse{}).Do(returns500))
|
||||
|
||||
ws.Route(ws.DELETE("/{targetName}").To(dt.deleteTarget).
|
||||
Doc("deletet Target").
|
||||
Doc("delete Target").
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Filter(dt.targetCheckFilter).
|
||||
Filter(dt.RbacService.CheckPerm("target", "delete")).
|
||||
|
|
|
@ -14541,9 +14541,9 @@ __metadata:
|
|||
linkType: hard
|
||||
|
||||
"get-func-name@npm:^2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "get-func-name@npm:2.0.0"
|
||||
checksum: 8d82e69f3e7fab9e27c547945dfe5cc0c57fc0adf08ce135dddb01081d75684a03e7a0487466f478872b341d52ac763ae49e660d01ab83741f74932085f693c3
|
||||
version: 2.0.2
|
||||
resolution: "get-func-name@npm:2.0.2"
|
||||
checksum: 3f62f4c23647de9d46e6f76d2b3eafe58933a9b3830c60669e4180d6c601ce1b4aa310ba8366143f55e52b139f992087a9f0647274e8745621fa2af7e0acf13b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
|
Loading…
Reference in New Issue