Compare commits

...

25 Commits
v1.9.1 ... main

Author SHA1 Message Date
am6737 9c8cc5d816
fix: Prevent crashes when accessing cluster details (#911)
- Added optional chaining to safely access cluster details in `AddClusterDialog`.

This fix addresses the issue where the page crashes when trying to load details for an inaccessible cluster.

Signed-off-by: am6737 <1359816810@qq.com>
2025-03-13 09:43:00 +05:30
am6737 0d00d92f55
fix: Set default values for traits in VelaUX (#913)
Added `setDefaultProperties` to ensure default values are correctly set for traits like "cpuscaler", "hpa", "resource", and "k8s-update-strategy".

Signed-off-by: am6737 <1359816810@qq.com>
2025-03-13 09:40:29 +05:30
PushparajShetty 021024e4af
Fix: Modified error message for invalid pwd and username (#918)
* Modified error message for invalid pwd and username

Signed-off-by: viskumar <viskumar@guidewire.com>

* changed the actions/cache version to v4

Signed-off-by: Vibhor Chinda <vibhorchinda@gmail.com>

* Fix: permission for PR labeling

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

---------

Signed-off-by: viskumar <viskumar@guidewire.com>
Signed-off-by: Vibhor Chinda <vibhorchinda@gmail.com>
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
Co-authored-by: viskumar <viskumar@guidewire.com>
Co-authored-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-03-13 09:26:50 +05:30
am6737 d9b7ae102f
feat: improve Helm charts values.yaml popup (#909)
- Added custom width (60vw) to Helm values.yaml dialog for better visibility.
- Enabled close modes: 'close' and 'mask' to improve user experience.

Closes #851

Signed-off-by: am6737 <1359816810@qq.com>
2024-10-10 13:36:59 +08:00
am6737 8e11f93ed7
Fix(addons): Align Button with Title in AddonDetailDialog (#915)
Signed-off-by: am6737 <1359816810@qq.com>
2024-10-09 18:24:09 +08:00
Anoop Gopalakrishnan 5704854899
Chore: Bump versions (#905)
* Chore: Bump versions

- Golang
- Kubernetes version in kubebuilder
- Ubuntu version

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Bump golang version

- Bump the github action versions

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Bump golang and github actions versions

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Bump golang and github action versions

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore(debug): Downgrade kubebuilder k8s version

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore(debug): Use makefile for kubebuilder install

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore(debug): Set kubernetes version in kubebuilder

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Bump all actions versions

- And golang versions

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore(debug): Bump versions

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: Bump versions

- Updated golang version in go.mod
- Updated staticcheck version

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Bump versions

- Update the golangci-lint version

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Bump versions

- Fix lint/staticcheck issues

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Bump versions

- Fix lint issues

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Bump versions

- Fix lint issues

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

---------

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2024-07-11 16:01:28 +05:30
Oana Schipor 73334e7516
Fix: Username length in projects users to match users (#904)
* truncating username in vela_project_user to match vela_user username

Signed-off-by: Oana Schipor <oana.schipor@vortexa.com>

* update fn

Signed-off-by: Oana Schipor <oana.schipor@vortexa.com>

* Remove old k8s version

Signed-off-by: Oana Schipor <oana.schipor@vortexa.com>

---------

Signed-off-by: Oana Schipor <oana.schipor@vortexa.com>
2024-07-04 20:46:27 +05:30
Bob 127f5325e9
fix: fix swgger.json (#891)
* Update swagger.json by `make update-swagger`.
* Returns a predefined structure instead of a map object to avoid Swagger being unable to generate code correctly
* Delete duplicate runtimes_cluster parameter definition to avoid the code constructed by swagger being unusable
* Add swagger 3.0.json to facilitate developers debugging APIs on the swagger UI.

Signed-off-by: 上郡 <shangjun.csb@alibaba-inc.com>
Co-authored-by: 上郡 <shangjun.csb@alibaba-inc.com>
2023-12-05 13:03:22 +08:00
Bob d5ea29f5ab
fix: fix some typo errors (#890)
Signed-off-by: 上郡 <shangjun.csb@alibaba-inc.com>
Co-authored-by: 上郡 <shangjun.csb@alibaba-inc.com>
2023-12-05 12:52:21 +08:00
dependabot[bot] 2ab672c09a
Chore(deps): Bump get-func-name from 2.0.0 to 2.0.2 (#880)
Bumps [get-func-name](https://github.com/chaijs/get-func-name) from 2.0.0 to 2.0.2.
- [Release notes](https://github.com/chaijs/get-func-name/releases)
- [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2)

---
updated-dependencies:
- dependency-name: get-func-name
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-30 19:49:50 -05:00
Neeraj Gartia 4579408f62
Fix: Enables translate error property of `gorm` (#877) 2023-09-15 13:58:26 +08:00
qiaozp d14a2b6538
Chore: unify sql data driver implementation (#873) 2023-09-07 11:44:59 +08:00
qiaozp 7937d098d5
Feat: support exit-on-lost-leader flag (#868) 2023-08-08 13:45:35 +08:00
qiaozp 8438aa72e9
Fix: fail to get global helm config secret (#867)
* Fix: fail to get global config when config not exist in project scope

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Add unit test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add test clean up

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix: infinite forloop

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* restore 404

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-08-02 20:19:11 +08:00
Namo 27b45c265c
Feat: Add support for OpenGauss database types (#865)
Signed-off-by: ligjn <lgj112113@163.com>

change opengauss to postgres

Co-authored-by: ligjn <lgj112113@163.com>
2023-08-01 21:26:26 +08:00
zuoningz d0b2a3b995
Fix: incorrect API response mark (#864)
Co-authored-by: Z Zhang <zuoning@AndrewZs-MacBook-Air.local>
2023-07-27 17:42:23 +08:00
qiaozp 3978079cfd
Fix: additionalPropertis in openapi schema converted to uischema wrongly (#861)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-07-22 19:36:26 +08:00
qiaozp 76a39a7b99
Fix: CodeQL job fails (#860)
* Fix: CodeQL job fails

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix: code lint

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix: code lint

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix: code lint

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-07-21 10:41:58 +08:00
dependabot[bot] 470699b3fb
Chore(deps): Bump semver from 5.7.1 to 5.7.2 (#853)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-20 16:59:46 +08:00
dependabot[bot] 2570713556
Chore(deps): Bump word-wrap from 1.2.3 to 1.2.4 (#858)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-20 15:27:38 +08:00
zuoningz 0e56cec6b5
Fix: applied default cluster to created target (#857)
Co-authored-by: Z Zhang <zuoning@AndrewZs-MacBook-Air.local>
2023-07-18 16:04:43 +08:00
mujinhuakai 8a81aa1e1d
Fix: customized uiSchema can't show properly (#854)
Co-authored-by: liyanfang <liyanfang@cmss.chinamobile.com>
2023-07-14 14:36:18 +08:00
qiaozp 28dea8a27e
Fix: cloudshell scheme not found (#856)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-07-14 09:56:36 +08:00
Neeraj Gartia 118a9fee6c
Feat: adds support of mongodb urls with prefix `mongodb+srv://` (#849) 2023-06-28 14:32:18 +08:00
Neeraj Gartia 580372f9d0
Feat: add MySQL data store driver implementation (#841) 2023-06-26 21:25:20 +08:00
92 changed files with 22903 additions and 1140 deletions

View File

@ -1 +1 @@
node_modules
**/node_modules/

View File

@ -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: |

View File

@ -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 }}

View File

@ -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 }}"

View File

@ -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'

View File

@ -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'

View File

@ -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 }}

View File

@ -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

View File

@ -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') }}
@ -66,18 +66,32 @@ jobs:
sudo apt-get update
sudo apt-get install -y golang-ginkgo-dev
- name : Set up MySQL
uses: mirromutth/mysql-action@v1.1
with:
mysql database: 'kubevela'
mysql root password: 'kubevelaSQL123'
- name: Set up Postgres
uses: Harmon758/postgresql-action@v1
with:
postgresql version: '11'
postgresql db: 'kubevela'
postgresql user: 'kubevela'
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
@ -91,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: |
@ -179,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

View File

@ -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

View File

@ -1,6 +1,8 @@
include makefiles/const.mk
include makefiles/build.mk
all: docker-build
.PHONY: golangci
golangci:
ifeq ($(shell $(GLOBAL_GOLANGCILINT) version --format short), $(GOLANGCILINT_VERSION))
@ -25,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

View File

@ -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]

19877
docs/apidoc/swagger-3.0.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

52
go.mod
View File

@ -1,6 +1,6 @@
module github.com/kubevela/velaux
go 1.19
go 1.22
require (
cuelang.org/go v0.5.0
@ -11,7 +11,7 @@ require (
github.com/barnettZQG/inject v0.0.1
github.com/briandowns/spinner v1.23.0 // indirect
github.com/chartmuseum/helm-push v0.10.4 // indirect
github.com/cloudtty/cloudtty v0.2.0
github.com/cloudtty/cloudtty v0.5.0
github.com/containerd/containerd v1.7.2 // indirect
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/crossplane/crossplane-runtime v0.19.2 // indirect
@ -30,7 +30,7 @@ require (
github.com/form3tech-oss/jwt-go v3.2.5+incompatible
github.com/getkin/kin-openapi v0.118.0
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-git/go-git/v5 v5.6.1 // indirect
github.com/go-git/go-git/v5 v5.7.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/spec v0.20.7
github.com/go-playground/validator/v10 v10.9.0
@ -53,11 +53,11 @@ require (
github.com/oam-dev/cluster-gateway v1.9.0-alpha.2
github.com/oam-dev/cluster-register v1.0.4-0.20230424040021-147f7c1fefe5 // indirect
github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28 // indirect
github.com/oam-dev/terraform-controller v0.7.10
github.com/oam-dev/terraform-controller v0.7.11
github.com/onsi/gomega v1.27.8
github.com/openkruise/kruise-api v1.4.0 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.9.3 // indirect
@ -66,14 +66,14 @@ require (
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.14.4
github.com/wercker/stern v0.0.0-20190705090245-4fa46dd6987f // indirect
github.com/xanzy/go-gitlab v0.85.0 // indirect
github.com/xanzy/go-gitlab v0.86.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.mongodb.org/mongo-driver v1.11.2
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.10.0
golang.org/x/oauth2 v0.8.0
golang.org/x/term v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/crypto v0.11.0
golang.org/x/oauth2 v0.10.0
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools v2.2.0+incompatible
@ -93,8 +93,8 @@ require (
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5
open-cluster-management.io/api v0.10.1 // indirect
sigs.k8s.io/controller-runtime v0.14.6
sigs.k8s.io/gateway-api v0.7.0 // indirect
sigs.k8s.io/kind v0.18.0 // indirect
sigs.k8s.io/gateway-api v0.7.1 // indirect
sigs.k8s.io/kind v0.20.0 // indirect
sigs.k8s.io/yaml v1.3.0
)
@ -106,8 +106,9 @@ require (
github.com/grafana/grafana v1.9.2-0.20230216173926-a0bea04a0274
github.com/julienschmidt/httprouter v1.3.0
github.com/kubevela/workflow v0.6.0
github.com/oam-dev/kubevela v1.9.1
github.com/oam-dev/kubevela v1.9.4
github.com/onsi/ginkgo/v2 v2.11.0
gorm.io/driver/postgres v1.5.2
)
require (
@ -124,6 +125,9 @@ require (
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.4.2 // indirect
github.com/jellydator/ttlcache/v3 v3.0.1 // indirect
github.com/perimeterx/marshmallow v1.1.4 // indirect
github.com/tjfoc/gmsm v1.3.2 // indirect
@ -141,7 +145,7 @@ require (
github.com/Masterminds/squirrel v1.5.3 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/alessio/shellescape v1.4.1 // indirect
@ -171,7 +175,7 @@ require (
github.com/fluxcd/pkg/apis/meta v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
@ -214,7 +218,7 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
@ -239,12 +243,12 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rubenv/sql-migrate v1.3.1 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/skeema/knownhosts v1.1.1 // indirect
github.com/spf13/cast v1.5.0
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
@ -268,15 +272,15 @@ require (
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.starlark.net v0.0.0-20221020143700-22309ac47eac // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.10.0 // indirect
golang.org/x/tools v0.11.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
@ -284,7 +288,7 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gorm.io/gorm v1.25.1
gorm.io/gorm v1.25.2
k8s.io/klog v1.0.0 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
oras.land/oras-go v1.2.2 // indirect

168
go.sum
View File

@ -1,8 +1,10 @@
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.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY=
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,17 +52,19 @@ 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=
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw=
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA=
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 h1:ZK3C5DtzV2nVAQTx5S5jQvMeDqWtD1By5mOoyY/xJek=
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903/go.mod h1:8TI4H3IbrackdNgv+92dI+rhpCaLqM0IfpgCgenFvRE=
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=
@ -136,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=
@ -149,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=
@ -180,8 +190,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I=
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cloudtty/cloudtty v0.2.0 h1:QvDbb2hZl7nSfLDrKkbjIixjkW6seSVBX3N/GRmioyM=
github.com/cloudtty/cloudtty v0.2.0/go.mod h1:RRVb8fLrfpzjsLFqaUk74ouRvZ2drVCvSN3ZzidHju8=
github.com/cloudtty/cloudtty v0.5.0 h1:ees/ai35hhFiMPX+ifbRtyGra8QaE1+LHO49ZCuDKBs=
github.com/cloudtty/cloudtty v0.5.0/go.mod h1:gyxZNmuHhu+53n0mQV6n8TfMw4uwJHIA/7hZ2kKv1/4=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
@ -196,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=
@ -221,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=
@ -234,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=
@ -243,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-20220115173737-adb46da277ac h1:XDAn206aIqKPdF5YczuuJXSQPx+WOen0Pxbxp5Fq8Pg=
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=
@ -260,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=
@ -281,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=
@ -316,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=
@ -328,15 +351,14 @@ 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.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
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.1 h1:y5z6dd3qi8Hl+stezc8p3JxDkoTRqMAlKnXHuzrfjTQ=
github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo=
github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk=
github.com/go-git/go-git/v5 v5.6.1/go.mod h1:mvyoL6Unz0PiTQrGQfSfiLFhBH1c1e84ylC2MDs4ee8=
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=
github.com/go-gorp/gorp/v3 v3.0.5/go.mod h1:dLEjIyyRNiXvNZ8PSmzpt1GsWAUK8kjVhEpjH8TixEw=
github.com/go-gorp/gorp/v3 v3.1.0 h1:ItKF/Vbuj31dmV4jxA1qblpSwkl9g1typ24xoe70IGs=
@ -454,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=
@ -511,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=
@ -546,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=
@ -564,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=
@ -596,12 +622,17 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/invopop/yaml v0.1.0 h1:YW3WGUoJEXYfzWBjn00zIlrw7brGVD0fUKRYDPAPhrc=
github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.4.2 h1:u1gmGDwbdRUZiwisBm/Ky2M14uQyUP65bG8+20nnyrg=
github.com/jackc/pgx/v5 v5.4.2/go.mod h1:q6iHT8uDNXWiFNOlRqJzBTaSH3+2xCXkokxHZC5qWFY=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jellydator/ttlcache/v3 v3.0.1 h1:cHgCSMS7TdQcoprXnWUptJZzyFsqs18Lt8VVhRuZYVU=
github.com/jellydator/ttlcache/v3 v3.0.1/go.mod h1:WwTaEmcXQ3MTjOm4bsZoDFiCu/hMvNWLO1w67RXz6h4=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
@ -616,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=
@ -660,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=
@ -684,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=
@ -702,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=
@ -719,11 +754,12 @@ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPn
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-oci8 v0.1.1/go.mod h1:wjDx6Xm9q7dFtHJvIlrI99JytznLw5wQ4R+9mNXJwGI=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
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=
@ -756,7 +792,6 @@ github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/moby v20.10.20+incompatible h1:x7tLy/H63mylLX/1d75N8NCuYcXBqJAzATrMXHie5+I=
@ -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=
@ -806,14 +842,14 @@ github.com/oam-dev/cluster-gateway v1.9.0-alpha.2 h1:412Yhe6BoNVgeomv0tvJaOeKl6v
github.com/oam-dev/cluster-gateway v1.9.0-alpha.2/go.mod h1:MbBn0E1eGWXqSsnrOb2aKLnGcyvg34Lz9/Q+B1uGEpE=
github.com/oam-dev/cluster-register v1.0.4-0.20230424040021-147f7c1fefe5 h1:LJbb+5T9SyykRbni1jwcj9DvqhP60m5OexrF0vzzRcg=
github.com/oam-dev/cluster-register v1.0.4-0.20230424040021-147f7c1fefe5/go.mod h1:Xc5oAAnLOjH7xYSQL0AGHPobFiShL7EYhV/4j9rrwXg=
github.com/oam-dev/kubevela v1.9.1 h1:Zf4/mJzcu3NDWjA/MU/IDH3EDHnv3tGNABiAIU5o7Zc=
github.com/oam-dev/kubevela v1.9.1/go.mod h1:ony10dvzbFco8njvGT/oYAnf0qHw1H/zKLtnm0zgOn4=
github.com/oam-dev/kubevela v1.9.4 h1:ZZmmkvi7mdShfbdnrf3kSQGuFI/hdEmktE7olHNCA0o=
github.com/oam-dev/kubevela v1.9.4/go.mod h1:6zWuQRLNatpVKVSkpqlMOiy7tRKt1QjG4enciusYhHg=
github.com/oam-dev/stern v1.13.2 h1:jlGgtJbKmIVhzkH44ft5plkgs8XEfvxbFrQdX60CQR4=
github.com/oam-dev/stern v1.13.2/go.mod h1:0pLjZt0amXE/ErF16Rdrgd98H2owN8Hmn3/7CX5+AeA=
github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28 h1:tD8HiFKnt0jnwdTWjeqUnfnUYLD/+Nsmj8ZGIxqDWiU=
github.com/oam-dev/terraform-config-inspect v0.0.0-20210418082552-fc72d929aa28/go.mod h1:Mu8i0/DdplvnjwRbAYPsc8+LRR27n/mp8VWdkN10GzE=
github.com/oam-dev/terraform-controller v0.7.10 h1:e2STz6Od53S4Ra4+QQs65lujF50vIb6eQtTMuvvofjk=
github.com/oam-dev/terraform-controller v0.7.10/go.mod h1:xvgChKG0pij0WEKRrX7w30SdVBPVOlRl/+Mv7+2C1cI=
github.com/oam-dev/terraform-controller v0.7.11 h1:uucdSBLL0PUz60hOZfjsAe/ivrd/K/2u0Iko8nVQIE0=
github.com/oam-dev/terraform-controller v0.7.11/go.mod h1:xvgChKG0pij0WEKRrX7w30SdVBPVOlRl/+Mv7+2C1cI=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
@ -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=
@ -899,8 +936,8 @@ github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI=
github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@ -929,11 +966,13 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
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=
@ -953,7 +993,6 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
@ -968,8 +1007,8 @@ github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0=
github.com/skeema/knownhosts v1.1.0/go.mod h1:sKFq3RD6/TKZkSWn8boUbDC7Qkgcv+8XXijpFO6roag=
github.com/skeema/knownhosts v1.1.1 h1:MTk78x9FPgDFVFkDLTrsnnfCJl7g1C/nnKvePgrIngE=
github.com/skeema/knownhosts v1.1.1/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
@ -1044,8 +1083,8 @@ github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN
github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck=
github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/xanzy/go-gitlab v0.85.0 h1:E/wjnsd/mM5kV6O9y5+i6zxjx+wfAwa97sgcT1ETNwk=
github.com/xanzy/go-gitlab v0.85.0/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw=
github.com/xanzy/go-gitlab v0.86.0 h1:jR8V9cK9jXRQDb46KOB20NCF3ksY09luaG0IfXE6p7w=
github.com/xanzy/go-gitlab v0.86.0/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
@ -1077,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=
@ -1112,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=
@ -1172,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=
@ -1183,7 +1228,6 @@ go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI=
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
golang.org/x/arch v0.1.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@ -1206,15 +1250,13 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
@ -1237,8 +1279,8 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -1285,16 +1327,16 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -1306,8 +1348,8 @@ golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -1388,9 +1430,7 @@ golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@ -1399,24 +1439,25 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28=
golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo=
golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@ -1427,9 +1468,10 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@ -1470,8 +1512,8 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=
golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8=
golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -1561,8 +1603,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
@ -1613,8 +1655,11 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o=
gorm.io/gorm v1.25.1 h1:nsSALe5Pr+cM3V1qwwQ7rOkw+6UeLrX5O4v3llhHa64=
gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0=
gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8=
gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho=
gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
@ -1706,7 +1751,6 @@ open-cluster-management.io/api v0.10.1 h1:/qv1qfIkAVSz6RQmKGehSv6zYI34Xmb8hK7sIU
open-cluster-management.io/api v0.10.1/go.mod h1:6BB/Y6r3hXlPjpJgDwIs6Ubxyx/kXXOg6D9Cntg1I9E=
oras.land/oras-go v1.2.2 h1:0E9tOHUfrNH7TCDk5KU0jVBEzCqbfdyuVfGmJ7ZeRPE=
oras.land/oras-go v1.2.2/go.mod h1:Apa81sKoZPpP7CDciE006tSZ0x3Q3+dOoBcMZ/aNxvw=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
sigs.k8s.io/apiserver-network-proxy v0.0.30 h1:Zr5Zqd2GymcYUwijHUDEaQ1I3Dx0giTIWaD80N6j2mE=
sigs.k8s.io/apiserver-network-proxy v0.0.30/go.mod h1:0wSWl5ohhp7kYl5XOP0w1IZSWTHhe9TojjDGityZxnc=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.36 h1:PUuX1qIFv309AT8hF/CdPKDmsG/hn/L8zRX7VvISM3A=
@ -1716,14 +1760,14 @@ sigs.k8s.io/apiserver-runtime v1.1.2-0.20221118041430-0a6394f6dda3/go.mod h1:HxS
sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA=
sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92KcwQA=
sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
sigs.k8s.io/gateway-api v0.7.0 h1:/mG8yyJNBifqvuVLW5gwlI4CQs0NR/5q4BKUlf1bVdY=
sigs.k8s.io/gateway-api v0.7.0/go.mod h1:Xv0+ZMxX0lu1nSSDIIPEfbVztgNZ+3cfiYrJsa2Ooso=
sigs.k8s.io/gateway-api v0.7.1 h1:Tts2jeepVkPA5rVG/iO+S43s9n7Vp7jCDhZDQYtPigQ=
sigs.k8s.io/gateway-api v0.7.1/go.mod h1:Xv0+ZMxX0lu1nSSDIIPEfbVztgNZ+3cfiYrJsa2Ooso=
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs=
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/kind v0.18.0 h1:ahgZdVV1pdhXlYe1f+ztISakT23KdrBl/NFY9JMygzs=
sigs.k8s.io/kind v0.18.0/go.mod h1:Qqp8AiwOlMZmJWs37Hgs31xcbiYXjtXlRBSftcnZXQk=
sigs.k8s.io/kind v0.20.0 h1:f0sc3v9mQbGnjBUaqSFST1dwIuiikKVGgoTwpoP33a8=
sigs.k8s.io/kind v0.20.0/go.mod h1:aBlbxg08cauDgZ612shr017/rZwqd7AS563FvpWKPVs=
sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM=
sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s=
sigs.k8s.io/kustomize/kyaml v0.13.9 h1:Qz53EAaFFANyNgyOEJbT/yoIHygK40/ZcvU3rgry2Tk=

View File

@ -1,6 +1,6 @@
SHELL := /bin/bash
GOLANGCILINT_VERSION ?= 1.49.0
GOLANGCILINT_VERSION ?= 1.59.1
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@ -17,6 +17,7 @@ VELAUX_VERSION ?= main
# Repo info
GIT_COMMIT ?= git-$(shell git rev-parse --short HEAD)
GIT_COMMIT_LONG ?= $(shell git rev-parse HEAD)
VELAUX_IMAGE ?= velaux:$(VELAUX_VERSION)
VELAUX_VERSION_KEY := github.com/kubevela/velaux/version.VelaVersion
VELAUX_GITVERSION_KEY := github.com/kubevela/velaux/version.GitRevision
LDFLAGS ?= "-s -w -X $(VELAUX_VERSION_KEY)=$(VELAUX_VERSION) -X $(VELAUX_GITVERSION_KEY)=$(GIT_COMMIT)"

View File

@ -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}

View File

@ -192,9 +192,6 @@ class UISchema extends Component<Props, State> {
if (condition.action == 'enable' || !condition.action) {
enableConditionCount += 1;
}
if (value == undefined) {
return;
}
switch (condition.op) {
case 'in':
if (Array.isArray(condition.value) && condition.value.includes(value)) {
@ -976,7 +973,7 @@ class UISchema extends Component<Props, State> {
};
const showAdvancedButton = couldBeDisabledParamCount != couldShowParamCount || requiredParamCount === 0;
return (
return (
<Form field={this.form} className="ui-schema-container">
<If condition={disableRenderRow}>{items}</If>
<If condition={!disableRenderRow}>

View File

@ -57,7 +57,7 @@ class Group extends React.Component<Props, State> {
initSwitchState = () => {
const { jsonKey = '', propertyValue = {}, alwaysShow = false, required, closed, initClose } = this.props;
const findKey = Object.keys(propertyValue).find((item) => item === jsonKey);
const findKey = propertyValue && Object.keys(propertyValue).find((item) => item === jsonKey);
if (findKey || alwaysShow) {
this.setState({ enable: true, closed: false || initClose, checked: true });
} else if (required) {

View File

@ -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>
),
},

View File

@ -329,6 +329,7 @@
"Only support github repo urlmaster 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": "加入时间"
}
}

View File

@ -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' });

View File

@ -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 });

View File

@ -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,

View File

@ -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 || '' });
}

View File

@ -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>
),
},

View File

@ -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>
),
},

View File

@ -26,6 +26,6 @@ type staticServerProxy struct {
plugin *types.Plugin
}
func (k *staticServerProxy) Handler(req *http.Request, res http.ResponseWriter) {
func (k *staticServerProxy) Handler(_ *http.Request, _ http.ResponseWriter) {
// TODO:
}

View File

@ -148,7 +148,7 @@ type KubernetesService struct {
// If namespace is not specified, find the service from the vela system namespace
Namespace string `json:"namespace"`
// If port is not specified, find the first port from the service
Port int32
Port int32 `json:"port"`
}
// KubernetesSecret define one kubernetes secret

View File

@ -58,6 +58,9 @@ type Config struct {
PluginConfig PluginConfig
DexServerURL string
// ExitOnLostLeader will exit the process if this server lost the leader election, set this to true for debugging
ExitOnLostLeader bool
}
// PluginConfig the plugin directory config
@ -95,7 +98,8 @@ func NewConfig() *Config {
CorePluginPath: "core-plugins",
CustomPluginPath: []string{"plugins"},
},
DexServerURL: "http://dex.vela-system:5556",
DexServerURL: "http://dex.vela-system:5556",
ExitOnLostLeader: true,
}
}
@ -103,7 +107,7 @@ func NewConfig() *Config {
func (s *Config) Validate() []error {
var errs []error
if s.Datastore.Type != "mongodb" && s.Datastore.Type != "kubeapi" {
if s.Datastore.Type != "mongodb" && s.Datastore.Type != "kubeapi" && s.Datastore.Type != "postgres" {
errs = append(errs, fmt.Errorf("not support datastore type %s", s.Datastore.Type))
}
@ -127,5 +131,6 @@ func (s *Config) AddFlags(fs *pflag.FlagSet, c *Config) {
fs.StringVar(&s.WorkflowVersion, "workflow-version", c.WorkflowVersion, "the version of workflow to meet controller requirement.")
fs.StringVar(&s.DexServerURL, "dex-server", c.DexServerURL, "the URL of the dex server.")
fs.StringArrayVar(&s.PluginConfig.CustomPluginPath, "plugin-path", c.PluginConfig.CustomPluginPath, "the path of the plugin directory")
fs.BoolVar(&s.ExitOnLostLeader, "exit-on-lost-leader", c.ExitOnLostLeader, "exit the process if this server lost the leader election")
profiling.AddFlags(fs)
}

View File

@ -33,13 +33,13 @@ func init() {
// Application application delivery model
type Application struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Project string `json:"project"`
Description string `json:"description"`
Icon string `json:"icon"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
Labels map[string]string `json:"labels,omitempty" gorm:"serializer:json"`
Annotations map[string]string `json:"annotations,omitempty" gorm:"serializer:json"`
}
// TableName return custom table name
@ -117,27 +117,27 @@ type ComponentSelector struct {
// ApplicationComponent component database model
type ApplicationComponent struct {
BaseModel
AppPrimaryKey string `json:"appPrimaryKey"`
AppPrimaryKey string `json:"appPrimaryKey" gorm:"primaryKey"`
Description string `json:"description,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Labels map[string]string `json:"labels,omitempty" gorm:"serializer:json"`
Icon string `json:"icon,omitempty"`
Creator string `json:"creator"`
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Type string `json:"type"`
Main bool `json:"main"`
// ExternalRevision specified the component revisionName
ExternalRevision string `json:"externalRevision,omitempty"`
Properties *JSONStruct `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs workflowv1alpha1.StepInputs `json:"inputs,omitempty"`
Outputs workflowv1alpha1.StepOutputs `json:"outputs,omitempty"`
Properties *JSONStruct `json:"properties,omitempty" gorm:"serializer:json"`
DependsOn []string `json:"dependsOn,omitempty" gorm:"serializer:json"`
Inputs workflowv1alpha1.StepInputs `json:"inputs,omitempty" gorm:"serializer:json"`
Outputs workflowv1alpha1.StepOutputs `json:"outputs,omitempty" gorm:"serializer:json"`
// Traits define the trait of one component, the type must be array to keep the order.
Traits []ApplicationTrait `json:"traits,omitempty"`
Traits []ApplicationTrait `json:"traits,omitempty" gorm:"serializer:json"`
// scopes in ApplicationComponent defines the component-level scopes
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
Scopes map[string]string `json:"scopes,omitempty"`
WorkloadType common.WorkloadTypeDescriptor `json:"workloadType,omitempty"`
Scopes map[string]string `json:"scopes,omitempty" gorm:"serializer:json"`
WorkloadType common.WorkloadTypeDescriptor `json:"workloadType,omitempty" gorm:"serializer:json"`
}
// TableName return custom table name
@ -176,13 +176,13 @@ func (a *ApplicationComponent) Index() map[string]interface{} {
// ApplicationPolicy app policy
type ApplicationPolicy struct {
BaseModel
AppPrimaryKey string `json:"appPrimaryKey"`
Name string `json:"name"`
AppPrimaryKey string `json:"appPrimaryKey" gorm:"primaryKey"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Description string `json:"description"`
Type string `json:"type"`
Creator string `json:"creator"`
Properties *JSONStruct `json:"properties,omitempty"`
Properties *JSONStruct `json:"properties,omitempty" gorm:"serializer:json"`
// EnvName if it is not empty, the policy is only belong to this environment
// For auto created policies, this field will be assigned a value
EnvName string `json:"envName"`
@ -226,7 +226,7 @@ type ApplicationTrait struct {
Alias string `json:"alias"`
Description string `json:"description"`
Type string `json:"type"`
Properties *JSONStruct `json:"properties,omitempty"`
Properties *JSONStruct `json:"properties,omitempty" gorm:"serializer:json"`
CreateTime time.Time `json:"createTime"`
UpdateTime time.Time `json:"updateTime"`
}
@ -255,8 +255,8 @@ var WorkflowStepPhaseStopped workflowv1alpha1.WorkflowStepPhase = "stopped"
// ApplicationRevision be created when an application initiates deployment and describes the phased version of the application.
type ApplicationRevision struct {
BaseModel
AppPrimaryKey string `json:"appPrimaryKey"`
Version string `json:"version"`
AppPrimaryKey string `json:"appPrimaryKey" gorm:"primaryKey"`
Version string `json:"version" gorm:"primaryKey"`
RollbackVersion string `json:"rollbackVersion,omitempty"`
// ApplyAppConfig Stores the application configuration during the current deploy.
ApplyAppConfig string `json:"applyAppConfig,omitempty"`
@ -281,9 +281,9 @@ type ApplicationRevision struct {
// EnvName is the env name of this application revision
EnvName string `json:"envName"`
// CodeInfo is the code info of this application revision
CodeInfo *CodeInfo `json:"codeInfo,omitempty"`
CodeInfo *CodeInfo `json:"codeInfo,omitempty" gorm:"serializer:json"`
// ImageInfo is the image info of this application revision
ImageInfo *ImageInfo `json:"imageInfo,omitempty"`
ImageInfo *ImageInfo `json:"imageInfo,omitempty" gorm:"serializer:json"`
}
// CodeInfo is the code info for webhook request
@ -384,7 +384,7 @@ type ApplicationTrigger struct {
Name string `json:"name"`
Alias string `json:"alias,omitempty"`
Description string `json:"description,omitempty"`
Token string `json:"token"`
Token string `json:"token" gorm:"primaryKey"`
Type string `json:"type"`
PayloadType string `json:"payloadType"`
ComponentName string `json:"componentName"`

View File

@ -53,14 +53,14 @@ var (
// Cluster describes the model of cluster in apiserver
type Cluster struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Description string `json:"description"`
Icon string `json:"icon"`
Labels map[string]string `json:"labels"`
Labels map[string]string `json:"labels" gorm:"serializer:json"`
Status string `json:"status"`
Reason string `json:"reason"`
Provider ProviderInfo `json:"provider"`
Provider ProviderInfo `json:"provider" gorm:"serializer:json"`
APIServerURL string `json:"apiServerURL"`
DashboardURL string `json:"dashboardURL"`
KubeConfig string `json:"kubeConfig"`

View File

@ -23,7 +23,7 @@ func init() {
// Env models the data of env in database
type Env struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Description string `json:"description,omitempty"`
@ -34,7 +34,7 @@ type Env struct {
// Targets defines the name of delivery target that belongs to this env
// In one project, a delivery target can only belong to one env.
Targets []string `json:"targets,omitempty"`
Targets []string `json:"targets,omitempty" gorm:"serializer:json"`
}
// TableName return custom table name

View File

@ -25,10 +25,10 @@ func init() {
// EnvBinding application env binding
type EnvBinding struct {
BaseModel
AppPrimaryKey string `json:"appPrimaryKey"`
AppPrimaryKey string `json:"appPrimaryKey" gorm:"primaryKey"`
AppDeployName string `json:"appDeployName"`
Name string `json:"name"`
ComponentsPatch []ComponentPatch `json:"componentsPatchs"`
Name string `json:"name" gorm:"primaryKey"`
ComponentsPatch []ComponentPatch `json:"componentsPatchs" gorm:"serializer:json"`
}
// ComponentPatch Define differential patches for components in the environment.

View File

@ -38,11 +38,11 @@ type WorkflowSpec struct {
// Pipeline is the model of pipeline
type Pipeline struct {
BaseModel
Spec WorkflowSpec
Name string `json:"name"`
Project string `json:"project"`
Alias string `json:"alias"`
Description string `json:"description"`
Spec WorkflowSpec `gorm:"serializer:json"`
Name string `json:"name" gorm:"primaryKey"`
Project string `json:"project" gorm:"primaryKey"`
Alias string `json:"alias"`
Description string `json:"description"`
}
// PrimaryKey return custom primary key
@ -81,9 +81,9 @@ type Value struct {
// PipelineContext is pipeline's context groups
type PipelineContext struct {
BaseModel
PipelineName string `json:"pipelineName"`
ProjectName string `json:"projectName"`
Contexts map[string][]Value `json:"contexts"`
PipelineName string `json:"pipelineName" gorm:"primaryKey"`
ProjectName string `json:"projectName" gorm:"primaryKey"`
Contexts map[string][]Value `json:"contexts" gorm:"serializer:json"`
}
// TableName return custom table name

View File

@ -23,10 +23,10 @@ func init() {
// PluginSetting save the setting data of the plugin
type PluginSetting struct {
BaseModel
ID string `json:"id"`
ID string `json:"id" gorm:"primaryKey"`
Enabled bool `json:"enabled"`
JSONData map[string]interface{} `json:"jsonData"`
SecureJSONData map[string]interface{} `json:"secureJsonData"`
JSONData map[string]interface{} `json:"jsonData" gorm:"serializer:json"`
SecureJSONData map[string]interface{} `json:"secureJsonData" gorm:"serializer:json"`
}
// PrimaryKey return custom primary key

View File

@ -23,7 +23,7 @@ func init() {
// Project basic model
type Project struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Owner string `json:"owner"`
Description string `json:"description,omitempty"`

View File

@ -33,12 +33,12 @@ const (
type SystemInfo struct {
BaseModel
SignedKey string `json:"signedKey"`
InstallID string `json:"installID"`
InstallID string `json:"installID" gorm:"primaryKey"`
EnableCollection bool `json:"enableCollection"`
StatisticInfo StatisticInfo `json:"statisticInfo,omitempty"`
StatisticInfo StatisticInfo `json:"statisticInfo,omitempty" gorm:"serializer:json"`
LoginType string `json:"loginType"`
DexUserDefaultProjects []ProjectRef `json:"projects"`
DexUserDefaultPlatformRoles []string `json:"dexUserDefaultPlatformRoles"`
DexUserDefaultProjects []ProjectRef `json:"projects" gorm:"serializer:json"`
DexUserDefaultPlatformRoles []string `json:"dexUserDefaultPlatformRoles" gorm:"serializer:json"`
}
// ProjectRef set the project name and roles

View File

@ -24,12 +24,12 @@ func init() {
// It includes kubernetes clusters or cloud service providers
type Target struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias,omitempty"`
Project string `json:"project"`
Description string `json:"description,omitempty"`
Cluster *ClusterTarget `json:"cluster,omitempty"`
Variable map[string]interface{} `json:"variable,omitempty"`
Cluster *ClusterTarget `json:"cluster,omitempty" gorm:"serializer:json"`
Variable map[string]interface{} `json:"variable,omitempty" gorm:"serializer:json"`
}
// TableName return custom table name

View File

@ -40,14 +40,14 @@ const RoleAdmin = "admin"
// User is the model of user
type User struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Email string `json:"email"`
Alias string `json:"alias,omitempty"`
Password string `json:"password,omitempty"`
Disabled bool `json:"disabled"`
LastLoginTime time.Time `json:"lastLoginTime,omitempty"`
LastLoginTime time.Time `json:"lastLoginTime,omitempty" gorm:"default:'2020-01-01'"`
// UserRoles binding the platform level roles
UserRoles []string `json:"userRoles"`
UserRoles []string `json:"userRoles" gorm:"serializer:json"`
DexSub string `json:"dexSub,omitempty"`
}
@ -94,10 +94,10 @@ func (u *User) IsAdmin() bool {
// ProjectUser is the model of user in project
type ProjectUser struct {
BaseModel
Username string `json:"username"`
ProjectName string `json:"projectName"`
Username string `json:"username" gorm:"primaryKey"`
ProjectName string `json:"projectName" gorm:"primaryKey"`
// UserRoles binding the project level roles
UserRoles []string `json:"userRoles"`
UserRoles []string `json:"userRoles" gorm:"serializer:json"`
}
// TableName return custom table name
@ -137,24 +137,24 @@ type CustomClaims struct {
// Role is a model for a new RBAC mode.
type Role struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Project string `json:"project,omitempty"`
Permissions []string `json:"permissions"`
Permissions []string `json:"permissions" gorm:"serializer:json"`
}
// Permission is a model for a new RBAC mode.
type Permission struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Project string `json:"project,omitempty"`
Resources []string `json:"resources"`
Actions []string `json:"actions"`
Project string `json:"project,omitempty" gorm:"primaryKey"`
Resources []string `json:"resources" gorm:"serializer:json"`
Actions []string `json:"actions" gorm:"serializer:json"`
// Effect option values: Allow,Deny
Effect string `json:"effect"`
Principal *Principal `json:"principal,omitempty"`
Condition *Condition `json:"condition,omitempty"`
Principal *Principal `json:"principal,omitempty" gorm:"serializer:json"`
Condition *Condition `json:"condition,omitempty" gorm:"serializer:json"`
}
// Principal is a model for a new RBAC mode.
@ -234,14 +234,14 @@ func (p *Permission) Index() map[string]interface{} {
// PermissionTemplate is a model for a new RBAC mode.
type PermissionTemplate struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
// Scope options: project or platform
Scope string `json:"scope"`
Resources []string `json:"resources"`
Actions []string `json:"actions"`
Resources []string `json:"resources" gorm:"serializer:json"`
Actions []string `json:"actions" gorm:"serializer:json"`
Effect string `json:"effect"`
Condition *Condition `json:"condition,omitempty"`
Condition *Condition `json:"condition,omitempty" gorm:"serializer:json"`
}
// TableName return custom table name

View File

@ -37,15 +37,15 @@ const UnFinished = "false"
// Workflow application delivery database model
type Workflow struct {
BaseModel
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Alias string `json:"alias"`
Description string `json:"description"`
// Workflow used by the default
Default *bool `json:"default"`
AppPrimaryKey string `json:"appPrimaryKey"`
AppPrimaryKey string `json:"appPrimaryKey" gorm:"primaryKey"`
EnvName string `json:"envName"`
Mode workflowv1alpha1.WorkflowExecuteMode `json:"mode,omitempty"`
Steps []WorkflowStep `json:"steps,omitempty"`
Mode workflowv1alpha1.WorkflowExecuteMode `json:"mode,omitempty" gorm:"serializer:json"`
Steps []WorkflowStep `json:"steps,omitempty" gorm:"serializer:json"`
}
// WorkflowStep defines how to execute a workflow step.
@ -114,16 +114,16 @@ type WorkflowRecord struct {
AppPrimaryKey string `json:"appPrimaryKey"`
// RevisionPrimaryKey: should be assigned the version(PublishVersion)
RevisionPrimaryKey string `json:"revisionPrimaryKey"`
Name string `json:"name"`
Name string `json:"name" gorm:"primaryKey"`
Namespace string `json:"namespace"`
StartTime time.Time `json:"startTime,omitempty"`
EndTime time.Time `json:"endTime,omitempty"`
StartTime time.Time `json:"startTime,omitempty" gorm:"default:'2020-01-01'"`
EndTime time.Time `json:"endTime,omitempty" gorm:"default:'2020-01-01'"`
Finished string `json:"finished"`
Steps []WorkflowStepStatus `json:"steps,omitempty"`
Steps []WorkflowStepStatus `json:"steps,omitempty" gorm:"serializer:json"`
Status string `json:"status"`
Message string `json:"message"`
Mode string `json:"mode"`
ContextValue map[string]string `json:"contextValue,omitempty"`
ContextValue map[string]string `json:"contextValue,omitempty" gorm:"serializer:json"`
}
// WorkflowStepStatus is the workflow step status database model

View File

@ -63,10 +63,7 @@ func CreateEnv(ctx context.Context, kubeClient client.Client, ds datastore.DataS
klog.Errorf("update namespace label failure %s", err.Error())
return bcode.ErrEnvNamespaceFail
}
if err = ds.Add(ctx, env); err != nil {
return err
}
return nil
return ds.Add(ctx, env)
}
// GetEnv get the environment

View File

@ -44,7 +44,7 @@ func CreateTargetNamespace(ctx context.Context, k8sClient client.Client, cluster
}
// DeleteTargetNamespace delete the namespace of the target
func DeleteTargetNamespace(ctx context.Context, k8sClient client.Client, clusterName, namespace, targetName string) error {
func DeleteTargetNamespace(ctx context.Context, k8sClient client.Client, clusterName, namespace string) error {
err := utils.UpdateNamespace(multicluster.ContextWithClusterName(ctx, clusterName), k8sClient, namespace,
utils.MergeOverrideLabels(map[string]string{
oam.LabelRuntimeNamespaceUsage: "",

View File

@ -44,7 +44,7 @@ import (
"github.com/oam-dev/kubevela/pkg/appfile/dryrun"
"github.com/oam-dev/kubevela/pkg/oam"
pkgUtils "github.com/oam-dev/kubevela/pkg/utils"
"github.com/oam-dev/kubevela/pkg/utils/app"
appUtil "github.com/oam-dev/kubevela/pkg/utils/app"
"github.com/oam-dev/kubevela/pkg/utils/apply"
commonutil "github.com/oam-dev/kubevela/pkg/utils/common"
@ -389,8 +389,8 @@ func (c *applicationServiceImpl) GetApplicationCR(ctx context.Context, appModel
return apps, nil
}
// PublishApplicationTemplate publish app template
func (c *applicationServiceImpl) PublishApplicationTemplate(ctx context.Context, app *model.Application) (*apisv1.ApplicationTemplateBase, error) {
// PublishApplicationTemplate publish appUtil template
func (c *applicationServiceImpl) PublishApplicationTemplate(_ context.Context, _ *model.Application) (*apisv1.ApplicationTemplateBase, error) {
// TODO:
return nil, nil
}
@ -404,7 +404,7 @@ func (c *applicationServiceImpl) CreateApplication(ctx context.Context, req apis
Icon: req.Icon,
Labels: req.Labels,
}
// check app name.
// check appUtil name.
exist, err := c.Store.IsExist(ctx, &application)
if err != nil {
klog.Errorf("check application name is exist failure %s", err.Error())
@ -450,7 +450,7 @@ func (c *applicationServiceImpl) CreateApplication(ctx context.Context, req apis
}
return nil, err
}
// render app base info.
// render appUtil base info.
base := assembler.ConvertAppModelToBase(&application, []*apisv1.ProjectBase{project})
return base, nil
}
@ -499,7 +499,7 @@ func (c *applicationServiceImpl) DeleteApplicationTrigger(ctx context.Context, a
if errors.Is(err, datastore.ErrRecordNotExist) {
return bcode.ErrApplicationTriggerNotExist
}
klog.Warningf("delete app trigger failure %s", err.Error())
klog.Warningf("delete appUtil trigger failure %s", err.Error())
return err
}
return nil
@ -515,7 +515,7 @@ func (c *applicationServiceImpl) UpdateApplicationTrigger(ctx context.Context, a
if errors.Is(err, datastore.ErrRecordNotExist) {
return nil, bcode.ErrApplicationTriggerNotExist
}
klog.Warningf("get app trigger failure %s", err.Error())
klog.Warningf("get appUtil trigger failure %s", err.Error())
return nil, err
}
// checking the workflow
@ -655,7 +655,7 @@ func (c *applicationServiceImpl) ListRecords(ctx context.Context, appName string
return resp, nil
}
func (c *applicationServiceImpl) ListComponents(ctx context.Context, app *model.Application, op apisv1.ListApplicationComponentOptions) ([]*apisv1.ComponentBase, error) {
func (c *applicationServiceImpl) ListComponents(ctx context.Context, app *model.Application, _ apisv1.ListApplicationComponentOptions) ([]*apisv1.ComponentBase, error) {
var component = model.ApplicationComponent{
AppPrimaryKey: app.PrimaryKey(),
}
@ -681,7 +681,7 @@ func (c *applicationServiceImpl) ListComponents(ctx context.Context, app *model.
return list, nil
}
// DetailComponent detail app component
// DetailComponent detail appUtil component
func (c *applicationServiceImpl) DetailComponent(ctx context.Context, app *model.Application, compName string) (*apisv1.DetailComponentResponse, error) {
var component = model.ApplicationComponent{
AppPrimaryKey: app.PrimaryKey(),
@ -716,7 +716,7 @@ func (c *applicationServiceImpl) ListPolicies(ctx context.Context, app *model.Ap
return list, nil
}
// DetailPolicy detail app policy
// DetailPolicy detail appUtil policy
func (c *applicationServiceImpl) DetailPolicy(ctx context.Context, app *model.Application, policyName string) (*apisv1.DetailPolicyResponse, error) {
var policy = model.ApplicationPolicy{
AppPrimaryKey: app.PrimaryKey(),
@ -736,7 +736,7 @@ func (c *applicationServiceImpl) DetailPolicy(ctx context.Context, app *model.Ap
}, nil
}
// Deploy deploys app to cluster
// Deploy deploys appUtil to cluster
// means to render oam application config and apply to cluster.
// An event record is generated for each deploy.
func (c *applicationServiceImpl) Deploy(ctx context.Context, app *model.Application, req apisv1.ApplicationDeployRequest) (*apisv1.ApplicationDeployResponse, error) {
@ -770,7 +770,7 @@ func (c *applicationServiceImpl) Deploy(ctx context.Context, app *model.Applicat
list, err := c.Store.List(ctx, &lastVersion, &datastore.ListOptions{
PageSize: 1, Page: 1, SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}}})
if err != nil && !errors.Is(err, datastore.ErrRecordNotExist) {
klog.Errorf("query app latest revision failure %s", err.Error())
klog.Errorf("query appUtil latest revision failure %s", err.Error())
return nil, bcode.ErrDeployConflict
}
if len(list) > 0 {
@ -788,7 +788,7 @@ func (c *applicationServiceImpl) Deploy(ctx context.Context, app *model.Applicat
status = revision.Status
}
if status != model.RevisionStatusComplete && status != model.RevisionStatusTerminated && status != model.RevisionStatusFail {
klog.Warningf("last app revision can not complete %s/%s,the current status is %s", list[0].(*model.ApplicationRevision).AppPrimaryKey, list[0].(*model.ApplicationRevision).Version, status)
klog.Warningf("last appUtil revision can not complete %s/%s,the current status is %s", list[0].(*model.ApplicationRevision).AppPrimaryKey, list[0].(*model.ApplicationRevision).Version, status)
return nil, bcode.ErrDeployConflict
}
}
@ -830,7 +830,7 @@ func (c *applicationServiceImpl) Deploy(ctx context.Context, app *model.Applicat
klog.Warningf("update deploy event failure %s", err.Error())
}
klog.Errorf("deploy app %s failure %s", app.PrimaryKey(), err.Error())
klog.Errorf("deploy appUtil %s failure %s", app.PrimaryKey(), err.Error())
return nil, bcode.ErrDeployApplyFail
}
@ -840,10 +840,10 @@ func (c *applicationServiceImpl) Deploy(ctx context.Context, app *model.Applicat
klog.Warningf("create workflow record failure %s", err.Error())
}
// step6: update app revision status
// step6: update appUtil revision status
appRevision.Status = model.RevisionStatusRunning
if err := c.Store.Put(ctx, appRevision); err != nil {
klog.Warningf("update app revision failure %s", err.Error())
klog.Warningf("update appUtil revision failure %s", err.Error())
}
// step7: change the source of trust
@ -852,7 +852,7 @@ func (c *applicationServiceImpl) Deploy(ctx context.Context, app *model.Applicat
}
app.Labels[velatypes.LabelSourceOfTruth] = velatypes.FromUX
if err := c.Store.Put(ctx, app); err != nil {
klog.Warningf("failed to update app %s", err.Error())
klog.Warningf("failed to update appUtil %s", err.Error())
}
res := &apisv1.ApplicationDeployResponse{
@ -906,7 +906,7 @@ func (c *applicationServiceImpl) renderOAMApplication(ctx context.Context, appMo
if deployAppName == "" {
deployAppName = appModel.Name
}
var app = &v1beta1.Application{
var application = &v1beta1.Application{
TypeMeta: metav1.TypeMeta{
Kind: "Application",
APIVersion: "core.oam.dev/v1beta1",
@ -926,8 +926,8 @@ func (c *applicationServiceImpl) renderOAMApplication(ctx context.Context, appMo
}
for key, value := range appModel.Annotations {
if _, exists := app.ObjectMeta.Annotations[key]; !exists {
app.ObjectMeta.Annotations[key] = value
if _, exists := application.ObjectMeta.Annotations[key]; !exists {
application.ObjectMeta.Annotations[key] = value
}
}
@ -936,7 +936,7 @@ func (c *applicationServiceImpl) renderOAMApplication(ctx context.Context, appMo
Name: appModel.Name,
Namespace: env.Namespace,
}, originalApp); err == nil {
app.ResourceVersion = originalApp.ResourceVersion
application.ResourceVersion = originalApp.ResourceVersion
}
var component = model.ApplicationComponent{
@ -987,7 +987,7 @@ func (c *applicationServiceImpl) renderOAMApplication(ctx context.Context, appMo
if component.Properties != nil {
bc.Properties = component.Properties.RawExtension()
}
app.Spec.Components = append(app.Spec.Components, bc)
application.Spec.Components = append(application.Spec.Components, bc)
}
for _, policy := range policies {
@ -998,10 +998,10 @@ func (c *applicationServiceImpl) renderOAMApplication(ctx context.Context, appMo
if policy.Properties != nil {
appPolicy.Properties = policy.Properties.RawExtension()
}
app.Spec.Policies = append(app.Spec.Policies, appPolicy)
application.Spec.Policies = append(application.Spec.Policies, appPolicy)
}
if workflow != nil {
app.Annotations[oam.AnnotationWorkflowName] = workflow.Name
application.Annotations[oam.AnnotationWorkflowName] = workflow.Name
var steps []workflowv1alpha1.WorkflowStep
for _, step := range workflow.Steps {
workflowStep := workflowv1alpha1.WorkflowStep{
@ -1013,12 +1013,12 @@ func (c *applicationServiceImpl) renderOAMApplication(ctx context.Context, appMo
}
steps = append(steps, workflowStep)
}
app.Spec.Workflow = &v1beta1.Workflow{
application.Spec.Workflow = &v1beta1.Workflow{
Steps: steps,
Mode: &workflow.Mode,
}
}
return app, nil
return application, nil
}
func convertWorkflowModel2WorkflowSpec(step model.WorkflowStepBase) workflowv1alpha1.WorkflowStepBase {
@ -1089,32 +1089,32 @@ func (c *applicationServiceImpl) DeleteApplication(ctx context.Context, app *mod
for _, component := range components {
err := c.Store.Delete(ctx, &model.ApplicationComponent{AppPrimaryKey: app.PrimaryKey(), Name: component.Name})
if err != nil && !errors.Is(err, datastore.ErrRecordNotExist) {
klog.Errorf("delete component %s in app %s failure %s", component.Name, app.Name, err.Error())
klog.Errorf("delete component %s in appUtil %s failure %s", component.Name, app.Name, err.Error())
}
}
for _, policy := range policies {
err := c.Store.Delete(ctx, &model.ApplicationPolicy{AppPrimaryKey: app.PrimaryKey(), Name: policy.Name})
if err != nil && errors.Is(err, datastore.ErrRecordNotExist) {
klog.Errorf("delete policy %s in app %s failure %s", policy.Name, app.Name, err.Error())
klog.Errorf("delete policy %s in appUtil %s failure %s", policy.Name, app.Name, err.Error())
}
}
for _, entity := range revisions {
revision := entity.(*model.ApplicationRevision)
if err := c.Store.Delete(ctx, &model.ApplicationRevision{AppPrimaryKey: app.PrimaryKey(), Version: revision.Version}); err != nil {
klog.Errorf("delete revision %s in app %s failure %s", revision.Version, app.Name, err.Error())
klog.Errorf("delete revision %s in appUtil %s failure %s", revision.Version, app.Name, err.Error())
}
}
for _, trigger := range triggers {
if err := c.Store.Delete(ctx, &model.ApplicationTrigger{AppPrimaryKey: app.PrimaryKey(), Name: trigger.Name, Token: trigger.Token}); err != nil {
klog.Errorf("delete trigger %s in app %s failure %s", trigger.Name, app.Name, err.Error())
klog.Errorf("delete trigger %s in appUtil %s failure %s", trigger.Name, app.Name, err.Error())
}
}
if err := c.EnvBindingService.BatchDeleteEnvBinding(ctx, app); err != nil {
klog.Errorf("delete envbindings in app %s failure %s", app.Name, err.Error())
klog.Errorf("delete envbindings in appUtil %s failure %s", app.Name, err.Error())
}
return c.Store.Delete(ctx, app)
@ -1135,7 +1135,7 @@ func (c *applicationServiceImpl) GetApplicationComponent(ctx context.Context, ap
return &component, nil
}
func (c *applicationServiceImpl) UpdateComponent(ctx context.Context, app *model.Application, component *model.ApplicationComponent, req apisv1.UpdateApplicationComponentRequest) (*apisv1.ComponentBase, error) {
func (c *applicationServiceImpl) UpdateComponent(ctx context.Context, _ *model.Application, component *model.ApplicationComponent, req apisv1.UpdateApplicationComponentRequest) (*apisv1.ComponentBase, error) {
if req.Alias != nil {
component.Alias = *req.Alias
}
@ -1223,7 +1223,7 @@ func (c *applicationServiceImpl) createComponent(ctx context.Context, app *model
if errors.Is(err, datastore.ErrRecordExist) {
return nil, bcode.ErrApplicationComponentExist
}
klog.Warningf("add component for app %s failure %s", pkgUtils.Sanitize(app.PrimaryKey()), err.Error())
klog.Warningf("add component for appUtil %s failure %s", pkgUtils.Sanitize(app.PrimaryKey()), err.Error())
return nil, err
}
// update the env workflow, the automatically generated workflow is determined by the component type.
@ -1264,7 +1264,7 @@ func (c *applicationServiceImpl) DeleteComponent(ctx context.Context, app *model
if errors.Is(err, datastore.ErrRecordNotExist) {
return bcode.ErrApplicationComponentNotExist
}
klog.Warningf("delete app component %s failure %s", app.PrimaryKey(), err.Error())
klog.Warningf("delete appUtil component %s failure %s", app.PrimaryKey(), err.Error())
return err
}
if err := repository.UpdateAppEnvWorkflow(ctx, c.KubeClient, c.Store, app); err != nil {
@ -1293,7 +1293,7 @@ func (c *applicationServiceImpl) CreatePolicy(ctx context.Context, app *model.Ap
if errors.Is(err, datastore.ErrRecordExist) {
return nil, bcode.ErrApplicationPolicyExist
}
klog.Warningf("add policy for app %s failure %s", app.PrimaryKey(), err.Error())
klog.Warningf("add policy for appUtil %s failure %s", app.PrimaryKey(), err.Error())
return nil, err
}
if err = c.handlePolicyBindingWorkflowStep(ctx, app, createPolicy.Name, createPolicy.WorkflowPolicyBindings); err != nil {
@ -1320,7 +1320,7 @@ func (c *applicationServiceImpl) DeletePolicy(ctx context.Context, app *model.Ap
if errors.Is(err, datastore.ErrRecordNotExist) {
return bcode.ErrApplicationPolicyNotExist
}
klog.Warningf("delete app policy %s failure %s", app.PrimaryKey(), err.Error())
klog.Warningf("delete appUtil policy %s failure %s", app.PrimaryKey(), err.Error())
return err
}
return c.handlePolicyBindingWorkflowStep(ctx, app, policyName, nil)
@ -1336,7 +1336,7 @@ func (c *applicationServiceImpl) UpdatePolicy(ctx context.Context, app *model.Ap
if errors.Is(err, datastore.ErrRecordNotExist) {
return nil, bcode.ErrApplicationPolicyNotExist
}
klog.Warningf("update app policy %s failure %s", app.PrimaryKey(), err.Error())
klog.Warningf("update appUtil policy %s failure %s", app.PrimaryKey(), err.Error())
return nil, err
}
policy.Type = policyUpdate.Type
@ -1397,10 +1397,7 @@ func (c *applicationServiceImpl) DeleteApplicationTrait(ctx context.Context, app
for i, trait := range comp.Traits {
if trait.Type == traitType {
comp.Traits = append(comp.Traits[:i], comp.Traits[i+1:]...)
if err := c.Store.Put(ctx, &comp); err != nil {
return err
}
return nil
return c.Store.Put(ctx, &comp)
}
}
return bcode.ErrTraitNotExist
@ -1501,7 +1498,7 @@ func (c *applicationServiceImpl) Statistics(ctx context.Context, app *model.Appl
var targetMap = make(map[string]int)
envbinding, err := c.EnvBindingService.GetEnvBindings(ctx, app)
if err != nil {
klog.Errorf("query app envbinding failure %s", err.Error())
klog.Errorf("query appUtil envbinding failure %s", err.Error())
}
for _, env := range envbinding {
for _, target := range env.TargetNames {
@ -1558,7 +1555,7 @@ func (c *applicationServiceImpl) CompareApp(ctx context.Context, appModel *model
}
base, envNameByRevision, err = c.getAppModelFromRevision(ctx, appModel.Name, revision)
if err != nil {
klog.Errorf("failed to get the app model from the revision %s", err.Error())
klog.Errorf("failed to get the appUtil model from the revision %s", err.Error())
break
}
}
@ -1611,7 +1608,7 @@ func (c *applicationServiceImpl) CompareApp(ctx context.Context, appModel *model
args.SetClient(c.KubeClient)
diffResult, buff, err := compare(ctx, args, compareTarget, base)
if err != nil {
klog.Errorf("fail to compare the app %s", err.Error())
klog.Errorf("fail to compare the appUtil %s", err.Error())
compareResponse.IsDiff = false
return compareResponse, nil
}
@ -1620,7 +1617,7 @@ func (c *applicationServiceImpl) CompareApp(ctx context.Context, appModel *model
return compareResponse, nil
}
// ResetAppToLatestRevision reset app's component to last revision
// ResetAppToLatestRevision reset appUtil's component to last revision
func (c *applicationServiceImpl) ResetAppToLatestRevision(ctx context.Context, appName string) (*apisv1.AppResetResponse, error) {
targetApp, _, err := c.getAppModelFromRevision(ctx, appName, "")
if err != nil {
@ -1672,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)
}
@ -1716,7 +1714,7 @@ func (c *applicationServiceImpl) resetApp(ctx context.Context, targetApp *v1beta
readyToUpdate, readyToDelete, readyToAdd := utils.ThreeWaySliceCompare(originCompNames, targetCompNames)
// delete new app's components
// delete new appUtil's components
for _, compName := range readyToDelete {
var component = model.ApplicationComponent{
AppPrimaryKey: appPrimaryKey,
@ -1726,12 +1724,12 @@ func (c *applicationServiceImpl) resetApp(ctx context.Context, targetApp *v1beta
if errors.Is(err, datastore.ErrRecordNotExist) {
continue
}
klog.Warningf("delete app %s comp %s failure %s", appPrimaryKey, compName, err.Error())
klog.Warningf("delete appUtil %s comp %s failure %s", appPrimaryKey, compName, err.Error())
}
}
for _, comp := range targetComps {
// add or update new app's components from old app
// add or update new appUtil's components from old appUtil
if slices.Contains(readyToAdd, comp.Name) || slices.Contains(readyToUpdate, comp.Name) {
compModel, err := convert.FromCRComponent(appPrimaryKey, comp)
if err != nil {
@ -1746,11 +1744,11 @@ func (c *applicationServiceImpl) resetApp(ctx context.Context, targetApp *v1beta
if errors.Is(err, datastore.ErrRecordExist) {
err := c.Store.Put(ctx, &compModel)
if err != nil {
klog.Warningf("update comp %s for app %s failure %s", comp.Name, pkgUtils.Sanitize(appPrimaryKey), err.Error())
klog.Warningf("update comp %s for appUtil %s failure %s", comp.Name, pkgUtils.Sanitize(appPrimaryKey), err.Error())
}
return &apisv1.AppResetResponse{IsReset: true}, err
}
klog.Warningf("add comp %s for app %s failure %s", comp.Name, pkgUtils.Sanitize(appPrimaryKey), err.Error())
klog.Warningf("add comp %s for appUtil %s failure %s", comp.Name, pkgUtils.Sanitize(appPrimaryKey), err.Error())
return &apisv1.AppResetResponse{}, err
}
}
@ -1782,12 +1780,12 @@ func (c *applicationServiceImpl) RollbackWithRevision(ctx context.Context, appli
if err := c.Store.Put(ctx, &revision); err != nil {
return nil, err
}
_, appCR, err := app.RollbackApplicationWithRevision(context.WithValue(ctx, &app.RevisionContextKey, utils.WithProject(ctx, "")), c.KubeClient, appCR.Name, appCR.Namespace, revision.RevisionCRName, publishVersion)
_, appCR, err := appUtil.RollbackApplicationWithRevision(context.WithValue(ctx, &appUtil.RevisionContextKey, utils.WithProject(ctx, "")), c.KubeClient, appCR.Name, appCR.Namespace, revision.RevisionCRName, publishVersion)
if err != nil {
switch {
case errors.Is(err, app.ErrNotMatchRevision):
case errors.Is(err, appUtil.ErrNotMatchRevision):
noRevision = true
case errors.Is(err, app.ErrRevisionNotChange):
case errors.Is(err, appUtil.ErrRevisionNotChange):
return nil, bcode.ErrApplicationRevisionConflict
default:
revision.RevisionCRName = revisionCRName
@ -1815,7 +1813,7 @@ func (c *applicationServiceImpl) RollbackWithRevision(ctx context.Context, appli
}
err = c.Apply.Apply(ctx, rollBackApp)
if err != nil {
klog.Errorf("rollback the app %s failure %s", application.PrimaryKey(), err.Error())
klog.Errorf("rollback the appUtil %s failure %s", application.PrimaryKey(), err.Error())
return nil, err
}
rollbackApplication = rollBackApp
@ -1845,7 +1843,7 @@ func dryRunApplication(ctx context.Context, c commonutil.Args, app *v1beta1.Appl
}
result, err := yaml.Marshal(app)
if err != nil {
return buff, fmt.Errorf("marshal app: %w", err)
return buff, fmt.Errorf("marshal appUtil: %w", err)
}
buff.Write(result)
@ -1877,7 +1875,7 @@ func dryRunApplication(ctx context.Context, c commonutil.Args, app *v1beta1.Appl
return buff, nil
}
// ignoreSomeParams ignore some parameters before comparing the app changes.
// ignoreSomeParams ignore some parameters before comparing the appUtil changes.
// ignore the workflow spec
func ignoreSomeParams(o *v1beta1.Application) {
var defaultApplication = v1beta1.Application{}

View File

@ -211,7 +211,7 @@ func (a *authenticationServiceImpl) generateJWTToken(username, grantType string,
return token.SignedString([]byte(signedKey))
}
func (a *authenticationServiceImpl) RefreshToken(ctx context.Context, refreshToken string) (*apisv1.RefreshTokenResponse, error) {
func (a *authenticationServiceImpl) RefreshToken(_ context.Context, refreshToken string) (*apisv1.RefreshTokenResponse, error) {
claim, err := ParseToken(refreshToken)
if err != nil {
if errors.Is(err, bcode.ErrTokenExpired) {
@ -235,7 +235,7 @@ func (a *authenticationServiceImpl) RefreshToken(ctx context.Context, refreshTok
// 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 {

View File

@ -135,11 +135,11 @@ func (c *cloudShellServiceImpl) Prepare(ctx context.Context) (*apisv1.CloudShell
if err := c.prepareKubeConfig(ctx); err != nil {
return res, fmt.Errorf("failed to prepare the kubeconfig for the user: %w", err)
}
new, err := c.newCloudShell(ctx)
newCS, err := c.newCloudShell(ctx)
if err != nil {
return res, err
}
if err := c.KubeClient.Create(ctx, new); err != nil {
if err := c.KubeClient.Create(ctx, newCS); err != nil {
if meta.IsNoMatchError(err) {
return nil, bcode.ErrCloudShellAddonNotEnabled
}
@ -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"})

View File

@ -492,7 +492,7 @@ func (c *clusterServiceImpl) getClusterResourceInfoFromK8s(ctx context.Context,
return clusterResourceInfo, nil
}
func (c *clusterServiceImpl) ListCloudClusters(ctx context.Context, provider string, req apis.AccessKeyRequest, pageNumber int, pageSize int) (*apis.ListCloudClusterResponse, error) {
func (c *clusterServiceImpl) ListCloudClusters(_ context.Context, provider string, req apis.AccessKeyRequest, pageNumber int, pageSize int) (*apis.ListCloudClusterResponse, error) {
p, err := cloudprovider.GetClusterProvider(provider, req.AccessKeyID, req.AccessKeySecret, c.K8sClient)
if err != nil {
klog.Errorf("failed to get cluster provider: %s", err.Error())

View File

@ -48,6 +48,17 @@ type ConfigService interface {
ListConfigDistributions(ctx context.Context, project string) ([]*config.Distribution, error)
}
var (
// GlobalConfigNamespace is the namespace for global config, global config should be seen by all projects
GlobalConfigNamespace = types.DefaultKubeVelaNS
// NoProject is the project name to pass when query global config
NoProject = ""
)
func isGlobal(project string) bool {
return project == NoProject
}
// NewConfigService returns a config use case
func NewConfigService() ConfigService {
return &configServiceImpl{}
@ -62,8 +73,8 @@ type configServiceImpl struct {
// ListTemplates list the config templates
func (u *configServiceImpl) ListTemplates(ctx context.Context, project, scope string) ([]*apis.ConfigTemplate, error) {
listCtx := utils.WithProject(ctx, "")
queryTemplates, err := u.Factory.ListTemplates(listCtx, types.DefaultKubeVelaNS, scope)
listCtx := utils.WithProject(ctx, NoProject)
queryTemplates, err := u.Factory.ListTemplates(listCtx, GlobalConfigNamespace, scope)
if err != nil {
return nil, err
}
@ -99,9 +110,9 @@ func (u *configServiceImpl) ListTemplates(ctx context.Context, project, scope st
// GetTemplate detail a template
func (u *configServiceImpl) GetTemplate(ctx context.Context, tem config.NamespacedName) (*apis.ConfigTemplateDetail, error) {
if tem.Namespace == "" {
tem.Namespace = types.DefaultKubeVelaNS
tem.Namespace = GlobalConfigNamespace
}
getCtx := utils.WithProject(ctx, "")
getCtx := utils.WithProject(ctx, NoProject)
template, err := u.Factory.LoadTemplate(getCtx, tem.Name, tem.Namespace)
if err != nil {
if errors.Is(err, config.ErrTemplateNotFound) {
@ -128,8 +139,8 @@ func (u *configServiceImpl) GetTemplate(ctx context.Context, tem config.Namespac
}
func (u *configServiceImpl) CreateConfig(ctx context.Context, project string, req apis.CreateConfigRequest) (*apis.Config, error) {
ns := types.DefaultKubeVelaNS
if project != "" {
ns := GlobalConfigNamespace
if !isGlobal(project) {
pro, err := u.ProjectService.GetProject(ctx, project)
if err != nil {
return nil, err
@ -138,7 +149,7 @@ func (u *configServiceImpl) CreateConfig(ctx context.Context, project string, re
}
exist, err := u.Factory.IsExist(ctx, ns, req.Name)
if err != nil {
klog.Errorf("check config name is exist failure %s", err.Error())
klog.Errorf("check config name exist fail %s", err.Error())
return nil, bcode.ErrConfigExist
}
if exist {
@ -149,7 +160,7 @@ func (u *configServiceImpl) CreateConfig(ctx context.Context, project string, re
return nil, err
}
if req.Template.Namespace == "" {
req.Template.Namespace = types.DefaultKubeVelaNS
req.Template.Namespace = GlobalConfigNamespace
}
configItem, err := u.Factory.ParseConfig(ctx, config.NamespacedName(req.Template), config.Metadata{
NamespacedName: config.NamespacedName{Name: req.Name, Namespace: ns},
@ -169,8 +180,8 @@ func (u *configServiceImpl) CreateConfig(ctx context.Context, project string, re
}
func (u *configServiceImpl) UpdateConfig(ctx context.Context, project string, name string, req apis.UpdateConfigRequest) (*apis.Config, error) {
ns := types.DefaultKubeVelaNS
if project != "" {
ns := GlobalConfigNamespace
if !isGlobal(project) {
pro, err := u.ProjectService.GetProject(ctx, project)
if err != nil {
return nil, err
@ -217,8 +228,8 @@ func (u *configServiceImpl) ListConfigs(ctx context.Context, project string, tem
var list []*apis.Config
scope := ""
var projectNamespace string
listCtx := utils.WithProject(ctx, "")
if project != "" {
listCtx := utils.WithProject(ctx, NoProject)
if !isGlobal(project) {
scope = "project"
pro, err := u.ProjectService.GetProject(ctx, project)
if err != nil {
@ -235,7 +246,7 @@ func (u *configServiceImpl) ListConfigs(ctx context.Context, project string, tem
}
}
configs, err := u.Factory.ListConfigs(listCtx, types.DefaultKubeVelaNS, template, scope, true)
configs, err := u.Factory.ListConfigs(listCtx, GlobalConfigNamespace, template, scope, true)
if err != nil {
return nil, err
}
@ -283,7 +294,7 @@ func (u *configServiceImpl) CreateConfigDistribution(ctx context.Context, projec
})
}
// ListDistributeConfigs list the all distributions
// ListConfigDistributions list the all distributions
func (u *configServiceImpl) ListConfigDistributions(ctx context.Context, project string) ([]*config.Distribution, error) {
pro, err := u.ProjectService.GetProject(ctx, project)
if err != nil {
@ -324,8 +335,8 @@ func convertConfig(project string, config config.Config) *apis.Config {
}
func (u *configServiceImpl) GetConfig(ctx context.Context, project, name string) (*apis.Config, error) {
ns := types.DefaultKubeVelaNS
if project != "" {
ns := GlobalConfigNamespace
if !isGlobal(project) {
pro, err := u.ProjectService.GetProject(ctx, project)
if err != nil {
return nil, err
@ -335,21 +346,25 @@ func (u *configServiceImpl) GetConfig(ctx context.Context, project, name string)
it, err := u.Factory.GetConfig(ctx, ns, name, true)
if err != nil {
if errors.Is(err, config.ErrSensitiveConfig) {
switch {
case errors.Is(err, config.ErrSensitiveConfig):
return nil, bcode.ErrSensitiveConfig
}
if errors.Is(err, config.ErrConfigNotFound) {
case errors.Is(err, config.ErrConfigNotFound):
if !isGlobal(project) {
// Try to get global config if the config is not found in the project scope.
return u.GetConfig(ctx, NoProject, name)
}
return nil, bcode.ErrConfigNotFound
default:
return nil, err
}
return nil, err
}
return convertConfig(project, *it), nil
}
func (u *configServiceImpl) DeleteConfig(ctx context.Context, project, name string) error {
ns := types.DefaultKubeVelaNS
if project != "" {
ns := GlobalConfigNamespace
if !isGlobal(project) {
pro, err := u.ProjectService.GetProject(ctx, project)
if err != nil {
return err

View File

@ -101,6 +101,69 @@ template: {
}
}
`
var (
helmTemplateName = "helm-repository"
helmTemplate = `
import (
"vela/config"
)
metadata: {
name: "helm-repository"
alias: "Helm Repository"
description: "Config information to authenticate helm chart repository"
sensitive: false
scope: "project"
}
template: {
output: {
apiVersion: "v1"
kind: "Secret"
metadata: {
name: context.name
namespace: context.namespace
labels: {
"config.oam.dev/catalog": "velacore-config"
"config.oam.dev/type": "helm-repository"
"config.oam.dev/multi-cluster": "true"
"config.oam.dev/sub-type": "helm"
}
}
type: "Opaque"
stringData: {
url: parameter.url
if parameter.username != _|_ {
username: parameter.username
}
if parameter.password != _|_ {
password: parameter.password
}
}
data: {
if parameter.caFile != _|_ {
caFile: parameter.caFile
}
}
}
// skip the validation here for config.#HelmRepository requires the repository actually exists which can be flaky in unit test
//validation: config.#HelmRepository & {
// $params: parameter
//}
parameter: {
// +usage=The public url of the helm chart repository.
url: string
// +usage=The username of basic auth repo.
username?: string
// +usage=The password of basic auth repo.
password?: string
// +usage=The ca certificate of helm repository. Please encode this data with base64.
caFile?: string
}
}`
)
var _ = Describe("Test config service", func() {
var factory config.Factory
@ -180,9 +243,42 @@ var _ = Describe("Test config service", func() {
Expect(len(list)).To(Equal(0))
})
It("Test detail a config", func() {
_, err := configService.GetConfig(context.TODO(), "", "alibaba-test")
Expect(err).To(Equal(bcode.ErrSensitiveConfig))
Context("Test get config", func() {
It("Simple get", func() {
_, err := configService.GetConfig(context.TODO(), "", "alibaba-test")
Expect(err).To(Equal(bcode.ErrSensitiveConfig))
})
It("Get config in project and fall back to get global config", func() {
By("apply helm template")
tem, err := factory.ParseTemplate(helmTemplateName, []byte(helmTemplate))
Expect(err).To(BeNil())
Expect(factory.CreateOrUpdateConfigTemplate(context.Background(), types.DefaultKubeVelaNS, tem)).To(BeNil())
By("create a project")
_, err = projectService.CreateProject(context.TODO(), v1.CreateProjectRequest{Name: "some-project"})
Expect(err).To(BeNil())
defer func() {
Expect(projectService.DeleteProject(context.Background(), "some-project")).To(BeNil())
}()
By("create a common global config")
_, err = configService.CreateConfig(context.TODO(), NoProject, v1.CreateConfigRequest{
Name: "helm-test",
Template: v1.NamespacedName{
Name: helmTemplateName,
},
Properties: `{"username":"test","password":"test","url":"https://helm.kubevela.com/charts"}`,
})
Expect(err).To(BeNil())
defer func() {
Expect(configService.DeleteConfig(context.Background(), NoProject, "helm-test")).To(BeNil())
}()
By("try to get the config in project, should success")
config, err := configService.GetConfig(context.TODO(), "some-project", "helm-test")
Expect(err).To(BeNil())
Expect(config.Name).To(Equal("helm-test"))
})
})
It("Test delete a config", func() {

View File

@ -496,7 +496,7 @@ func renderUIParameter(key, label string, property *openapi3.SchemaRef, required
parameter.SubParameters = renderDefaultUISchema(property.Value)
}
var ap = property.Value.AdditionalProperties
if ap.Has != nil && *ap.Has && ap.Schema != nil && ap.Schema.Value != nil {
if ap.Schema != nil && ap.Schema.Value != nil {
value := ap.Schema.Value
parameter.SubParameters = renderDefaultUISchema(value)
var enable = true

View File

@ -97,11 +97,7 @@ func (p *envServiceImpl) DeleteEnv(ctx context.Context, envName string) error {
return err
}
if err := managePrivilegesForEnvironment(ctx, p.KubeClient, env, true); err != nil {
return err
}
return nil
return managePrivilegesForEnvironment(ctx, p.KubeClient, env, true)
}
// ListEnvs list envs

View File

@ -175,10 +175,10 @@ func (d defaultHelmImpl) ListChartRepo(ctx context.Context, projectName string)
url, ok := item.Properties["url"].(string)
if ok {
res = append(res, &v1.ChartRepoResponse{URL: url, SecretName: item.Name})
continue
}
}
// Compatible with historical data
if url, ok := item.Secret.Data["url"]; ok {
} else if url, ok := item.Secret.Data["url"]; ok {
// Compatible with historical data
res = append(res, &v1.ChartRepoResponse{URL: string(url), SecretName: item.Name})
}
}

View File

@ -327,11 +327,7 @@ func (p pipelineServiceImpl) DeletePipeline(ctx context.Context, pl apis.Pipelin
klog.Errorf("delete pipeline all context failure: %s", err.Error())
return err
}
if err := p.Store.Delete(ctx, pipeline); err != nil {
return err
}
return nil
return p.Store.Delete(ctx, pipeline)
}
func (p pipelineRunServiceImpl) GetPipelineRunOutput(ctx context.Context, pipelineRun apis.PipelineRun, stepName string) (apis.GetPipelineRunOutputResponse, error) {
@ -700,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
})
@ -910,9 +906,10 @@ func getLastRun(runs []v1alpha1.WorkflowRun) *v1alpha1.WorkflowRun {
last := runs[0]
lastStartTime := last.Status.StartTime.Time
for _, wfr := range runs {
wfr.Status.StartTime.After(lastStartTime)
last = wfr
lastStartTime = wfr.Status.StartTime.Time
if wfr.Status.StartTime.After(lastStartTime) {
last = wfr
lastStartTime = wfr.Status.StartTime.Time
}
}
// We don't need managed fields, save some bandwidth
last.ManagedFields = nil
@ -1277,7 +1274,7 @@ func (p pipelineRunServiceImpl) TerminatePipelineRun(ctx context.Context, meta a
return wfUtils.TerminateWorkflow(ctx, p.KubeClient, &run)
}
func checkPipelineSpec(spec model.WorkflowSpec) error {
func checkPipelineSpec(_ model.WorkflowSpec) error {
return nil
}

View File

@ -217,10 +217,7 @@ func (p *projectServiceImpl) DeleteProject(ctx context.Context, name string) err
return err
}
if err := managePrivilegesForProject(ctx, p.K8sClient, &model.Project{Name: name}, true); err != nil {
return err
}
return nil
return managePrivilegesForProject(ctx, p.K8sClient, &model.Project{Name: name}, true)
}
// CreateProject create project
@ -460,7 +457,7 @@ func (p *projectServiceImpl) UpdateProjectUser(ctx context.Context, projectName
return ConvertProjectUserModel2Base(&projectUser, user), nil
}
func (p *projectServiceImpl) ListTerraformProviders(ctx context.Context, projectName string) ([]*apisv1.TerraformProvider, error) {
func (p *projectServiceImpl) ListTerraformProviders(ctx context.Context, _ string) ([]*apisv1.TerraformProvider, error) {
l := &terraformapi.ProviderList{}
listCtx := apiutils.WithProject(ctx, "")
if err := p.K8sClient.List(listCtx, l, client.InNamespace(types.ProviderNamespace)); err != nil {

View File

@ -912,7 +912,7 @@ func (p *rbacServiceImpl) UpdateRole(ctx context.Context, projectName, roleName
return assembler.ConvertRole2DTO(&role, policies), nil
}
func (p *rbacServiceImpl) ListRole(ctx context.Context, projectName string, page, pageSize int) (*apisv1.ListRolesResponse, error) {
func (p *rbacServiceImpl) ListRole(ctx context.Context, projectName string, _, _ int) (*apisv1.ListRolesResponse, error) {
roles, count, err := repository.ListRoles(ctx, p.Store, projectName, 0, 0)
if err != nil {
return nil, err
@ -945,7 +945,7 @@ func (p *rbacServiceImpl) ListRole(ctx context.Context, projectName string, page
}
// ListPermissionTemplate TODO:
func (p *rbacServiceImpl) ListPermissionTemplate(ctx context.Context, projectName string) ([]apisv1.PermissionTemplateBase, error) {
func (p *rbacServiceImpl) ListPermissionTemplate(_ context.Context, _ string) ([]apisv1.PermissionTemplateBase, error) {
return nil, nil
}
@ -1149,7 +1149,7 @@ func (r *ResourceName) String() string {
strBuilder := &strings.Builder{}
current := r
for current != nil && current.Type != "" {
strBuilder.WriteString(fmt.Sprintf("%s:%s/", current.Type, current.Value))
fmt.Fprintf(strBuilder, "%s:%s/", current.Type, current.Value)
current = current.Next
}
return strings.TrimSuffix(strBuilder.String(), "/")

View File

@ -121,7 +121,7 @@ func (dt *targetServiceImpl) DeleteTarget(ctx context.Context, targetName string
if err != nil {
return err
}
if err = repository.DeleteTargetNamespace(ctx, dt.K8sClient, ddt.Cluster.ClusterName, ddt.Cluster.Namespace, targetName); err != nil {
if err = repository.DeleteTargetNamespace(ctx, dt.K8sClient, ddt.Cluster.ClusterName, ddt.Cluster.Namespace); err != nil {
return err
}
if err = managePrivilegesForTarget(ctx, dt.K8sClient, ddt, true); err != nil {
@ -145,10 +145,10 @@ func (dt *targetServiceImpl) CreateTarget(ctx context.Context, req apisv1.Create
if err := dt.Store.Get(ctx, &project); err != nil {
return nil, bcode.ErrProjectIsNotExist
}
target := convertCreateReqToTargetModel(req)
if req.Cluster == nil {
req.Cluster = &apisv1.ClusterTarget{ClusterName: multicluster.ClusterLocalName, Namespace: req.Name}
}
target := convertCreateReqToTargetModel(req)
createTargetCtx := utils.WithProject(ctx, "")
if err := repository.CreateTargetNamespace(createTargetCtx, dt.K8sClient, req.Cluster.ClusterName, req.Cluster.Namespace, req.Name); err != nil {
return nil, err

View File

@ -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))

View File

@ -196,10 +196,7 @@ func (c *webhookServiceImpl) patchComponentProperties(ctx context.Context, compo
return err
}
component.Properties = prop
if err := c.Store.Put(ctx, component); err != nil {
return err
}
return nil
return c.Store.Put(ctx, component)
}
func (c *customHandlerImpl) handle(ctx context.Context, webhookTrigger *model.ApplicationTrigger, app *model.Application) (interface{}, error) {
@ -213,7 +210,7 @@ func (c *customHandlerImpl) handle(ctx context.Context, webhookTrigger *model.Ap
switch c.req.Action {
case ActionApprove:
if err := c.w.WorkflowService.ResumeRecord(ctx, app, workflow, "", c.req.Step); err != nil {
if err := c.w.WorkflowService.ResumeWorkflow(ctx, app, workflow, c.req.Step); err != nil {
return nil, err
}
record := model.WorkflowRecord{
@ -228,7 +225,7 @@ func (c *customHandlerImpl) handle(ctx context.Context, webhookTrigger *model.Ap
}
return &assembler.ConvertFromRecordModel(records[0].(*model.WorkflowRecord)).WorkflowRecordBase, nil
case ActionTerminate:
if err := c.w.WorkflowService.TerminateRecord(ctx, app, workflow, ""); err != nil {
if err := c.w.WorkflowService.TerminateWorkflow(ctx, app, workflow); err != nil {
return nil, err
}
record := model.WorkflowRecord{

View File

@ -81,8 +81,8 @@ type WorkflowService interface {
ListWorkflowRecords(ctx context.Context, workflow *model.Workflow, page, pageSize int) (*apisv1.ListWorkflowRecordsResponse, error)
DetailWorkflowRecord(ctx context.Context, workflow *model.Workflow, recordName string) (*apisv1.DetailWorkflowRecordResponse, error)
SyncWorkflowRecord(ctx context.Context, appKey, recordName string, app *v1beta1.Application, workflowContext map[string]string) error
ResumeRecord(ctx context.Context, appModel *model.Application, workflow *model.Workflow, recordName, stepName string) error
TerminateRecord(ctx context.Context, appModel *model.Application, workflow *model.Workflow, recordName string) error
ResumeWorkflow(ctx context.Context, appModel *model.Application, workflow *model.Workflow, stepName string) error
TerminateWorkflow(ctx context.Context, appModel *model.Application, workflow *model.Workflow) error
RollbackRecord(ctx context.Context, appModel *model.Application, workflow *model.Workflow, recordName, revisionName string) (*apisv1.WorkflowRecordBase, error)
GetWorkflowRecordLog(ctx context.Context, record *model.WorkflowRecord, step string) (apisv1.GetPipelineRunLogResponse, error)
GetWorkflowRecordOutput(ctx context.Context, workflow *model.Workflow, record *model.WorkflowRecord, stepName string) (apisv1.GetPipelineRunOutputResponse, error)
@ -243,7 +243,7 @@ func (w *workflowServiceImpl) UpdateWorkflow(ctx context.Context, workflow *mode
}
// DetailWorkflow detail workflow
func (w *workflowServiceImpl) DetailWorkflow(ctx context.Context, workflow *model.Workflow) (*apisv1.DetailWorkflowResponse, error) {
func (w *workflowServiceImpl) DetailWorkflow(_ context.Context, workflow *model.Workflow) (*apisv1.DetailWorkflowResponse, error) {
return &apisv1.DetailWorkflowResponse{
WorkflowBase: assembler.ConvertWorkflowBase(workflow),
}, nil
@ -445,7 +445,7 @@ func (w *workflowServiceImpl) SyncWorkflowRecord(ctx context.Context, appPrimary
record.Finished = "true"
record.Status = model.RevisionStatusFail
if err := w.Store.Put(ctx, record); err != nil {
return fmt.Errorf(("failed to set the record status to terminated: %s"), err.Error())
return fmt.Errorf("failed to set the record status to terminated: %s", err.Error())
}
return bcode.ErrApplicationRevisionNotExist
}
@ -737,29 +737,21 @@ func (w *workflowServiceImpl) GetWorkflowRecord(ctx context.Context, workflow *m
return res[0].(*model.WorkflowRecord), nil
}
func (w *workflowServiceImpl) ResumeRecord(ctx context.Context, appModel *model.Application, workflow *model.Workflow, recordName, stepName string) error {
func (w *workflowServiceImpl) ResumeWorkflow(ctx context.Context, appModel *model.Application, workflow *model.Workflow, stepName string) error {
oamApp, err := w.checkRecordRunning(ctx, appModel, workflow.EnvName)
if err != nil {
return err
}
if err := operation.ResumeWorkflow(ctx, w.KubeClient, oamApp, stepName); err != nil {
return err
}
return nil
return operation.ResumeWorkflow(ctx, w.KubeClient, oamApp, stepName)
}
func (w *workflowServiceImpl) TerminateRecord(ctx context.Context, appModel *model.Application, workflow *model.Workflow, recordName string) error {
func (w *workflowServiceImpl) TerminateWorkflow(ctx context.Context, appModel *model.Application, workflow *model.Workflow) error {
oamApp, err := w.checkRecordRunning(ctx, appModel, workflow.EnvName)
if err != nil {
return err
}
if err := operation.TerminateWorkflow(ctx, w.KubeClient, oamApp); err != nil {
return err
}
return nil
return operation.TerminateWorkflow(ctx, w.KubeClient, oamApp)
}
func (w *workflowServiceImpl) RollbackRecord(ctx context.Context, appModel *model.Application, workflow *model.Workflow, recordName, revisionVersion string) (*apisv1.WorkflowRecordBase, error) {
@ -911,7 +903,9 @@ func (w *workflowServiceImpl) GetWorkflowRecordLog(ctx context.Context, record *
return apisv1.GetPipelineRunLogResponse{LogSource: source}, bcode.ErrReadSourceLog
}
//nolint:errcheck
defer readCloser.Close()
defer func() {
_ = readCloser.Close()
}()
if _, err := io.Copy(&logsBuilder, readCloser); err != nil {
klog.Errorf("copy logs from url %s failed: %v", logConfig.Source.URL, err)
return apisv1.GetPipelineRunLogResponse{LogSource: source}, bcode.ErrReadSourceLog
@ -926,7 +920,7 @@ func (w *workflowServiceImpl) GetWorkflowRecordLog(ctx context.Context, record *
}, nil
}
func (w *workflowServiceImpl) GetWorkflowRecordOutput(ctx context.Context, workflow *model.Workflow, record *model.WorkflowRecord, stepName string) (apisv1.GetPipelineRunOutputResponse, error) {
func (w *workflowServiceImpl) GetWorkflowRecordOutput(_ context.Context, workflow *model.Workflow, record *model.WorkflowRecord, stepName string) (apisv1.GetPipelineRunOutputResponse, error) {
outputsSpec := make(map[string]workflowv1alpha1.StepOutputs)
stepOutputs := make([]apisv1.StepOutputBase, 0)
@ -972,7 +966,7 @@ func (w *workflowServiceImpl) GetWorkflowRecordOutput(ctx context.Context, workf
return apisv1.GetPipelineRunOutputResponse{StepOutputs: stepOutputs}, nil
}
func (w *workflowServiceImpl) GetWorkflowRecordInput(ctx context.Context, workflow *model.Workflow, record *model.WorkflowRecord, stepName string) (apisv1.GetPipelineRunInputResponse, error) {
func (w *workflowServiceImpl) GetWorkflowRecordInput(_ context.Context, workflow *model.Workflow, record *model.WorkflowRecord, stepName string) (apisv1.GetPipelineRunInputResponse, error) {
// valueFromStep know which step the value came from
valueFromStep := make(map[string]string)
inputsSpec := make(map[string]workflowv1alpha1.StepInputs)

View File

@ -378,7 +378,7 @@ var _ = Describe("Test workflow service functions", func() {
Expect(record.Status).Should(Equal(string(workflowv1alpha1.WorkflowStateInitializing)))
})
It("Test ResumeRecord function", func() {
It("Test ResumeWorkflow function", func() {
ctx := context.TODO()
_, err := envService.CreateEnv(context.TODO(), apisv1.CreateEnvRequest{Name: "resume"})
@ -414,9 +414,9 @@ var _ = Describe("Test workflow service functions", func() {
})
Expect(err).Should(BeNil())
err = workflowService.ResumeRecord(ctx, &model.Application{
err = workflowService.ResumeWorkflow(ctx, &model.Application{
Name: appName,
}, &model.Workflow{Name: ResumeWorkflow, EnvName: "resume"}, "workflow-resume-1", "")
}, &model.Workflow{Name: ResumeWorkflow, EnvName: "resume"}, "")
Expect(err).Should(BeNil())
err = workflowService.SyncWorkflowRecord(ctx, appName, "workflow-resume-1", app, nil)
@ -428,7 +428,7 @@ var _ = Describe("Test workflow service functions", func() {
Expect(record.Steps[0].Phase).Should(Equal(workflowv1alpha1.WorkflowStepPhaseRunning))
})
It("Test TerminateRecord function", func() {
It("Test TerminateWorkflow function", func() {
ctx := context.TODO()
_, err := envService.CreateEnv(context.TODO(), apisv1.CreateEnvRequest{Name: "terminate"})
@ -463,9 +463,9 @@ var _ = Describe("Test workflow service functions", func() {
})
Expect(err).Should(BeNil())
err = workflowService.TerminateRecord(ctx, &model.Application{
err = workflowService.TerminateWorkflow(ctx, &model.Application{
Name: appName,
}, workflow, "test-workflow-2-1")
}, workflow)
Expect(err).Should(BeNil())
err = k8sClient.Get(ctx, client.ObjectKey{Name: appName, Namespace: "terminate"}, app)

View File

@ -61,7 +61,7 @@ type InfoCalculateCronJob struct {
}
// Start start the worker
func (i *InfoCalculateCronJob) Start(ctx context.Context, errChan chan error) {
func (i *InfoCalculateCronJob) Start(ctx context.Context, _ chan error) {
i.start(CrontabSpec)
defer i.cron.Stop()
<-ctx.Done()
@ -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 {
@ -115,10 +115,7 @@ func (i InfoCalculateCronJob) run() error {
return nil
}
if err := i.calculateAndUpdate(ctx, *info); err != nil {
return err
}
return nil
return i.calculateAndUpdate(ctx, *info)
}
func (i InfoCalculateCronJob) calculateAndUpdate(ctx context.Context, systemInfo model.SystemInfo) error {
@ -150,10 +147,7 @@ func (i InfoCalculateCronJob) calculateAndUpdate(ctx context.Context, systemInfo
}
systemInfo.StatisticInfo = statisticInfo
if err := i.Store.Put(ctx, &systemInfo); err != nil {
return err
}
return nil
return i.Store.Put(ctx, &systemInfo)
}
func (i InfoCalculateCronJob) calculateAppInfo(ctx context.Context) (int, []string, []string, []string, []string, error) {

View File

@ -21,7 +21,6 @@ import (
"k8s.io/client-go/util/workqueue"
"github.com/kubevela/velaux/pkg/server/config"
"github.com/kubevela/velaux/pkg/server/event/collect"
"github.com/kubevela/velaux/pkg/server/event/sync"
)
@ -34,7 +33,7 @@ type Worker interface {
}
// InitEvent init all event worker
func InitEvent(cfg config.Config) []interface{} {
func InitEvent() []interface{} {
application := &sync.ApplicationSync{
Queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),
}

View File

@ -20,11 +20,9 @@ import (
"testing"
"gotest.tools/assert"
"github.com/kubevela/velaux/pkg/server/config"
)
func TestInitEvent(t *testing.T) {
InitEvent(config.Config{})
InitEvent()
assert.Equal(t, len(workers), 2)
}

View File

@ -97,7 +97,14 @@ func (a *ApplicationSync) Start(ctx context.Context, errorChan chan error) {
}
app := item.(*v1beta1.Application)
if err := cu.AddOrUpdate(ctx, app); err != nil {
klog.Errorf("fail to add or update application %s: %s", app.Name, err.Error())
failTimes := a.Queue.NumRequeues(app)
klog.Errorf("fail to add or update application %s: %s, requeue times: %d", app.Name, err.Error(), failTimes)
if failTimes < 5 {
a.Queue.AddRateLimited(app)
} else {
klog.Errorf("fail to add or update application %s: %s, requeue times reach the limit(%d), give up", app.Name, err.Error(), failTimes)
a.Queue.Forget(app)
}
}
a.Queue.Done(app)
}
@ -115,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{}) {

View File

@ -19,6 +19,7 @@ package clients
import (
"fmt"
cloudshellv1alpha1 "github.com/cloudtty/cloudtty/pkg/apis/cloudshell/v1alpha1"
pkgmulticluster "github.com/kubevela/pkg/multicluster"
"github.com/kubevela/workflow/api/v1alpha1"
"github.com/kubevela/workflow/pkg/cue/packages"
@ -77,6 +78,10 @@ func GetKubeClient() (client.Client, error) {
if err != nil {
return nil, err
}
err = cloudshellv1alpha1.AddToScheme(common.Scheme)
if err != nil {
return nil, err
}
return pkgmulticluster.NewClient(kubeConfig, pkgmulticluster.ClientOptions{
Options: client.Options{Scheme: common.Scheme},
})

View File

@ -89,8 +89,8 @@ func NewEntity(in Entity) (Entity, error) {
if t.Kind() == reflect.Ptr {
t = t.Elem()
}
new := reflect.New(t)
return new.Interface().(Entity), nil
newEntity := reflect.New(t)
return newEntity.Interface().(Entity), nil
}
// SortOrder is the order of sort

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package datastore
package datastore_test
import (
"testing"

View File

@ -14,24 +14,135 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package datastore
package datastore_test
import (
"context"
"encoding/json"
"fmt"
"math/rand"
"strings"
"time"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
mysqlgorm "gorm.io/driver/mysql"
postgresorm "gorm.io/driver/postgres"
"gorm.io/gorm"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"github.com/kubevela/velaux/pkg/server/domain/model"
"github.com/kubevela/velaux/pkg/server/infrastructure/clients"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/kubeapi"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/mongodb"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/mysql"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/postgres"
)
func initMysqlTestDs() (datastore.DataStore, error) {
db, err := gorm.Open(mysqlgorm.Open("root:kubevelaSQL123@tcp(127.0.0.1:3306)/kubevela?parseTime=True"), &gorm.Config{})
if err != nil {
return nil, err
}
for _, v := range model.GetRegisterModels() {
err := db.Migrator().DropTable(&v)
if err != nil {
return nil, err
}
}
mysqlDriver, err := mysql.New(context.TODO(), datastore.Config{
URL: "root:kubevelaSQL123@tcp(127.0.0.1:3306)/kubevela?parseTime=True",
Database: "kubevela",
})
if err != nil {
return nil, err
}
return mysqlDriver, nil
}
func initPostgresTestDs() (datastore.DataStore, error) {
db, err := gorm.Open(postgresorm.Open("postgres://kubevela:Kubevela-123@127.0.0.1:5432/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
}
}
postgresDriver, err := postgres.New(context.TODO(), datastore.Config{
URL: "postgres://kubevela:Kubevela-123@127.0.0.1:5432/kubevela?sslmode=disable&client_encoding=UTF-8&connect_timeout=1",
Database: "kubevela",
})
if err != nil {
return nil, err
}
return postgresDriver, nil
}
func initKubeapiTestDs() (datastore.DataStore, error) {
var testScheme = runtime.NewScheme()
testEnv := &envtest.Environment{
ControlPlaneStartTimeout: time.Minute * 3,
ControlPlaneStopTimeout: time.Minute,
UseExistingCluster: pointer.Bool(false),
}
cfg, err := testEnv.Start()
if err != nil {
return nil, err
}
err = scheme.AddToScheme(testScheme)
if err != nil {
return nil, err
}
cfg.Timeout = time.Minute * 2
k8sClient, err := client.New(cfg, client.Options{Scheme: testScheme})
if err != nil {
return nil, err
}
clients.SetKubeClient(k8sClient)
kubeStore, err := kubeapi.New(context.TODO(), datastore.Config{Database: "test"}, k8sClient)
if err != nil {
return nil, err
}
return kubeStore, nil
}
func initMongodbTestDs() (datastore.DataStore, error) {
clientOpts := options.Client().ApplyURI("mongodb://localhost:27017")
mongoClient, err := mongo.Connect(context.TODO(), clientOpts)
if err != nil {
return nil, err
}
err = mongoClient.Database("kubevela").Drop(context.TODO())
if err != nil {
return nil, err
}
mongodbDriver, err := mongodb.New(context.TODO(), datastore.Config{
URL: "mongodb://localhost:27017",
Database: "kubevela",
})
if err != nil {
return nil, err
}
return mongodbDriver, nil
}
var _ = Describe("Test new entity function", func() {
It("Test new application entity", func() {
var app model.Application
new, err := NewEntity(&app)
new, err := datastore.NewEntity(&app)
Expect(err).To(BeNil())
err = json.Unmarshal([]byte(`{"name":"demo"}`), new)
Expect(err).To(BeNil())
@ -41,10 +152,10 @@ var _ = Describe("Test new entity function", func() {
It("Test new multiple application entity", func() {
var app model.Application
var list []Entity
var list []datastore.Entity
var n = 3
for n > 0 {
new, err := NewEntity(&app)
new, err := datastore.NewEntity(&app)
Expect(err).To(BeNil())
err = json.Unmarshal([]byte(fmt.Sprintf(`{"name":"demo %d"}`, n)), new)
Expect(err).To(BeNil())
@ -56,5 +167,243 @@ var _ = Describe("Test new entity function", func() {
diff := cmp.Diff(list[0].PrimaryKey(), "demo 3")
Expect(diff).Should(BeEmpty())
})
})
var _ = Describe("Test datastore methods", func() {
rand.Seed(time.Now().UnixNano())
DriverTest(initMysqlTestDs)
DriverTest(initMongodbTestDs)
DriverTest(initKubeapiTestDs)
DriverTest(initPostgresTestDs)
})
func DriverTest(initTestDs func() (datastore.DataStore, error)) {
driver, err := initTestDs()
Expect(err).ToNot(HaveOccurred())
It("Test add function", func() {
err := driver.Add(context.TODO(), &model.Application{Name: "kubevela-app", Description: "default"})
Expect(err).ToNot(HaveOccurred())
})
It("Test batch add function", func() {
var datas = []datastore.Entity{
&model.Application{Name: "kubevela-app-2", Description: "this is demo 2"},
&model.Application{Name: "kubevela-app-3", Description: "this is demo 3"},
&model.Application{Name: "kubevela-app-4", Project: "test-project", Description: "this is demo 4"},
&model.Workflow{Name: "kubevela-app-workflow", AppPrimaryKey: "kubevela-app-2", Description: "this is workflow"},
&model.ApplicationTrigger{Name: "kubevela-app-trigger", AppPrimaryKey: "kubevela-app-2", Token: "token-test", Description: "this is demo 4"},
}
err := driver.BatchAdd(context.TODO(), datas)
Expect(err).ToNot(HaveOccurred())
var datas2 = []datastore.Entity{
&model.Application{Name: "can-delete", Description: "this is demo can-delete"},
&model.Application{Name: "kubevela-app-2", Description: "this is demo 2"},
}
err = driver.BatchAdd(context.TODO(), datas2)
equal := cmp.Diff(strings.Contains(err.Error(), "save entities occur error"), true)
Expect(equal).To(BeEmpty())
})
It("Test get function", func() {
app := &model.Application{Name: "kubevela-app"}
err := driver.Get(context.TODO(), app)
Expect(err).Should(BeNil())
diff := cmp.Diff(app.Description, "default")
Expect(diff).Should(BeEmpty())
workflow := &model.Workflow{Name: "kubevela-app-workflow", AppPrimaryKey: "kubevela-app-2"}
err = driver.Get(context.TODO(), workflow)
Expect(err).Should(BeNil())
diff = cmp.Diff(workflow.Description, "this is workflow")
Expect(diff).Should(BeEmpty())
})
It("Test put function", func() {
err := driver.Put(context.TODO(), &model.Application{Name: "kubevela-app", Description: "this is demo"})
Expect(err).ToNot(HaveOccurred())
})
It("Test list function", func() {
var app model.Application
list, err := driver.List(context.TODO(), &app, &datastore.ListOptions{Page: -1})
Expect(err).ShouldNot(HaveOccurred())
diff := cmp.Diff(len(list), 4)
Expect(diff).Should(BeEmpty())
list, err = driver.List(context.TODO(), &app, &datastore.ListOptions{Page: 2, PageSize: 2})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = driver.List(context.TODO(), &app, &datastore.ListOptions{Page: 1, PageSize: 2})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = driver.List(context.TODO(), &app, nil)
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 4)
Expect(diff).Should(BeEmpty())
var workflow = model.Workflow{
AppPrimaryKey: "kubevela-app-2",
}
list, err = driver.List(context.TODO(), &workflow, nil)
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 1)
Expect(diff).Should(BeEmpty())
list, err = driver.List(context.TODO(), &app, &datastore.ListOptions{FilterOptions: datastore.FilterOptions{In: []datastore.InQueryOption{
{
Key: "name",
Values: []string{"kubevela-app-3", "kubevela-app-2"},
},
}}})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = driver.List(context.TODO(), &app, &datastore.ListOptions{FilterOptions: datastore.FilterOptions{IsNotExist: []datastore.IsNotExistQueryOption{
{
Key: "project",
},
}}})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 3)
Expect(diff).Should(BeEmpty())
})
It("Test list clusters with sort and fuzzy query", func() {
clusters, err := driver.List(context.TODO(), &model.Cluster{}, nil)
Expect(err).Should(Succeed())
for _, cluster := range clusters {
Expect(driver.Delete(context.TODO(), cluster)).Should(Succeed())
}
for _, name := range []string{"first", "second", "third"} {
Expect(driver.Add(context.TODO(), &model.Cluster{Name: name})).Should(Succeed())
time.Sleep(time.Millisecond * 100)
}
entities, err := driver.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderAscending}}})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(3))
for i, name := range []string{"first", "second", "third"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = driver.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
Page: 1,
PageSize: 2,
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(2))
for i, name := range []string{"third", "second"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = driver.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
Page: 2,
PageSize: 2,
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(1))
for i, name := range []string{"first"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = driver.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
FilterOptions: datastore.FilterOptions{
Queries: []datastore.FuzzyQueryOption{{Key: "name", Query: "ir"}},
},
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(2))
for i, name := range []string{"third", "first"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
})
It("Test count function", func() {
var app model.Application
count, err := driver.Count(context.TODO(), &app, nil)
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(4)))
count, err = driver.Count(context.TODO(), &model.Cluster{}, &datastore.FilterOptions{
Queries: []datastore.FuzzyQueryOption{{Key: "name", Query: "ir"}},
})
Expect(err).Should(Succeed())
Expect(count).Should(Equal(int64(2)))
count, err = driver.Count(context.TODO(), &app, &datastore.FilterOptions{In: []datastore.InQueryOption{
{
Key: "name",
Values: []string{"kubevela-app-3", "kubevela-app-2"},
},
}})
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(2)))
count, err = driver.Count(context.TODO(), &app, &datastore.FilterOptions{IsNotExist: []datastore.IsNotExistQueryOption{
{
Key: "project",
},
}})
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(3)))
app.Name = "kubevela-app-3"
count, err = driver.Count(context.TODO(), &app, &datastore.FilterOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(1)))
})
It("Test isExist function", func() {
var app model.Application
app.Name = "kubevela-app-3"
exist, err := driver.IsExist(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
diff := cmp.Diff(exist, true)
Expect(diff).Should(BeEmpty())
app.Name = "kubevela-app-5"
notexist, err := driver.IsExist(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(notexist, false)
Expect(diff).Should(BeEmpty())
})
It("Test delete function", func() {
var app model.Application
app.Name = "kubevela-app"
err := driver.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-2"
err = driver.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-3"
err = driver.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-4"
err = driver.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-4"
err = driver.Delete(context.TODO(), &app)
equal := cmp.Equal(err, datastore.ErrRecordNotExist, cmpopts.EquateErrors())
Expect(equal).Should(BeTrue())
workflow := model.Workflow{Name: "kubevela-app-workflow", AppPrimaryKey: "kubevela-app-2", Description: "this is workflow"}
err = driver.Delete(context.TODO(), &workflow)
Expect(err).ShouldNot(HaveOccurred())
trigger := model.ApplicationTrigger{Name: "kubevela-app-trigger", AppPrimaryKey: "kubevela-app-2", Token: "token-test", Description: "this is demo 4"}
err = driver.Delete(context.TODO(), &trigger)
Expect(err).ShouldNot(HaveOccurred())
})
}

View File

@ -19,11 +19,8 @@ package kubeapi
import (
"context"
"fmt"
"strings"
"time"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/labels"
@ -35,43 +32,6 @@ import (
var _ = Describe("Test kubeapi datastore driver", func() {
It("Test add function", func() {
app := &model.Application{Name: "kubevela-app", Description: "default"}
err := kubeStore.Add(context.TODO(), app)
Expect(err).ToNot(HaveOccurred())
Expect(app.CreateTime.IsZero()).Should(BeFalse())
})
It("Test batch add function", func() {
var entities = []datastore.Entity{
&model.Application{Name: "kubevela-app-2", Description: "this is demo 2"},
&model.Application{Name: "kubevela-app-3", Description: "this is demo 3"},
&model.Application{Name: "kubevela-app-4", Project: "testProject", Description: "this is demo 4"},
}
err := kubeStore.BatchAdd(context.TODO(), entities)
Expect(err).ToNot(HaveOccurred())
var entities2 = []datastore.Entity{
&model.Application{Name: "can-delete", Description: "this is demo can-delete"},
&model.Application{Name: "kubevela-app-2", Description: "this is demo 2"},
}
err = kubeStore.BatchAdd(context.TODO(), entities2)
equal := cmp.Diff(strings.Contains(err.Error(), "save entities occur error"), true)
Expect(equal).To(BeEmpty())
})
It("Test get function", func() {
app := &model.Application{Name: "kubevela-app"}
err := kubeStore.Get(context.TODO(), app)
Expect(err).Should(BeNil())
diff := cmp.Diff(app.Description, "default")
Expect(diff).Should(BeEmpty())
})
It("Test put function", func() {
err := kubeStore.Put(context.TODO(), &model.Application{Name: "kubevela-app", Description: "this is demo"})
Expect(err).ToNot(HaveOccurred())
})
It("Test application index", func() {
var app = model.Application{
Name: "test",
@ -87,6 +47,7 @@ var _ = Describe("Test kubeapi datastore driver", func() {
}
Expect(cmp.Diff(selector.String(), "name=test,table=vela_application")).Should(BeEmpty())
})
It("Test workflow index", func() {
defaultPtr := false
var workflow = model.Workflow{
@ -104,168 +65,6 @@ var _ = Describe("Test kubeapi datastore driver", func() {
}
Expect(cmp.Diff(selector.String(), "default=false,name=test,table=vela_workflow")).Should(BeEmpty())
})
It("Test list function", func() {
var app model.Application
list, err := kubeStore.List(context.TODO(), &app, &datastore.ListOptions{Page: -1})
Expect(err).ShouldNot(HaveOccurred())
diff := cmp.Diff(len(list), 4)
Expect(diff).Should(BeEmpty())
list, err = kubeStore.List(context.TODO(), &app, &datastore.ListOptions{Page: 2, PageSize: 2})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = kubeStore.List(context.TODO(), &app, &datastore.ListOptions{Page: 1, PageSize: 2})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = kubeStore.List(context.TODO(), &app, nil)
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 4)
Expect(diff).Should(BeEmpty())
list, err = kubeStore.List(context.TODO(), &app, &datastore.ListOptions{FilterOptions: datastore.FilterOptions{In: []datastore.InQueryOption{
{
Key: "name",
Values: []string{"kubevela-app-3", "kubevela-app-2"},
},
}}})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = kubeStore.List(context.TODO(), &app, &datastore.ListOptions{FilterOptions: datastore.FilterOptions{IsNotExist: []datastore.IsNotExistQueryOption{
{
Key: "project",
},
}}})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 3)
Expect(diff).Should(BeEmpty())
})
It("Test list clusters with sort and fuzzy query", func() {
clusters, err := kubeStore.List(context.TODO(), &model.Cluster{}, nil)
Expect(err).Should(Succeed())
for _, cluster := range clusters {
Expect(kubeStore.Delete(context.TODO(), cluster)).Should(Succeed())
}
for _, name := range []string{"first", "second", "third"} {
Expect(kubeStore.Add(context.TODO(), &model.Cluster{Name: name})).Should(Succeed())
time.Sleep(time.Millisecond * 100)
}
entities, err := kubeStore.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderAscending}}})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(3))
for i, name := range []string{"first", "second", "third"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = kubeStore.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
Page: 1,
PageSize: 2,
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(2))
for i, name := range []string{"third", "second"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = kubeStore.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
Page: 2,
PageSize: 2,
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(1))
for i, name := range []string{"first"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = kubeStore.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
FilterOptions: datastore.FilterOptions{
Queries: []datastore.FuzzyQueryOption{{Key: "name", Query: "ir"}},
},
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(2))
for i, name := range []string{"third", "first"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
})
It("Test count function", func() {
var app model.Application
count, err := kubeStore.Count(context.TODO(), &app, nil)
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(4)))
count, err = kubeStore.Count(context.TODO(), &model.Cluster{}, &datastore.FilterOptions{
Queries: []datastore.FuzzyQueryOption{{Key: "name", Query: "ir"}},
})
Expect(err).Should(Succeed())
Expect(count).Should(Equal(int64(2)))
count, err = kubeStore.Count(context.TODO(), &app, &datastore.FilterOptions{In: []datastore.InQueryOption{
{
Key: "name",
Values: []string{"kubevela-app-3", "kubevela-app-2"},
},
}})
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(2)))
count, err = kubeStore.Count(context.TODO(), &app, &datastore.FilterOptions{IsNotExist: []datastore.IsNotExistQueryOption{
{
Key: "project",
},
}})
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(3)))
})
It("Test isExist function", func() {
var app model.Application
app.Name = "kubevela-app-3"
exist, err := kubeStore.IsExist(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
diff := cmp.Diff(exist, true)
Expect(diff).Should(BeEmpty())
app.Name = "kubevela-app-5"
notExist, err := kubeStore.IsExist(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(notExist, false)
Expect(diff).Should(BeEmpty())
})
It("Test delete function", func() {
var app model.Application
app.Name = "kubevela-app"
err := kubeStore.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-2"
err = kubeStore.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-3"
err = kubeStore.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-4"
err = kubeStore.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-4"
err = kubeStore.Delete(context.TODO(), &app)
equal := cmp.Equal(err, datastore.ErrRecordNotExist, cmpopts.EquateErrors())
Expect(equal).Should(BeTrue())
})
It("Test verify index", func() {
var usr = model.User{Name: "can@delete", Email: "xxx@xx.com"}

View File

@ -42,7 +42,7 @@ const PrimaryKey = "_name"
// New new mongodb datastore instance
func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error) {
if !strings.HasPrefix(cfg.URL, "mongodb://") {
if !(strings.HasPrefix(cfg.URL, "mongodb://") || strings.HasPrefix(cfg.URL, "mongodb+srv://")) {
cfg.URL = fmt.Sprintf("mongodb://%s", cfg.URL)
}
clientOpts := options.Client().ApplyURI(cfg.URL)

View File

@ -19,17 +19,13 @@ package mongodb
import (
"context"
"math/rand"
"strings"
"time"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"github.com/kubevela/velaux/pkg/server/domain/model"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
)
@ -59,231 +55,3 @@ var _ = BeforeSuite(func(ctx SpecContext) {
By("create mongodb driver success")
}, NodeTimeout(2*time.Minute))
var _ = Describe("Test mongodb datastore driver", func() {
It("Test add function", func() {
err := mongodbDriver.Add(context.TODO(), &model.Application{Name: "kubevela-app", Description: "default"})
Expect(err).ToNot(HaveOccurred())
})
It("Test batch add function", func() {
var datas = []datastore.Entity{
&model.Application{Name: "kubevela-app-2", Description: "this is demo 2"},
&model.Application{Name: "kubevela-app-3", Description: "this is demo 3"},
&model.Application{Name: "kubevela-app-4", Project: "test-project", Description: "this is demo 4"},
&model.Workflow{Name: "kubevela-app-workflow", AppPrimaryKey: "kubevela-app-2", Description: "this is workflow"},
&model.ApplicationTrigger{Name: "kubevela-app-trigger", AppPrimaryKey: "kubevela-app-2", Token: "token-test", Description: "this is demo 4"},
}
err := mongodbDriver.BatchAdd(context.TODO(), datas)
Expect(err).ToNot(HaveOccurred())
var datas2 = []datastore.Entity{
&model.Application{Name: "can-delete", Description: "this is demo can-delete"},
&model.Application{Name: "kubevela-app-2", Description: "this is demo 2"},
}
err = mongodbDriver.BatchAdd(context.TODO(), datas2)
equal := cmp.Diff(strings.Contains(err.Error(), "save entities occur error"), true)
Expect(equal).To(BeEmpty())
})
It("Test get function", func() {
app := &model.Application{Name: "kubevela-app"}
err := mongodbDriver.Get(context.TODO(), app)
Expect(err).Should(BeNil())
diff := cmp.Diff(app.Description, "default")
Expect(diff).Should(BeEmpty())
workflow := &model.Workflow{Name: "kubevela-app-workflow", AppPrimaryKey: "kubevela-app-2"}
err = mongodbDriver.Get(context.TODO(), workflow)
Expect(err).Should(BeNil())
diff = cmp.Diff(workflow.Description, "this is workflow")
Expect(diff).Should(BeEmpty())
})
It("Test put function", func() {
err := mongodbDriver.Put(context.TODO(), &model.Application{Name: "kubevela-app", Description: "this is demo"})
Expect(err).ToNot(HaveOccurred())
})
It("Test list function", func() {
var app model.Application
list, err := mongodbDriver.List(context.TODO(), &app, &datastore.ListOptions{Page: -1})
Expect(err).ShouldNot(HaveOccurred())
diff := cmp.Diff(len(list), 4)
Expect(diff).Should(BeEmpty())
list, err = mongodbDriver.List(context.TODO(), &app, &datastore.ListOptions{Page: 2, PageSize: 2})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = mongodbDriver.List(context.TODO(), &app, &datastore.ListOptions{Page: 1, PageSize: 2})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = mongodbDriver.List(context.TODO(), &app, nil)
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 4)
Expect(diff).Should(BeEmpty())
var workflow = model.Workflow{
AppPrimaryKey: "kubevela-app-2",
}
list, err = mongodbDriver.List(context.TODO(), &workflow, nil)
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 1)
Expect(diff).Should(BeEmpty())
list, err = mongodbDriver.List(context.TODO(), &app, &datastore.ListOptions{FilterOptions: datastore.FilterOptions{In: []datastore.InQueryOption{
{
Key: "name",
Values: []string{"kubevela-app-3", "kubevela-app-2"},
},
}}})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 2)
Expect(diff).Should(BeEmpty())
list, err = mongodbDriver.List(context.TODO(), &app, &datastore.ListOptions{FilterOptions: datastore.FilterOptions{IsNotExist: []datastore.IsNotExistQueryOption{
{
Key: "project",
},
}}})
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(len(list), 3)
Expect(diff).Should(BeEmpty())
})
It("Test list clusters with sort and fuzzy query", func() {
clusters, err := mongodbDriver.List(context.TODO(), &model.Cluster{}, nil)
Expect(err).Should(Succeed())
for _, cluster := range clusters {
Expect(mongodbDriver.Delete(context.TODO(), cluster)).Should(Succeed())
}
for _, name := range []string{"first", "second", "third"} {
Expect(mongodbDriver.Add(context.TODO(), &model.Cluster{Name: name})).Should(Succeed())
time.Sleep(time.Millisecond * 100)
}
entities, err := mongodbDriver.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderAscending}}})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(3))
for i, name := range []string{"first", "second", "third"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = mongodbDriver.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
Page: 1,
PageSize: 2,
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(2))
for i, name := range []string{"third", "second"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = mongodbDriver.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
Page: 2,
PageSize: 2,
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(1))
for i, name := range []string{"first"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
entities, err = mongodbDriver.List(context.TODO(), &model.Cluster{}, &datastore.ListOptions{
SortBy: []datastore.SortOption{{Key: "createTime", Order: datastore.SortOrderDescending}},
FilterOptions: datastore.FilterOptions{
Queries: []datastore.FuzzyQueryOption{{Key: "name", Query: "ir"}},
},
})
Expect(err).Should(Succeed())
Expect(len(entities)).Should(Equal(2))
for i, name := range []string{"third", "first"} {
Expect(entities[i].(*model.Cluster).Name).Should(Equal(name))
}
})
It("Test count function", func() {
var app model.Application
count, err := mongodbDriver.Count(context.TODO(), &app, nil)
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(4)))
count, err = mongodbDriver.Count(context.TODO(), &model.Cluster{}, &datastore.FilterOptions{
Queries: []datastore.FuzzyQueryOption{{Key: "name", Query: "ir"}},
})
Expect(err).Should(Succeed())
Expect(count).Should(Equal(int64(2)))
count, err = mongodbDriver.Count(context.TODO(), &app, &datastore.FilterOptions{In: []datastore.InQueryOption{
{
Key: "name",
Values: []string{"kubevela-app-3", "kubevela-app-2"},
},
}})
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(2)))
count, err = mongodbDriver.Count(context.TODO(), &app, &datastore.FilterOptions{IsNotExist: []datastore.IsNotExistQueryOption{
{
Key: "project",
},
}})
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(3)))
app.Name = "kubevela-app-3"
count, err = mongodbDriver.Count(context.TODO(), &app, &datastore.FilterOptions{})
Expect(err).ShouldNot(HaveOccurred())
Expect(count).Should(Equal(int64(1)))
})
It("Test isExist function", func() {
var app model.Application
app.Name = "kubevela-app-3"
exist, err := mongodbDriver.IsExist(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
diff := cmp.Diff(exist, true)
Expect(diff).Should(BeEmpty())
app.Name = "kubevela-app-5"
notexist, err := mongodbDriver.IsExist(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
diff = cmp.Diff(notexist, false)
Expect(diff).Should(BeEmpty())
})
It("Test delete function", func() {
var app model.Application
app.Name = "kubevela-app"
err := mongodbDriver.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-2"
err = mongodbDriver.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-3"
err = mongodbDriver.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-4"
err = mongodbDriver.Delete(context.TODO(), &app)
Expect(err).ShouldNot(HaveOccurred())
app.Name = "kubevela-app-4"
err = mongodbDriver.Delete(context.TODO(), &app)
equal := cmp.Equal(err, datastore.ErrRecordNotExist, cmpopts.EquateErrors())
Expect(equal).Should(BeTrue())
workflow := model.Workflow{Name: "kubevela-app-workflow", AppPrimaryKey: "kubevela-app-2", Description: "this is workflow"}
err = mongodbDriver.Delete(context.TODO(), &workflow)
Expect(err).ShouldNot(HaveOccurred())
trigger := model.ApplicationTrigger{Name: "kubevela-app-trigger", AppPrimaryKey: "kubevela-app-2", Token: "token-test", Description: "this is demo 4"}
err = mongodbDriver.Delete(context.TODO(), &trigger)
Expect(err).ShouldNot(HaveOccurred())
})
})

View File

@ -18,69 +18,42 @@ package mysql
import (
"context"
"fmt"
mysqlgorm "gorm.io/driver/mysql"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"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 mongodb datastore instance
// New new mysql datastore instance
func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error) {
db, err := gorm.Open(mysqlgorm.Open(cfg.URL), &gorm.Config{})
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
}
for _, v := range model.GetRegisterModels() {
if err := db.WithContext(ctx).AutoMigrate(v); err != nil {
return nil, err
}
}
m := &mysql{
client: *db,
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 {
return fmt.Errorf("method to be implemented")
}
// BatchAdd batch add entity, this operation has some atomicity.
func (m *mysql) BatchAdd(ctx context.Context, entities []datastore.Entity) error {
return fmt.Errorf("method to be implemented")
}
// Get get data model
func (m *mysql) Get(ctx context.Context, entity datastore.Entity) error {
return fmt.Errorf("method to be implemented")
}
// Put update data model
func (m *mysql) Put(ctx context.Context, entity datastore.Entity) error {
return fmt.Errorf("method to be implemented")
}
// IsExist determine whether data exists.
func (m *mysql) IsExist(ctx context.Context, entity datastore.Entity) (bool, error) {
return true, fmt.Errorf("method to be implemented")
}
// Delete delete data
func (m *mysql) Delete(ctx context.Context, entity datastore.Entity) error {
return fmt.Errorf("method to be implemented")
}
// List list entity function
func (m *mysql) List(ctx context.Context, entity datastore.Entity, op *datastore.ListOptions) ([]datastore.Entity, error) {
return nil, fmt.Errorf("method to be implemented")
}
// Count counts entities
func (m *mysql) Count(ctx context.Context, entity datastore.Entity, filterOptions *datastore.FilterOptions) (int64, error) {
return 0, fmt.Errorf("method to be implemented")
}

View File

@ -0,0 +1,40 @@
/*
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 mysql
import (
"context"
"testing"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
)
func TestMySQL(t *testing.T) {
_, err := New(context.TODO(), datastore.Config{
URL: "root:kubevelaSQL123@tcp(127.0.0.1:3306)/kubevela?parseTime=True",
Database: "kubevela",
})
if err != nil {
t.Fatal(err)
}
RegisterFailHandler(Fail)
RunSpecs(t, "MySQL Suite")
}

View File

@ -0,0 +1,50 @@
/*
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 mysql
import (
"context"
"math/rand"
"time"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
mysqlgorm "gorm.io/driver/mysql"
"gorm.io/gorm"
"github.com/kubevela/velaux/pkg/server/domain/model"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
)
var mysqlDriver datastore.DataStore
var _ = BeforeSuite(func(ctx SpecContext) {
rand.Seed(time.Now().UnixNano())
By("bootstrapping mysql test environment")
db, err := gorm.Open(mysqlgorm.Open("root:kubevelaSQL123@tcp(127.0.0.1:3306)/kubevela?parseTime=True"), &gorm.Config{})
Expect(err).ToNot(HaveOccurred())
for _, v := range model.GetRegisterModels() {
err := db.Migrator().DropTable(&v)
Expect(err).ToNot(HaveOccurred())
}
mysqlDriver, err = New(context.TODO(), datastore.Config{
URL: "root:kubevelaSQL123@tcp(127.0.0.1:3306)/kubevela?parseTime=True",
Database: "kubevela",
})
Expect(err).ToNot(HaveOccurred())
Expect(mysqlDriver).ToNot(BeNil())
By("create mysql driver success")
}, NodeTimeout(2*time.Minute))

View File

@ -0,0 +1,62 @@
/*
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 postgres
import (
"context"
postgresorm "gorm.io/driver/postgres"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"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 {
sql.Driver
}
// New postgres datastore instance
func New(ctx context.Context, cfg datastore.Config) (datastore.DataStore, error) {
db, err := gorm.Open(postgresorm.Open(cfg.URL), &gorm.Config{
NamingStrategy: sqlnamer.SQLNamer{},
DisableForeignKeyConstraintWhenMigrating: true,
Logger: logger.Default.LogMode(logger.Error),
TranslateError: true,
})
if err != nil {
return nil, err
}
for _, v := range model.GetRegisterModels() {
if err := db.WithContext(ctx).AutoMigrate(v); err != nil {
return nil, err
}
}
p := &postgres{
Driver: sql.Driver{
Client: *db.WithContext(ctx),
},
}
return p, nil
}

View File

@ -0,0 +1,40 @@
/*
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 postgres
import (
"context"
"testing"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
)
func TestPostgres(t *testing.T) {
_, err := New(context.TODO(), datastore.Config{
URL: "postgres://kubevela:Kubevela-123@127.0.0.1:5432/kubevela?sslmode=disable&client_encoding=UTF-8&connect_timeout=1",
Database: "kubevela",
})
if err != nil {
t.Fatal(err)
}
RegisterFailHandler(Fail)
RunSpecs(t, "Postgres Suite")
}

View File

@ -0,0 +1,50 @@
package postgres
/*
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.
*/
import (
"context"
"math/rand"
"time"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
postgresgorm "gorm.io/driver/postgres"
"gorm.io/gorm"
"github.com/kubevela/velaux/pkg/server/domain/model"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore"
)
var postgresDriver datastore.DataStore
var _ = BeforeSuite(func(ctx SpecContext) {
rand.Seed(time.Now().UnixNano())
By("bootstrapping postgres test environment")
db, err := gorm.Open(postgresgorm.Open("postgres://kubevela:Kubevela-123@127.0.0.1:5432/kubevela?sslmode=disable&client_encoding=UTF-8&connect_timeout=1"), &gorm.Config{})
Expect(err).ToNot(HaveOccurred())
for _, v := range model.GetRegisterModels() {
err := db.Migrator().DropTable(&v)
Expect(err).ToNot(HaveOccurred())
}
postgresDriver, err = New(context.TODO(), datastore.Config{
URL: "postgres://kubevela:Kubevela-123@127.0.0.1:5432/kubevela?sslmode=disable&client_encoding=UTF-8&connect_timeout=1",
Database: "kubevela",
})
Expect(err).ToNot(HaveOccurred())
Expect(postgresDriver).ToNot(BeNil())
By("create postgres driver success")
}, NodeTimeout(2*time.Minute))

View File

@ -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
}

View File

@ -0,0 +1,64 @@
/*
Copyright 2021 The KubeVela Authors.
Licenamered under the Apache Licenamere, Version 2.0 (the "Licenamere");
you may not use this file except in compliance with the Licenamere.
You may obtain a copy of the Licenamere at
http://www.apache.org/licenameres/LICEnamerE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the Licenamere is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIOnamer OF ANY KIND, either express or implied.
See the Licenamere for the specific language governing permissionamer and
limitationamer under the Licenamere.
*/
package sqlnamer
import (
"strings"
"gorm.io/gorm/schema"
)
// SQLNamer overrides the default naming conventions used by gorm
type SQLNamer struct {
// DefaultNamingStrategy to use the methods of the default NamingStrategy of gorm if modification not needed
DefaultNamingStrategy schema.NamingStrategy
}
// TableName convert string to table name
func (namer SQLNamer) TableName(str string) string {
return namer.DefaultNamingStrategy.TableName(str)
}
// SchemaName generate schema name from table name, don't guarantee it is the reverse value of TableName
func (namer SQLNamer) SchemaName(table string) string {
return namer.DefaultNamingStrategy.SchemaName(table)
}
// ColumnName overrides the DefaultNamingStrategy.ColumnName as it converts the column names to snake-case, but we need them in lowercase
func (namer SQLNamer) ColumnName(_, column string) string {
return strings.ToLower(column)
}
// JoinTableName convert string to join table name
func (namer SQLNamer) JoinTableName(str string) string {
return namer.DefaultNamingStrategy.JoinTableName(str)
}
// RelationshipFKName generate fk name for relation
func (namer SQLNamer) RelationshipFKName(rel schema.Relationship) string {
return namer.DefaultNamingStrategy.RelationshipFKName(rel)
}
// CheckerName generate checker name
func (namer SQLNamer) CheckerName(table, column string) string {
return namer.DefaultNamingStrategy.CheckerName(table, column)
}
// IndexName generate index name
func (namer SQLNamer) IndexName(table, column string) string {
return namer.DefaultNamingStrategy.IndexName(table, column)
}

View File

@ -466,7 +466,7 @@ func (c *application) GetWebServiceRoute() *restful.WebService {
Param(ws.QueryParameter("page", "query the page number").DataType("integer")).
Param(ws.QueryParameter("pageSize", "query the page size number").DataType("integer")).
Returns(200, "OK", apis.ListWorkflowRecordsResponse{}).
Writes(apis.ListWorkflowRecordsResponse{}).Do(returns200, returns500))
Writes(apis.ListWorkflowRecordsResponse{}).Do(returns500))
ws.Route(ws.GET("/{appName}/workflows").To(c.WorkflowAPI.listApplicationWorkflows).
Doc("list application workflow").
@ -475,7 +475,7 @@ func (c *application) GetWebServiceRoute() *restful.WebService {
Param(ws.PathParameter("appName", "identifier of the application.").DataType("string").Required(true)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Returns(200, "OK", apis.ListWorkflowResponse{}).
Writes(apis.ListWorkflowResponse{}).Do(returns200, returns500))
Writes(apis.ListWorkflowResponse{}).Do(returns500))
ws.Route(ws.POST("/{appName}/workflows").To(c.WorkflowAPI.createOrUpdateApplicationWorkflow).
Doc("create application workflow").
@ -486,7 +486,7 @@ func (c *application) GetWebServiceRoute() *restful.WebService {
Param(ws.PathParameter("appName", "identifier of the application.").DataType("string").Required(true)).
Returns(200, "create success", apis.DetailWorkflowResponse{}).
Returns(400, "create failure", bcode.Bcode{}).
Writes(apis.DetailWorkflowResponse{}).Do(returns200, returns500))
Writes(apis.DetailWorkflowResponse{}).Do(returns500))
ws.Route(ws.GET("/{appName}/workflows/{workflowName}").To(c.WorkflowAPI.detailWorkflow).
Doc("detail application workflow").
@ -494,11 +494,11 @@ 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{}).
Writes(apis.DetailWorkflowResponse{}).Do(returns200, returns500))
Writes(apis.DetailWorkflowResponse{}).Do(returns500))
ws.Route(ws.PUT("/{appName}/workflows/{workflowName}").To(c.WorkflowAPI.updateWorkflow).
Doc("update application workflow config").
@ -510,17 +510,16 @@ func (c *application) GetWebServiceRoute() *restful.WebService {
Param(ws.PathParameter("workflowName", "identifier of the workflow").DataType("string")).
Reads(apis.UpdateWorkflowRequest{}).
Returns(200, "OK", apis.DetailWorkflowResponse{}).
Writes(apis.DetailWorkflowResponse{}).Do(returns200, returns500))
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).
Filter(c.WorkflowAPI.workflowCheckFilter).
Param(ws.PathParameter("appName", "identifier of the application.").DataType("string").Required(true)).
Param(ws.PathParameter("workflowName", "identifier of the workflow").DataType("string")).
Returns(200, "OK", apis.EmptyResponse{}).
Writes(apis.EmptyResponse{}).Do(returns200, returns500))
ws.Route(ws.GET("/{appName}/workflows/{workflowName}/records").To(c.WorkflowAPI.listWorkflowRecords).
@ -534,7 +533,7 @@ func (c *application) GetWebServiceRoute() *restful.WebService {
Param(ws.QueryParameter("page", "query the page number").DataType("integer")).
Param(ws.QueryParameter("pageSize", "query the page size number").DataType("integer")).
Returns(200, "OK", apis.ListWorkflowRecordsResponse{}).
Writes(apis.ListWorkflowRecordsResponse{}).Do(returns200, returns500))
Writes(apis.ListWorkflowRecordsResponse{}).Do(returns500))
ws.Route(ws.GET("/{appName}/workflows/{workflowName}/records/{record}").To(c.WorkflowAPI.detailWorkflowRecord).
Doc("query application workflow execution record detail").
@ -546,7 +545,7 @@ func (c *application) GetWebServiceRoute() *restful.WebService {
Filter(c.appCheckFilter).
Filter(c.WorkflowAPI.workflowCheckFilter).
Returns(200, "OK", apis.DetailWorkflowRecordResponse{}).
Writes(apis.DetailWorkflowRecordResponse{}).Do(returns200, returns500))
Writes(apis.DetailWorkflowRecordResponse{}).Do(returns500))
ws.Route(ws.GET("/{appName}/workflows/{workflowName}/records/{record}/resume").To(c.WorkflowAPI.resumeWorkflowRecord).
Doc("resume suspend workflow record").
@ -684,16 +683,19 @@ func (c *application) createApplication(req *restful.Request, res *restful.Respo
// Verify the validity of parameters
var createReq apis.CreateApplicationRequest
if err := req.ReadEntity(&createReq); err != nil {
klog.Info("param err ", err)
bcode.ReturnError(req, res, err)
return
}
if err := validate.Struct(&createReq); err != nil {
klog.Info("validate struct err ", err)
bcode.ReturnError(req, res, err)
return
}
// Call the domain layer code
appBase, err := c.ApplicationService.CreateApplication(req.Request.Context(), createReq)
if err != nil {
klog.Info("Failure: ", err.Error())
klog.Errorf("create application failure %s", err.Error())
bcode.ReturnError(req, res, err)
return

View File

@ -59,13 +59,12 @@ func (c *CloudShell) GetWebServiceRoute() *restful.WebService {
Filter(c.RbacService.CheckPerm("cloudshell", "create")).
Returns(200, "OK", apis.CloudShellPrepareResponse{}).
Returns(400, "Bad Request", bcode.Bcode{}).
Writes(apis.CloudShellPrepareResponse{}).Do(returns200, returns500))
Writes(apis.CloudShellPrepareResponse{}).Do(returns500))
ws.Route(ws.DELETE("/").To(c.destroyCloudShell).
Doc("destroy the user's cloud shell environment").
Metadata(restfulspec.KeyOpenAPITags, tags).
Filter(c.RbacService.CheckPerm("cloudshell", "delete")).
Returns(200, "OK", apis.EmptyResponse{}).
Returns(400, "Bad Request", bcode.Bcode{}).
Writes(apis.EmptyResponse{}).Do(returns200, returns500))
@ -128,7 +127,6 @@ func (c *CloudShellView) GetWebServiceRoute() *restful.WebService {
Doc("prepare the user's cloud shell environment").
Metadata(restfulspec.KeyOpenAPITags, tags).
Filter(c.RbacService.CheckPerm("cloudshell", "create")).
Returns(200, "OK", apis.EmptyResponse{}).
Returns(400, "Bad Request", bcode.Bcode{}).
Writes(apis.EmptyResponse{}).Do(returns200, returns500))
@ -138,7 +136,6 @@ func (c *CloudShellView) GetWebServiceRoute() *restful.WebService {
Operation("proxyPath").
Param(ws.PathParameter("subpath", "subpath").DataType("string")).
Filter(c.RbacService.CheckPerm("cloudshell", "create")).
Returns(200, "OK", apis.EmptyResponse{}).
Returns(400, "Bad Request", bcode.Bcode{}).
Writes(apis.EmptyResponse{}).Do(returns200, returns500))
@ -164,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
},
}

View File

@ -56,7 +56,7 @@ func (c *Cluster) GetWebServiceRoute() *restful.WebService {
Param(ws.QueryParameter("pageSize", "PageSize for paging").DataType("integer").DefaultValue("20")).
Returns(200, "OK", apis.ListClusterResponse{}).
Returns(400, "Bad Request", bcode.Bcode{}).
Writes(apis.ListClusterResponse{}).Do(returns200, returns500))
Writes(apis.ListClusterResponse{}).Do(returns500))
ws.Route(ws.POST("/").To(c.createKubeCluster).
Doc("create cluster").

View File

@ -54,7 +54,7 @@ func (d *definition) GetWebServiceRoute() *restful.WebService {
Param(ws.QueryParameter("ownerAddon", "query by which addon created the definition").DataType("string")).
Param(ws.QueryParameter("scope", "query by the specified scope like WorkflowRun or Application").DataType("string")).
Returns(200, "OK", apis.ListDefinitionResponse{}).
Writes(apis.ListDefinitionResponse{}).Do(returns200, returns500))
Writes(apis.ListDefinitionResponse{}).Do(returns500))
ws.Route(ws.GET("/{definitionName}").To(d.detailDefinition).
Doc("Detail a definition").
@ -63,7 +63,7 @@ func (d *definition) GetWebServiceRoute() *restful.WebService {
Param(ws.QueryParameter("type", "query the definition type").DataType("string")).
Metadata(restfulspec.KeyOpenAPITags, tags).
Returns(200, "create successfully", apis.DetailDefinitionResponse{}).
Writes(apis.DetailDefinitionResponse{}).Do(returns200, returns500))
Writes(apis.DetailDefinitionResponse{}).Do(returns500))
ws.Route(ws.PUT("/{definitionName}/uischema").To(d.updateUISchema).
Doc("Update the UI schema for a definition").
@ -72,7 +72,7 @@ func (d *definition) GetWebServiceRoute() *restful.WebService {
Param(ws.PathParameter("definitionName", "identifier of the definition").DataType("string").Required(true)).
Reads(apis.UpdateUISchemaRequest{}).
Returns(200, "update successfully", schema.UISchema{}).
Writes(apis.DetailDefinitionResponse{}).Do(returns200, returns500))
Writes(apis.DetailDefinitionResponse{}).Do(returns500))
ws.Route(ws.PUT("/{definitionName}/status").To(d.updateDefinitionStatus).
Doc("Update the status for a definition").
@ -81,7 +81,7 @@ func (d *definition) GetWebServiceRoute() *restful.WebService {
Param(ws.PathParameter("definitionName", "identifier of the definition").DataType("string").Required(true)).
Reads(apis.UpdateDefinitionStatusRequest{}).
Returns(200, "update successfully", schema.UISchema{}).
Writes(apis.DetailDefinitionResponse{}).Do(returns200, returns500))
Writes(apis.DetailDefinitionResponse{}).Do(returns500))
ws.Filter(authCheckFilter)
return ws

View File

@ -662,7 +662,7 @@ type HandleApplicationTriggerJFrogRequest struct {
// JFrogWebhookData is the data of JFrog webhook request
type JFrogWebhookData struct {
URL string
URL string `json:"url"`
ImageName string `json:"image_name"`
Name string `json:"name"`
Path string `json:"path"`

View File

@ -61,13 +61,14 @@ func (p *Plugin) GetWebServiceRoute() *restful.WebService {
Doc("List the enabled plugins").
Metadata(restfulspec.KeyOpenAPITags, tags).
Returns(200, "OK", apis.ListPluginResponse{}).
Writes(apis.ListPluginResponse{}).Do(returns200, returns500))
Writes(apis.ListPluginResponse{}).Do(returns500))
ws.Route(ws.GET("/{pluginId}").To(p.detailPlugin).
Doc("Detail an installed plugin").
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.PathParameter("pluginId", "identifier of the plugin.").DataType("string")).
Returns(200, "OK", apis.PluginDTO{}).
Writes(apis.PluginDTO{}).Do(returns200, returns500))
Writes(apis.PluginDTO{}).Do(returns500))
ws.Filter(authCheckFilter)
return ws
@ -88,51 +89,57 @@ func (p *ManagePlugin) GetWebServiceRoute() *restful.WebService {
Metadata(restfulspec.KeyOpenAPITags, tags).
Filter(p.RBACService.CheckPerm("managePlugin", "list")).
Returns(200, "OK", apis.ListPluginResponse{}).
Writes(apis.ListManagedPluginResponse{}).Do(returns200, returns500))
Writes(apis.ListPluginResponse{}).Do(returns500))
ws.Route(ws.GET("/{pluginId}").To(p.detailPlugin).
Doc("Detail an installed plugin").
Metadata(restfulspec.KeyOpenAPITags, tags).
Filter(p.RBACService.CheckPerm("managePlugin", "detail")).
Param(ws.PathParameter("pluginId", "identifier of the plugin.").DataType("string")).
Returns(200, "OK", apis.ManagedPluginDTO{}).
Writes(apis.PluginDTO{}).Do(returns200, returns500))
Writes(apis.PluginDTO{}).Do(returns500))
ws.Route(ws.POST("/{pluginId}/setting").To(p.pluginSetting).
Doc("Set an installed plugin").
Metadata(restfulspec.KeyOpenAPITags, tags).
Filter(p.RBACService.CheckPerm("managePlugin", "update")).
Param(ws.PathParameter("pluginId", "identifier of the plugin.").DataType("string")).
Returns(200, "OK", apis.ManagedPluginDTO{}).
Writes(apis.PluginDTO{}).Do(returns200, returns500))
Writes(apis.PluginDTO{}).Do(returns500))
ws.Route(ws.POST("/{pluginId}/install").To(p.installPlugin).
Doc("Install one specific plugin").
Metadata(restfulspec.KeyOpenAPITags, tags).
Reads(apis.InstallPluginRequest{}).
Filter(p.RBACService.CheckPerm("managePlugin", "enable")).
Param(ws.PathParameter("pluginId", "identifier of the plugin.").DataType("string")).
Returns(200, "OK", apis.ManagedPluginDTO{}).
Writes(apis.PluginDTO{}).Do(returns200, returns500))
Writes(apis.PluginDTO{}).Do(returns500))
ws.Route(ws.POST("/{pluginId}/uninstall").To(p.uninstallPlugin).
Doc("Uninstall one specific plugin").
Metadata(restfulspec.KeyOpenAPITags, tags).
Filter(p.RBACService.CheckPerm("managePlugin", "enable")).
Returns(200, "OK", struct{}{}).
Writes(apis.PluginDTO{}).Do(returns200, returns500))
Param(ws.PathParameter("pluginId", "identifier of the plugin.").DataType("string")).
Returns(200, "OK", apis.EmptyResponse{}).
Writes(apis.PluginDTO{}).Do(returns500))
ws.Route(ws.POST("/{pluginId}/enable").To(p.enablePlugin).
Doc("Enable an installed plugin").
Metadata(restfulspec.KeyOpenAPITags, tags).
Reads(apis.PluginEnableRequest{}).
Filter(p.RBACService.CheckPerm("managePlugin", "enable")).
Param(ws.PathParameter("pluginId", "identifier of the plugin.").DataType("string")).
Returns(200, "OK", apis.ManagedPluginDTO{}).
Writes(apis.PluginDTO{}).Do(returns200, returns500))
Writes(apis.PluginDTO{}).Do(returns500))
ws.Route(ws.POST("/{pluginId}/disable").To(p.disablePlugin).
Doc("Disable an installed plugin").
Metadata(restfulspec.KeyOpenAPITags, tags).
Filter(p.RBACService.CheckPerm("managePlugin", "enable")).
Param(ws.PathParameter("pluginId", "identifier of the plugin.").DataType("string")).
Returns(200, "OK", apis.ManagedPluginDTO{}).
Writes(apis.PluginDTO{}).Do(returns200, returns500))
Writes(apis.PluginDTO{}).Do(returns500))
ws.Filter(authCheckFilter)
return ws
@ -205,6 +212,7 @@ func (p *ManagePlugin) uninstallPlugin(req *restful.Request, res *restful.Respon
}
func (p *ManagePlugin) detailPlugin(req *restful.Request, res *restful.Response) {
plugin, err := p.PluginService.DetailInstalledPlugin(req.Request.Context(), req.PathParameter("pluginId"))
if err != nil {
bcode.ReturnError(req, res, err)

View File

@ -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{}{}))

View File

@ -64,7 +64,7 @@ func (dt *Target) GetWebServiceRoute() *restful.WebService {
Param(ws.QueryParameter("pageSize", "PageSize for paging").DataType("integer")).
Param(ws.QueryParameter("project", "list targets by project name").DataType("string")).
Returns(200, "OK", apis.ListTargetResponse{}).
Writes(apis.ListTargetResponse{}).Do(returns200, returns500))
Writes(apis.ListTargetResponse{}).Do(returns500))
ws.Route(ws.POST("/").To(dt.createTarget).
Doc("create Target").
@ -73,7 +73,7 @@ func (dt *Target) GetWebServiceRoute() *restful.WebService {
Filter(dt.RbacService.CheckPerm("target", "create")).
Returns(200, "create success", apis.DetailTargetResponse{}).
Returns(400, "create failure", bcode.Bcode{}).
Writes(apis.DetailTargetResponse{}).Do(returns200, returns500))
Writes(apis.DetailTargetResponse{}).Do(returns500))
ws.Route(ws.GET("/{targetName}").To(dt.detailTarget).
Doc("detail Target").
@ -82,7 +82,7 @@ func (dt *Target) GetWebServiceRoute() *restful.WebService {
Filter(dt.targetCheckFilter).
Filter(dt.RbacService.CheckPerm("target", "detail")).
Returns(200, "create success", apis.DetailTargetResponse{}).
Writes(apis.DetailTargetResponse{}).Do(returns200, returns500))
Writes(apis.DetailTargetResponse{}).Do(returns500))
ws.Route(ws.PUT("/{targetName}").To(dt.updateTarget).
Doc("update application Target config").
@ -92,15 +92,14 @@ func (dt *Target) GetWebServiceRoute() *restful.WebService {
Reads(apis.UpdateTargetRequest{}).
Filter(dt.RbacService.CheckPerm("target", "update")).
Returns(200, "OK", apis.DetailTargetResponse{}).
Writes(apis.DetailTargetResponse{}).Do(returns200, returns500))
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")).
Param(ws.PathParameter("targetName", "identifier of the Target").DataType("string")).
Returns(200, "OK", apis.EmptyResponse{}).
Writes(apis.EmptyResponse{}).Do(returns200, returns500))
ws.Filter(authCheckFilter)

View File

@ -205,7 +205,7 @@ func (w *Workflow) detailWorkflowRecord(req *restful.Request, res *restful.Respo
func (w *Workflow) resumeWorkflowRecord(req *restful.Request, res *restful.Response) {
app := req.Request.Context().Value(&apis.CtxKeyApplication).(*model.Application)
workflow := req.Request.Context().Value(&apis.CtxKeyWorkflow).(*model.Workflow)
err := w.WorkflowService.ResumeRecord(req.Request.Context(), app, workflow, req.PathParameter("record"), req.QueryParameter("step"))
err := w.WorkflowService.ResumeWorkflow(req.Request.Context(), app, workflow, req.QueryParameter("step"))
if err != nil {
bcode.ReturnError(req, res, err)
return
@ -219,7 +219,7 @@ func (w *Workflow) resumeWorkflowRecord(req *restful.Request, res *restful.Respo
func (w *Workflow) terminateWorkflowRecord(req *restful.Request, res *restful.Response) {
app := req.Request.Context().Value(&apis.CtxKeyApplication).(*model.Application)
workflow := req.Request.Context().Value(&apis.CtxKeyWorkflow).(*model.Workflow)
err := w.WorkflowService.TerminateRecord(req.Request.Context(), app, workflow, req.PathParameter("record"))
err := w.WorkflowService.TerminateWorkflow(req.Request.Context(), app, workflow)
if err != nil {
bcode.ReturnError(req, res, err)
return

View File

@ -55,6 +55,7 @@ import (
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/kubeapi"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/mongodb"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/mysql"
"github.com/kubevela/velaux/pkg/server/infrastructure/datastore/postgres"
"github.com/kubevela/velaux/pkg/server/interfaces/api"
"github.com/kubevela/velaux/pkg/server/utils"
"github.com/kubevela/velaux/pkg/server/utils/bcode"
@ -147,6 +148,11 @@ func (s *restServer) buildIoCContainer() error {
if err != nil {
return fmt.Errorf("create mysql datastore instance failure %w", err)
}
case "postgres":
ds, err = postgres.New(context.Background(), s.cfg.Datastore)
if err != nil {
return fmt.Errorf("create postgres datastore instance failure %w", err)
}
default:
return fmt.Errorf("not support datastore type %s", s.cfg.Datastore.Type)
}
@ -185,7 +191,7 @@ func (s *restServer) buildIoCContainer() error {
}
// event
if err := s.beanContainer.Provides(event.InitEvent(s.cfg)...); err != nil {
if err := s.beanContainer.Provides(event.InitEvent()...); err != nil {
return fmt.Errorf("fail to provides the event bean to the container: %w", err)
}
@ -247,7 +253,9 @@ func (s *restServer) setupLeaderElection(errChan chan error) (*leaderelection.Le
go event.StartEventWorker(ctx, errChan)
},
OnStoppedLeading: func() {
errChan <- fmt.Errorf("leader lost %s", s.cfg.LeaderConfig.ID)
if s.cfg.ExitOnLostLeader {
errChan <- fmt.Errorf("leader lost %s", s.cfg.LeaderConfig.ID)
}
},
OnNewLeader: func(identity string) {
if identity == s.cfg.LeaderConfig.ID {

View File

@ -51,9 +51,9 @@ var ErrUpstreamNotFound = NewBcode(502, 502, "Upstream not found")
// Bcode business error code
type Bcode struct {
HTTPCode int32 `json:"-"`
BusinessCode int32
Message string
HTTPCode int32 `json:"-"`
BusinessCode int32 `json:"BusinessCode"`
Message string `json:"Message"`
}
func (b *Bcode) Error() string {

View File

@ -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
@ -26065,11 +26065,11 @@ __metadata:
linkType: hard
"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.4.1, semver@npm:^5.5.0, semver@npm:^5.5.1, semver@npm:^5.6.0":
version: 5.7.1
resolution: "semver@npm:5.7.1"
version: 5.7.2
resolution: "semver@npm:5.7.2"
bin:
semver: ./bin/semver
checksum: 57fd0acfd0bac382ee87cd52cd0aaa5af086a7dc8d60379dfe65fea491fb2489b6016400813930ecd61fd0952dae75c115287a1b16c234b1550887117744dfaf
semver: bin/semver
checksum: fb4ab5e0dd1c22ce0c937ea390b4a822147a9c53dbd2a9a0132f12fe382902beef4fbf12cf51bb955248d8d15874ce8cd89532569756384f994309825f10b686
languageName: node
linkType: hard
@ -29814,9 +29814,9 @@ __metadata:
linkType: hard
"word-wrap@npm:^1.2.3, word-wrap@npm:~1.2.3":
version: 1.2.3
resolution: "word-wrap@npm:1.2.3"
checksum: 30b48f91fcf12106ed3186ae4fa86a6a1842416df425be7b60485de14bec665a54a68e4b5156647dec3a70f25e84d270ca8bc8cd23182ed095f5c7206a938c1f
version: 1.2.4
resolution: "word-wrap@npm:1.2.4"
checksum: 8f1f2e0a397c0e074ca225ba9f67baa23f99293bc064e31355d426ae91b8b3f6b5f6c1fc9ae5e9141178bb362d563f55e62fd8d5c31f2a77e3ade56cb3e35bd1
languageName: node
linkType: hard