Compare commits
279 Commits
fix/files_
...
fix/files-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6446f56053 | ||
|
|
351d8a5143 | ||
|
|
04e84a68c0 | ||
|
|
3fd82f150e | ||
|
|
851745f60c | ||
|
|
43f7b6533d | ||
|
|
de0c1dd9f4 | ||
|
|
a6407f12e1 | ||
|
|
7219cbab11 | ||
|
|
d3d6165f5b | ||
|
|
e91f3b56f1 | ||
|
|
3834e88367 | ||
|
|
764138452b | ||
|
|
f0223eff6a | ||
|
|
4f3effb53e | ||
|
|
fc655b5c32 | ||
|
|
c4c8d614b6 | ||
|
|
1d4e637900 | ||
|
|
c570fd3204 | ||
|
|
81a8ca53fa | ||
|
|
4e08bf6d3f | ||
|
|
93a20fa397 | ||
|
|
255af9e472 | ||
|
|
fdf73c0b6c | ||
|
|
e0f886b2b9 | ||
|
|
decde7860b | ||
|
|
d08f9ceb05 | ||
|
|
03e0aed624 | ||
|
|
e6589f02c3 | ||
|
|
2c3964b15a | ||
|
|
66e1055191 | ||
|
|
e6153e1d57 | ||
|
|
bacc6b6517 | ||
|
|
1a71ce2650 | ||
|
|
07d8b20757 | ||
|
|
ecb9de98ed | ||
|
|
ed2851fd0f | ||
|
|
4d9d566f75 | ||
|
|
c9962d1d19 | ||
|
|
cb81cbe944 | ||
|
|
5282626a7d | ||
|
|
fa0886c625 | ||
|
|
29e44fc522 | ||
|
|
05bae3cf41 | ||
|
|
fc0da7febe | ||
|
|
38d3dcb3d4 | ||
|
|
a6b97849b8 | ||
|
|
c40d7a8ee6 | ||
|
|
69f24d8f2d | ||
|
|
6f1992bcc1 | ||
|
|
2bf1de5491 | ||
|
|
c2a03c061b | ||
|
|
c4970b3673 | ||
|
|
ad6a680388 | ||
|
|
e38f7bb6a9 | ||
|
|
8b103f0a37 | ||
|
|
118ae24660 | ||
|
|
72a063cf23 | ||
|
|
e266ee72e7 | ||
|
|
46e9870609 | ||
|
|
f1f3ac1217 | ||
|
|
9743336af9 | ||
|
|
f709cb95c8 | ||
|
|
34098ac6a0 | ||
|
|
7f0b701cf0 | ||
|
|
a17f8d6fed | ||
|
|
f0f5c84498 | ||
|
|
a9263fba66 | ||
|
|
bb23e4008b | ||
|
|
5324ab2b73 | ||
|
|
10d15a6018 | ||
|
|
b0a07e08d7 | ||
|
|
534a731227 | ||
|
|
c0f47532fb | ||
|
|
13c0234f8d | ||
|
|
1d84f1d436 | ||
|
|
d5bbc1d32f | ||
|
|
32313bff41 | ||
|
|
ddabce2df4 | ||
|
|
8044c88e5d | ||
|
|
3dbb633fda | ||
|
|
dd5e7bdd34 | ||
|
|
17942932c8 | ||
|
|
34318ee303 | ||
|
|
1537ff9613 | ||
|
|
d8d858be63 | ||
|
|
ade0f4b77b | ||
|
|
b401eb8485 | ||
|
|
97768f082c | ||
|
|
d60f44e178 | ||
|
|
037de51e98 | ||
|
|
3feff71488 | ||
|
|
a7368d4a78 | ||
|
|
c8ad615891 | ||
|
|
2af5ca1494 | ||
|
|
2870ba8510 | ||
|
|
245e794075 | ||
|
|
55c04e26d6 | ||
|
|
bf1911e3b4 | ||
|
|
a3b709ef0c | ||
|
|
15335e8114 | ||
|
|
82ed4be5af | ||
|
|
dab5a26b2b | ||
|
|
959a32b68f | ||
|
|
c5215471b7 | ||
|
|
226eaeb9e7 | ||
|
|
9b85411fce | ||
|
|
053a0d1b8e | ||
|
|
aa34dc4412 | ||
|
|
54155edbbf | ||
|
|
a776efa62e | ||
|
|
ada4d129f6 | ||
|
|
dfb7c5bcc4 | ||
|
|
a5b9696d16 | ||
|
|
1870859034 | ||
|
|
25854d1b14 | ||
|
|
cfb4bf93be | ||
|
|
1571bd82d9 | ||
|
|
324456b653 | ||
|
|
b64e2bd19e | ||
|
|
b49b59e07c | ||
|
|
5dcb0ee7e9 | ||
|
|
37b9afe7d5 | ||
|
|
9219fca0ad | ||
|
|
9dd72f2c42 | ||
|
|
9227d9f04e | ||
|
|
41e701b929 | ||
|
|
7503eb7f42 | ||
|
|
0b84f278af | ||
|
|
62cec2de53 | ||
|
|
ad183f05ce | ||
|
|
8dea896a28 | ||
|
|
b62a264c38 | ||
|
|
a030b047b4 | ||
|
|
86083ce63c | ||
|
|
ab0ba8fde6 | ||
|
|
a6c44cf29e | ||
|
|
dda43a49ae | ||
|
|
cad4c09cd4 | ||
|
|
0a39b03fbb | ||
|
|
b1c525d0dc | ||
|
|
2b45ef7bcf | ||
|
|
060d57a2b9 | ||
|
|
496ed1c6fb | ||
|
|
4c912e1485 | ||
|
|
c313982033 | ||
|
|
83e070761c | ||
|
|
beed97f704 | ||
|
|
116fa8df72 | ||
|
|
7fa1f093ed | ||
|
|
65ca835684 | ||
|
|
fd4b0e3a92 | ||
|
|
1ec300360c | ||
|
|
fc0781580e | ||
|
|
88bff41d83 | ||
|
|
7d758befde | ||
|
|
a8e074bec1 | ||
|
|
12302696c8 | ||
|
|
3edef07ebe | ||
|
|
170492b733 | ||
|
|
b5f2d4baa5 | ||
|
|
358dc9a957 | ||
|
|
c6cf22f3a2 | ||
|
|
cd6d502f4a | ||
|
|
0b05f33f52 | ||
|
|
995f03ea7b | ||
|
|
c4ed5c6d15 | ||
|
|
992a2bd343 | ||
|
|
f8205f0b7a | ||
|
|
121a8009ea | ||
|
|
d6dff36e35 | ||
|
|
8913e10e7b | ||
|
|
faa655f928 | ||
|
|
df6d9c440d | ||
|
|
1f2fd0619f | ||
|
|
9dbb52dedc | ||
|
|
a08c8129ab | ||
|
|
fe86ef0190 | ||
|
|
ba13d6092b | ||
|
|
8180024d6d | ||
|
|
c05f82c4bb | ||
|
|
604b2191ce | ||
|
|
518d2a41ea | ||
|
|
bf292e2f55 | ||
|
|
896c6d76f9 | ||
|
|
ee4655d991 | ||
|
|
261bf0f9e0 | ||
|
|
48776c32bf | ||
|
|
9bbf270eb3 | ||
|
|
bab83ed0b3 | ||
|
|
62faa3e3b7 | ||
|
|
e9346f04c1 | ||
|
|
1df5121a4e | ||
|
|
2ecfc976d7 | ||
|
|
c38e00a825 | ||
|
|
8c801b8392 | ||
|
|
eaceeef30b | ||
|
|
339b375a89 | ||
|
|
b5b9d19bc3 | ||
|
|
0bcb2cd893 | ||
|
|
2b46e87baa | ||
|
|
d0351aed9c | ||
|
|
021338b4b7 | ||
|
|
d374133dd4 | ||
|
|
c330589424 | ||
|
|
a690b5a852 | ||
|
|
abc6bc01a6 | ||
|
|
a0513a8e6f | ||
|
|
b61a3233bb | ||
|
|
5b3072dc6f | ||
|
|
2cc580a453 | ||
|
|
3e63c3f34c | ||
|
|
d80fbfb5e5 | ||
|
|
cea8f8bd1b | ||
|
|
7cce5ec761 | ||
|
|
b705bb0814 | ||
|
|
7fcfb2139b | ||
|
|
f267639a82 | ||
|
|
42a10225cc | ||
|
|
39e3d453e2 | ||
|
|
96334c89af | ||
|
|
eb774e6e06 | ||
|
|
8be967ebf3 | ||
|
|
8f2a98745a | ||
|
|
e7303b0554 | ||
|
|
9aee9453fc | ||
|
|
c480beb4de | ||
|
|
8998dd48cf | ||
|
|
ed3713bd37 | ||
|
|
47bd343c6b | ||
|
|
931f2992f4 | ||
|
|
b3d8a2e718 | ||
|
|
0e2a5d7c0e | ||
|
|
3035453f8c | ||
|
|
267d92607c | ||
|
|
dce43cd081 | ||
|
|
3826c64e48 | ||
|
|
e398150e01 | ||
|
|
694c472aad | ||
|
|
62db7fe18a | ||
|
|
7e1674aa77 | ||
|
|
72d804b0c9 | ||
|
|
a91b20b7a0 | ||
|
|
fa92825ce9 | ||
|
|
0e04f416d7 | ||
|
|
e43055b0f3 | ||
|
|
f918614bd2 | ||
|
|
12f19b7d46 | ||
|
|
5c8f3ea2ff | ||
|
|
9b7635f244 | ||
|
|
a949e317ac | ||
|
|
f362396514 | ||
|
|
d4a1a44e39 | ||
|
|
95fdffb24f | ||
|
|
4c72114a4d | ||
|
|
e28371551b | ||
|
|
ef01c331e9 | ||
|
|
40b29d12d6 | ||
|
|
506bd3bc1d | ||
|
|
9d097f77b1 | ||
|
|
a71b536a80 | ||
|
|
8eb2d86f56 | ||
|
|
ea0404fe2b | ||
|
|
af8e3b172c | ||
|
|
e00018de59 | ||
|
|
6bba107fdd | ||
|
|
ffb96bcbfc | ||
|
|
a6e4a73af2 | ||
|
|
61d3dedbfd | ||
|
|
962e251691 | ||
|
|
b37adf2521 | ||
|
|
460603ae69 | ||
|
|
1197860c29 | ||
|
|
417c4b520b | ||
|
|
e1fa887e6c | ||
|
|
b2e84cfd21 | ||
|
|
e8f0054b4f | ||
|
|
cd6c89f724 | ||
|
|
3d3d85ca3e |
12
.github/workflows/check.yaml
vendored
12
.github/workflows/check.yaml
vendored
@@ -3,8 +3,12 @@ name: Lint and Test Charts
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "release-*" ]
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
pull_request_target:
|
||||
branches: [ "main", "release-*" ]
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -55,7 +59,7 @@ jobs:
|
||||
steps:
|
||||
- id: generate
|
||||
run: |
|
||||
v=1.12.0-$(echo $RANDOM)
|
||||
v=1.12.2-$(echo $RANDOM$RANDOM)
|
||||
echo "version=$v" >> "$GITHUB_OUTPUT"
|
||||
|
||||
upload-cli:
|
||||
@@ -99,6 +103,12 @@ jobs:
|
||||
runs-on: [self-hosted, linux, ARM64]
|
||||
|
||||
steps:
|
||||
- name: Install skopeo (Ubuntu)
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y skopeo
|
||||
|
||||
|
||||
- name: 'Checkout source code'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
|
||||
7
.github/workflows/release-cli.yaml
vendored
7
.github/workflows/release-cli.yaml
vendored
@@ -10,6 +10,8 @@ on:
|
||||
type: string
|
||||
repository:
|
||||
type: string
|
||||
release-id:
|
||||
type: string
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
@@ -19,6 +21,8 @@ on:
|
||||
type: string
|
||||
repository:
|
||||
type: string
|
||||
release-id:
|
||||
type: string
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -53,6 +57,7 @@ jobs:
|
||||
version: v1.18.2
|
||||
args: release --clean
|
||||
env:
|
||||
OLARES_RELEASE_ID: ${{ inputs.release-id }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload to S3
|
||||
@@ -61,6 +66,6 @@ jobs:
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: "us-east-1"
|
||||
run: |
|
||||
cd cli/output && for file in *.tar.gz; do
|
||||
cd cli/output && for file in $(ls *.tar.gz | grep -v no-release-id); do
|
||||
aws s3 cp "$file" s3://terminus-os-install${{ secrets.REPO_PATH }}${file} --acl=public-read
|
||||
done
|
||||
|
||||
8
.github/workflows/release-daemon.yaml
vendored
8
.github/workflows/release-daemon.yaml
vendored
@@ -10,6 +10,8 @@ on:
|
||||
type: string
|
||||
repository:
|
||||
type: string
|
||||
release-id:
|
||||
type: string
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
@@ -19,6 +21,8 @@ on:
|
||||
type: string
|
||||
repository:
|
||||
type: string
|
||||
release-id:
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
@@ -52,6 +56,8 @@ jobs:
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v3.1.0
|
||||
env:
|
||||
OLARES_RELEASE_ID: ${{ inputs.release-id }}
|
||||
with:
|
||||
distribution: goreleaser
|
||||
workdir: './daemon'
|
||||
@@ -64,6 +70,6 @@ jobs:
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: 'us-east-1'
|
||||
run: |
|
||||
cd daemon/output && for file in *.tar.gz; do
|
||||
cd daemon/output && for file in $(ls *.tar.gz | grep -v no-release-id); do
|
||||
aws s3 cp "$file" s3://terminus-os-install${{ secrets.REPO_PATH }}${file} --acl=public-read
|
||||
done
|
||||
|
||||
47
.github/workflows/release-daily.yaml
vendored
47
.github/workflows/release-daily.yaml
vendored
@@ -17,22 +17,36 @@ jobs:
|
||||
steps:
|
||||
- id: generate
|
||||
run: |
|
||||
v=1.12.0-$(date +"%Y%m%d")
|
||||
v=1.12.2-$(date +"%Y%m%d")
|
||||
echo "version=$v" >> "$GITHUB_OUTPUT"
|
||||
|
||||
release-id:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
id: ${{ steps.generate.outputs.id }}
|
||||
steps:
|
||||
- name: 'Checkout source code'
|
||||
uses: actions/checkout@v3
|
||||
- id: generate
|
||||
run: |
|
||||
hash=$(git rev-parse --short=7 HEAD)
|
||||
echo "id=$hash" >> "$GITHUB_OUTPUT"
|
||||
|
||||
release-cli:
|
||||
needs: daily-version
|
||||
needs: [daily-version, release-id]
|
||||
uses: ./.github/workflows/release-cli.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
version: ${{ needs.daily-version.outputs.version }}
|
||||
release-id: ${{ needs.release-id.outputs.id }}
|
||||
|
||||
release-daemon:
|
||||
needs: daily-version
|
||||
needs: [daily-version, release-id]
|
||||
uses: ./.github/workflows/release-daemon.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
version: ${{ needs.daily-version.outputs.version }}
|
||||
release-id: ${{ needs.release-id.outputs.id }}
|
||||
|
||||
push-images:
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -64,7 +78,7 @@ jobs:
|
||||
bash build/image-manifest.sh && bash build/upload-images.sh .manifest/images.mf linux/arm64
|
||||
|
||||
push-deps:
|
||||
needs: [daily-version, release-daemon]
|
||||
needs: [daily-version, release-id, release-daemon]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -77,12 +91,13 @@ jobs:
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: "us-east-1"
|
||||
VERSION: ${{ needs.daily-version.outputs.version }}
|
||||
RELEASE_ID: ${{ needs.release-id.outputs.id }}
|
||||
REPO_PATH: '${{ secrets.REPO_PATH }}'
|
||||
run: |
|
||||
bash build/deps-manifest.sh && bash build/upload-deps.sh
|
||||
|
||||
push-deps-arm64:
|
||||
needs: [daily-version, release-daemon]
|
||||
needs: [daily-version, release-id, release-daemon]
|
||||
runs-on: [self-hosted, linux, ARM64]
|
||||
|
||||
steps:
|
||||
@@ -95,6 +110,7 @@ jobs:
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: "us-east-1"
|
||||
VERSION: ${{ needs.daily-version.outputs.version }}
|
||||
RELEASE_ID: ${{ needs.release-id.outputs.id }}
|
||||
REPO_PATH: '${{ secrets.REPO_PATH }}'
|
||||
run: |
|
||||
export PATH=$PATH:/usr/local/bin:/home/ubuntu/.local/bin
|
||||
@@ -102,10 +118,8 @@ jobs:
|
||||
|
||||
|
||||
upload-package:
|
||||
needs: [daily-version, push-images, push-images-arm64, push-deps, push-deps-arm64]
|
||||
needs: [daily-version, release-id, push-images, push-images-arm64, push-deps, push-deps-arm64]
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
md5sum: ${{ steps.upload.outputs.md5sum }}
|
||||
|
||||
steps:
|
||||
- name: 'Checkout source code'
|
||||
@@ -113,7 +127,7 @@ jobs:
|
||||
|
||||
- name: Package installer
|
||||
run: |
|
||||
bash build/build.sh ${{ needs.daily-version.outputs.version }}
|
||||
bash build/build.sh ${{ needs.daily-version.outputs.version }} ${{ needs.release-id.outputs.id }}
|
||||
|
||||
- name: Upload to S3
|
||||
id: upload
|
||||
@@ -125,27 +139,22 @@ jobs:
|
||||
md5sum install-wizard-v${{ needs.daily-version.outputs.version }}.tar.gz > install-wizard-v${{ needs.daily-version.outputs.version }}.md5sum.txt && \
|
||||
aws s3 cp install-wizard-v${{ needs.daily-version.outputs.version }}.md5sum.txt s3://terminus-os-install${{ secrets.REPO_PATH }}install-wizard-v${{ needs.daily-version.outputs.version }}.md5sum.txt --acl=public-read && \
|
||||
aws s3 cp install-wizard-v${{ needs.daily-version.outputs.version }}.tar.gz s3://terminus-os-install${{ secrets.REPO_PATH }}install-wizard-v${{ needs.daily-version.outputs.version }}.tar.gz --acl=public-read && \
|
||||
echo "md5sum=$(awk '{print $1}' install-wizard-v${{ needs.daily-version.outputs.version }}.md5sum.txt)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
aws s3 cp install-wizard-v${{ needs.daily-version.outputs.version }}.md5sum.txt s3://terminus-os-install${{ secrets.REPO_PATH }}install-wizard-v${{ needs.daily-version.outputs.version }}.${{ needs.release-id.outputs.id }}.md5sum.txt --acl=public-read && \
|
||||
aws s3 cp install-wizard-v${{ needs.daily-version.outputs.version }}.tar.gz s3://terminus-os-install${{ secrets.REPO_PATH }}install-wizard-v${{ needs.daily-version.outputs.version }}.${{ needs.release-id.outputs.id }}.tar.gz --acl=public-read
|
||||
|
||||
|
||||
release:
|
||||
needs: [daily-version, upload-package]
|
||||
needs: [daily-version, upload-package, release-cli, release-id]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 'Checkout source code'
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Update checksum
|
||||
uses: eball/write-tag-to-version-file@latest
|
||||
with:
|
||||
filename: 'build/base-package/install.sh'
|
||||
placeholder: '#__MD5SUM__'
|
||||
tag: ${{ needs.upload-package.outputs.md5sum }}
|
||||
|
||||
- name: Package installer
|
||||
run: |
|
||||
bash build/build.sh ${{ needs.daily-version.outputs.version }}
|
||||
bash build/build.sh ${{ needs.daily-version.outputs.version }} ${{ needs.release-id.outputs.id }}
|
||||
|
||||
- name: 'Archives'
|
||||
run: |
|
||||
|
||||
75
.github/workflows/release.yaml
vendored
75
.github/workflows/release.yaml
vendored
@@ -10,18 +10,36 @@ on:
|
||||
|
||||
jobs:
|
||||
|
||||
release-id:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
id: ${{ steps.generate.outputs.id }}
|
||||
steps:
|
||||
- name: 'Checkout source code'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.inputs.tags }}
|
||||
- id: generate
|
||||
run: |
|
||||
hash=$(git rev-parse --short=7 HEAD)
|
||||
echo "id=$hash" >> "$GITHUB_OUTPUT"
|
||||
|
||||
release-cli:
|
||||
needs: [release-id]
|
||||
uses: ./.github/workflows/release-cli.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
version: ${{ github.event.inputs.tags }}
|
||||
release-id: ${{ needs.release-id.outputs.id }}
|
||||
ref: ${{ github.event.inputs.tags }}
|
||||
|
||||
release-daemon:
|
||||
needs: [release-id]
|
||||
uses: ./.github/workflows/release-daemon.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
version: ${{ github.event.inputs.tags }}
|
||||
release-id: ${{ needs.release-id.outputs.id }}
|
||||
ref: ${{ github.event.inputs.tags }}
|
||||
|
||||
push:
|
||||
@@ -59,8 +77,48 @@ jobs:
|
||||
export PATH=$PATH:/usr/local/bin:/home/ubuntu/.local/bin
|
||||
bash build/image-manifest.sh && bash build/upload-images.sh .manifest/images.mf linux/arm64
|
||||
|
||||
push-deps:
|
||||
needs: [release-daemon, release-id]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: "Checkout source code"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# test
|
||||
- env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: "us-east-1"
|
||||
VERSION: ${{ github.event.inputs.tags }}
|
||||
RELEASE_ID: ${{ needs.release-id.outputs.id }}
|
||||
REPO_PATH: '${{ secrets.REPO_PATH }}'
|
||||
run: |
|
||||
bash build/deps-manifest.sh && bash build/upload-deps.sh
|
||||
|
||||
push-deps-arm64:
|
||||
needs: [release-daemon, release-id]
|
||||
runs-on: [self-hosted, linux, ARM64]
|
||||
|
||||
steps:
|
||||
- name: "Checkout source code"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# test
|
||||
- env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: "us-east-1"
|
||||
VERSION: ${{ github.event.inputs.tags }}
|
||||
RELEASE_ID: ${{ needs.release-id.outputs.id }}
|
||||
REPO_PATH: '${{ secrets.REPO_PATH }}'
|
||||
run: |
|
||||
export PATH=$PATH:/usr/local/bin:/home/ubuntu/.local/bin
|
||||
bash build/deps-manifest.sh linux/arm64 && bash build/upload-deps.sh linux/arm64
|
||||
|
||||
|
||||
upload-package:
|
||||
needs: [push, push-arm64, release-daemon]
|
||||
needs: [push, push-arm64, push-deps, push-deps-arm64, release-daemon, release-id]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -71,7 +129,7 @@ jobs:
|
||||
|
||||
- name: Package installer
|
||||
run: |
|
||||
bash build/build.sh ${{ github.event.inputs.tags }}
|
||||
bash build/build.sh ${{ github.event.inputs.tags }} ${{ needs.release-id.outputs.id }}
|
||||
|
||||
- name: Upload to S3
|
||||
env:
|
||||
@@ -83,9 +141,12 @@ jobs:
|
||||
aws s3 cp install-wizard-v${{ github.event.inputs.tags }}.md5sum.txt s3://terminus-os-install${{ secrets.REPO_PATH }}install-wizard-v${{ github.event.inputs.tags }}.md5sum.txt --acl=public-read && \
|
||||
aws s3 cp install-wizard-v${{ github.event.inputs.tags }}.tar.gz s3://terminus-os-install${{ secrets.REPO_PATH }}install-wizard-v${{ github.event.inputs.tags }}.tar.gz --acl=public-read
|
||||
|
||||
aws s3 cp install-wizard-v${{ github.event.inputs.tags }}.md5sum.txt s3://terminus-os-install${{ secrets.REPO_PATH }}install-wizard-v${{ github.event.inputs.tags }}.${{ needs.release-id.outputs.id }}.md5sum.txt --acl=public-read && \
|
||||
aws s3 cp install-wizard-v${{ github.event.inputs.tags }}.tar.gz s3://terminus-os-install${{ secrets.REPO_PATH }}install-wizard-v${{ github.event.inputs.tags }}.${{ needs.release-id.outputs.id }}.tar.gz --acl=public-read
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [upload-package]
|
||||
needs: [upload-package, release-cli, release-id]
|
||||
|
||||
steps:
|
||||
- name: 'Checkout source code'
|
||||
@@ -101,7 +162,7 @@ jobs:
|
||||
- name: Get checksum
|
||||
id: vars
|
||||
run: |
|
||||
echo "version_md5sum=$(curl -sSfL https://dc3p1870nn3cj.cloudfront.net${{ secrets.REPO_PATH }}install-wizard-v${{ github.event.inputs.tags }}.md5sum.txt|awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "version_md5sum=$(curl -sSfL https://dc3p1870nn3cj.cloudfront.net${{ secrets.REPO_PATH }}install-wizard-v${{ github.event.inputs.tags }}.${{ needs.release-id.outputs.id }}.md5sum.txt|awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update checksum
|
||||
uses: eball/write-tag-to-version-file@latest
|
||||
@@ -112,14 +173,14 @@ jobs:
|
||||
|
||||
- name: Package installer
|
||||
run: |
|
||||
bash build/build.sh ${{ github.event.inputs.tags }}
|
||||
bash build/build.sh ${{ github.event.inputs.tags }} ${{ needs.release-id.outputs.id }}
|
||||
|
||||
- name: 'Archives'
|
||||
run: |
|
||||
cp .dist/install-wizard/install.sh build/base-package
|
||||
cp build/base-package/install.sh build/base-package/publicInstaller.sh
|
||||
cp build/base-package/install.sh build/base-package/publicInstaller.latest
|
||||
cp .dist/install-wizard/install.ps1 build/insbase-packagetaller
|
||||
cp .dist/install-wizard/install.ps1 build/base-package
|
||||
cp build/base-package/install.ps1 build/base-package/publicInstaller.latest.ps1
|
||||
cp .dist/install-wizard/joincluster.sh build/base-package
|
||||
|
||||
@@ -136,7 +197,7 @@ jobs:
|
||||
build/base-package/publicInstaller.latest.ps1
|
||||
build/base-package/install.ps1
|
||||
build/base-package/publicAddnode.sh
|
||||
build/instbase-packagealler/joincluster.sh
|
||||
build/base-package/joincluster.sh
|
||||
build/base-package/version.hint
|
||||
build/base-package/publicRestoreInstaller.sh
|
||||
prerelease: true
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -32,3 +32,9 @@ olares-cli-*.tar.gz
|
||||
cli/output
|
||||
daemon/output
|
||||
daemon/bin
|
||||
|
||||
docs/.vitepress/dist/
|
||||
docs/.vitepress/cache/
|
||||
node_modules
|
||||
.idea/
|
||||
cli/olares-cli*
|
||||
661
LICENSE
Normal file
661
LICENSE
Normal file
@@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
10
README.md
10
README.md
@@ -7,7 +7,7 @@
|
||||

|
||||
[](https://github.com/beclab/olares/releases)
|
||||
[](https://github.com/beclab/olares/stargazers)
|
||||
[](https://discord.com/invite/BzfqrgQPDK)
|
||||
[](https://discord.gg/olares)
|
||||
[](https://github.com/beclab/olares/blob/main/LICENSE.md)
|
||||
|
||||
<p>
|
||||
@@ -21,7 +21,7 @@
|
||||
<p align="center">
|
||||
<a href="https://olares.com">Website</a> ·
|
||||
<a href="https://docs.olares.com">Documentation</a> ·
|
||||
<a href="https://olares.com/larepass">Download LarePass</a> ·
|
||||
<a href="https://larepass.olares.com">Download LarePass</a> ·
|
||||
<a href="https://github.com/beclab/apps">Olares Apps</a> ·
|
||||
<a href="https://space.olares.com">Olares Space</a>
|
||||
</p>
|
||||
@@ -43,7 +43,7 @@ Just as Public clouds offer IaaS, PaaS, and SaaS layers, Olares provides open-so
|
||||
|
||||

|
||||
|
||||
For detailed description of each component, refer to [Olares architecture](https://docs.olares.com/manual/system-architecture.html).
|
||||
For detailed description of each component, refer to [Olares architecture](https://docs.olares.com/manual/concepts/system-architecture.html).
|
||||
|
||||
> 🔍 **How is Olares different from traditional NAS?**
|
||||
>
|
||||
@@ -113,7 +113,7 @@ This section lists the main directories in the Olares repository:
|
||||
* **[`apps`](./apps)**: Contains the code for system applications, primarily for `larepass`.
|
||||
* **[`cli`](./cli)**: Contains the code for `olares-cli`, the command-line interface tool for Olares.
|
||||
* **[`daemon`](./daemon)**: Contains the code for `olaresd`, the system daemon process.
|
||||
* **`docs`**: Contains documentation for the project.
|
||||
* **[`docs`](./docs)**: Contains documentation for the project.
|
||||
* **[`framework`](./framework)**: Contains the Olares system services.
|
||||
* **[`infrastructure`](./infrastructure)**: Contains code related to infrastructure components such as computing, storage, networking, and GPUs.
|
||||
* **[`platform`](./platform)**: Contains code for cloud-native components like databases and message queues.
|
||||
@@ -134,7 +134,7 @@ https://docs.olares.com/developer/contribute/olares.html
|
||||
|
||||
* [**GitHub Discussion**](https://github.com/beclab/olares/discussions). Best for sharing feedback and asking questions.
|
||||
* [**GitHub Issues**](https://github.com/beclab/olares/issues). Best for filing bugs you encounter using Olares and submitting feature proposals.
|
||||
* [**Discord**](https://discord.com/invite/BzfqrgQPDK). Best for sharing anything Olares.
|
||||
* [**Discord**](https://discord.gg/olares). Best for sharing anything Olares.
|
||||
|
||||
## Special thanks
|
||||
|
||||
|
||||
10
README_CN.md
10
README_CN.md
@@ -7,7 +7,7 @@
|
||||

|
||||
[](https://github.com/beclab/olares/releases)
|
||||
[](https://github.com/beclab/olares/stargazers)
|
||||
[](https://discord.com/invite/BzfqrgQPDK)
|
||||
[](https://discord.gg/olares)
|
||||
[](https://github.com/beclab/olares/blob/main/LICENSE.md)
|
||||
|
||||
<p>
|
||||
@@ -21,7 +21,7 @@
|
||||
<p align="center">
|
||||
<a href="https://olares.com">网站</a> ·
|
||||
<a href="https://docs.olares.com">文档</a> ·
|
||||
<a href="https://olares.com/larepass">下载 LarePass</a> ·
|
||||
<a href="https://larepass.olares.com">下载 LarePass</a> ·
|
||||
<a href="https://github.com/beclab/apps">Olares 应用</a> ·
|
||||
<a href="https://space.olares.com">Olares Space</a>
|
||||
</p>
|
||||
@@ -44,7 +44,7 @@ Olares 是一款开源个人云操作系统,旨在让您能够轻松在本地
|
||||
|
||||

|
||||
|
||||
详细描述请参考 [Olares 架构](https://docs.olares.cn/zh/manual/system-architecture.html)文档。
|
||||
详细描述请参考 [Olares 架构](https://docs.olares.cn/zh/manual/concepts/system-architecture.html)文档。
|
||||
|
||||
>🔍**Olares 和 NAS 有什么不同?**
|
||||
>
|
||||
@@ -115,7 +115,7 @@ Olares 代码库中的主要目录如下:
|
||||
* **[`apps`](./apps)**: 用于存放系统应用,主要是 `larepass` 的代码。
|
||||
* **[`cli`](./cli)**: 用于存放 `olares-cli`(Olares 的命令行界面工具)的代码。
|
||||
* **[`daemon`](./daemon)**: 用于存放 `olaresd`(系统守护进程)的代码。
|
||||
* **`docs`**: 用于存放 Olares 项目的文档。
|
||||
* **[`docs`**](./docs)**: 用于存放 Olares 项目的文档。
|
||||
* **[`framework`](./framework)**: 用来存放 Olares 系统服务代码。
|
||||
* **[`infrastructure`](./infrastructure)**: 用于存放计算,存储,网络,GPU 等基础设施的代码。
|
||||
* **[`platform`](./platform)**: 用于存放数据库、消息队列等云原生组件的代码。
|
||||
@@ -136,7 +136,7 @@ https://docs.olares.com/developer/contribute/olares.html
|
||||
|
||||
* [**GitHub Discussion**](https://github.com/beclab/olares/discussions) - 讨论 Olares 使用过程中的疑问。
|
||||
* [**GitHub Issues**](https://github.com/beclab/olares/issues) - 报告 Olares 的遇到的问题或提出功能改进建议。
|
||||
* [**Discord**](https://discord.com/invite/BzfqrgQPDK) - 日常交流,分享经验,或讨论与 Olares 相关的任何主题。
|
||||
* [**Discord**](https://discord.gg/olares) - 日常交流,分享经验,或讨论与 Olares 相关的任何主题。
|
||||
|
||||
## 特别感谢
|
||||
|
||||
|
||||
13
README_JP.md
13
README_JP.md
@@ -7,7 +7,7 @@
|
||||

|
||||
[](https://github.com/beclab/olares/releases)
|
||||
[](https://github.com/beclab/olares/stargazers)
|
||||
[](https://discord.com/invite/BzfqrgQPDK)
|
||||
[](https://discord.gg/olares)
|
||||
[](https://github.com/beclab/olares/blob/main/LICENSE.md)
|
||||
|
||||
<p>
|
||||
@@ -21,7 +21,7 @@
|
||||
<p align="center">
|
||||
<a href="https://olares.com">ウェブサイト</a> ·
|
||||
<a href="https://docs.olares.com">ドキュメント</a> ·
|
||||
<a href="https://olares.com/larepass">LarePassをダウンロード</a> ·
|
||||
<a href="https://larepass.olares.com">LarePassをダウンロード</a> ·
|
||||
<a href="https://github.com/beclab/apps">Olaresアプリ</a> ·
|
||||
<a href="https://space.olares.com">Olares Space</a>
|
||||
</p>
|
||||
@@ -44,7 +44,7 @@ Olaresは、あなたが自身のデジタル資産をローカルで容易に
|
||||
|
||||

|
||||
|
||||
各コンポーネントの詳細については、[Olares アーキテクチャ](https://docs.olares.com/manual/system-architecture.html)(英語版)をご参照ください。
|
||||
各コンポーネントの詳細については、[Olares アーキテクチャ](https://docs.olares.com/manual/concepts/system-architecture.html)(英語版)をご参照ください。
|
||||
|
||||
> 🔍**OlaresとNASの違いは何ですか?**
|
||||
>
|
||||
@@ -108,14 +108,13 @@ Olaresは以下のLinuxプラットフォームで動作検証を完了してい
|
||||
自分のデバイスでOlaresを始めるには、[はじめにガイド](https://docs.olares.com/manual/get-started/)に従ってステップバイステップの手順を確認してください。
|
||||
|
||||
|
||||
## プロジェクトナビゲーション
|
||||
|
||||
## プロジェクトナビゲーションx
|
||||
このセクションでは、Olares リポジトリ内の主要なディレクトリをリストアップしています:
|
||||
|
||||
* **[`apps`](./apps)**: システムアプリケーションのコードが含まれており、主に `larepass` 用です。
|
||||
* **[`cli`](./cli)**: Olares のコマンドラインインターフェースツールである `olares-cli` のコードが含まれています。
|
||||
* **[`daemon`](./daemon)**: システムデーモンプロセスである `olaresd` のコードが含まれています。
|
||||
* **`docs`**: プロジェクトのドキュメントが含まれています。
|
||||
* **[`docs`](./docs)**: プロジェクトのドキュメントが含まれています。
|
||||
* **[`framework`](./framework)**: Olares システムサービスが含まれています。
|
||||
* **[`infrastructure`](./infrastructure)**: コンピューティング、ストレージ、ネットワーキング、GPU などのインフラストラクチャコンポーネントに関連するコードが含まれています。
|
||||
* **[`platform`](./platform)**: データベースやメッセージキューなどのクラウドネイティブコンポーネントのコードが含まれています。
|
||||
@@ -136,7 +135,7 @@ https://docs.olares.com/developer/contribute/olares.html
|
||||
|
||||
* [**GitHub Discussion**](https://github.com/beclab/olares/discussions). フィードバックの共有や質問に最適です。
|
||||
* [**GitHub Issues**](https://github.com/beclab/olares/issues). Olaresの使用中に遭遇したバグの報告や機能提案の提出に最適です。
|
||||
* [**Discord**](https://discord.com/invite/BzfqrgQPDK). Olaresに関するあらゆることを共有するのに最適です。
|
||||
* [**Discord**](https://discord.gg/olares). Olaresに関するあらゆることを共有するのに最適です。
|
||||
|
||||
## 特別な感謝
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
@@ -1,26 +0,0 @@
|
||||
apiVersion: v2
|
||||
name: studio
|
||||
description: A Terminus app development tool
|
||||
maintainers:
|
||||
- name: bytetrade
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.3
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "4.9.1"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 749 KiB |
@@ -1,13 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: studio-server
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: studio-server.os-framework.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
name: studio-server
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
@@ -1,42 +0,0 @@
|
||||
bfl:
|
||||
nodeport: 30883
|
||||
nodeport_ingress_http: 30083
|
||||
nodeport_ingress_https: 30082
|
||||
username: 'test'
|
||||
url: 'test'
|
||||
nodeName: test
|
||||
pvc:
|
||||
userspace: test
|
||||
userspace:
|
||||
userData: test/Home
|
||||
appData: test/Data
|
||||
appCache: test
|
||||
dbdata: test
|
||||
docs:
|
||||
nodeport: 30881
|
||||
desktop:
|
||||
nodeport: 30180
|
||||
os:
|
||||
portfolio:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
vault:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
desktop:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
message:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
rss:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
search:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
studio:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
kubesphere:
|
||||
redis_password: ""
|
||||
@@ -0,0 +1,39 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:app-service-frontend-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-system-{{ .Values.bfl.username }}/app-service
|
||||
provider-service-ref: app-service.os-framework:6755
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:app-service-provider-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-system-{{ .Values.bfl.username }}/app-service
|
||||
provider-service-ref: app-service.os-framework:6755
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/app-service/*"
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:app-service-frontend-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:app-service-frontend-svc
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:backup-frontend-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-space-{{ .Values.bfl.username }}/backup
|
||||
provider-service-ref: backup-server.os-framework:8082
|
||||
rules:
|
||||
- nonResourceURLs: ["/apis/backup*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:backup-frontend-domain
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/settings
|
||||
provider-service-ref: backup-server.os-framework:8082
|
||||
rules:
|
||||
- nonResourceURLs: ["/apis/backup*"]
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:backup-frontend-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:backup-frontend-svc
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:backup-frontend-domain
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:backup-frontend-domain
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: backup
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: system-server.user-system-{{ .Values.bfl.username }}.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 28080
|
||||
targetPort: 28080
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: backend:{{ .Values.bfl.username }}:system-frontend:bfl-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:bfl-svc
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: system-frontend
|
||||
namespace: {{ .Release.Namespace }}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: backend:{{ .Values.bfl.username }}:system-frontend:files-provider-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:files-provider-svc
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: system-frontend
|
||||
namespace: {{ .Release.Namespace }}
|
||||
@@ -0,0 +1,136 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:files-frontend-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-space-{{ .Values.bfl.username }}/files
|
||||
provider-service-ref: files-service.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:files-frontend-domain
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/files
|
||||
provider-service-ref: files-service.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:files-frontend-domain-settings
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/settings
|
||||
provider-service-ref: files-service.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/api/resources/*"
|
||||
- "/api/nodes/*"
|
||||
verbs: ["*"]
|
||||
|
||||
# ---
|
||||
# apiVersion: sys.bytetrade.io/v1alpha1
|
||||
# kind: ProviderRegistry
|
||||
# metadata:
|
||||
# name: files-provider
|
||||
# namespace: user-system-{{ .Values.bfl.username }}
|
||||
# spec:
|
||||
# dataType: files
|
||||
# deployment: files
|
||||
# description: files provider
|
||||
# endpoint: files-service.{{ .Release.Namespace }}
|
||||
# group: service.files
|
||||
# kind: provider
|
||||
# namespace: {{ .Release.Namespace }}
|
||||
# opApis:
|
||||
# - name: Query
|
||||
# uri: /provider/query_file
|
||||
# - name: GetSearchFolderStatus
|
||||
# uri: /provider/get_search_folder_status
|
||||
# - name: UpdateSearchFolderPaths
|
||||
# uri: /provider/update_search_folder_paths
|
||||
# - name: GetDatasetFolderStatus
|
||||
# uri: /provider/get_dataset_folder_status
|
||||
# - name: UpdateDatasetFolderPaths
|
||||
# uri: /provider/update_dataset_folder_paths
|
||||
# version: v1
|
||||
# status:
|
||||
# state: active
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:files-provider-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-system-{{ .Values.bfl.username }}/files
|
||||
provider-service-ref: files-service.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/provider/query_file"
|
||||
- "/provider/get_search_folder_status"
|
||||
- "/provider/update_search_folder_paths"
|
||||
- "/provider/get_dataset_folder_status"
|
||||
- "/provider/update_dataset_folder_paths"
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:files-frontend-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:files-frontend-svc
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:files-frontend-domain
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:files-frontend-domain
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:files-frontend-domain-settings
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:files-frontend-domain-settings
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: files
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: system-server.user-system-{{ .Values.bfl.username }}.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 28080
|
||||
targetPort: 28080
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: backend:{{ .Values.bfl.username }}:system-frontend:headscale-provider-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:headscale-svc
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: system-frontend
|
||||
namespace: {{ .Release.Namespace }}
|
||||
@@ -0,0 +1,64 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:infisical-frontend-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-space-{{ .Values.bfl.username }}/infisical
|
||||
provider-service-ref: infisical-service.os-framework:8080
|
||||
rules:
|
||||
- nonResourceURLs: ["/admin/*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:infisical-frontend-domain
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/settings
|
||||
provider-service-ref: infisical-service.os-framework:8080
|
||||
rules:
|
||||
- nonResourceURLs: ["/admin/*"]
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:infisical-frontend-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:infisical-frontend-svc
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:infisical-frontend-domain
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:infisical-frontend-domain
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: infisical
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: system-server.user-system-{{ .Values.bfl.username }}.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 28080
|
||||
targetPort: 28080
|
||||
@@ -0,0 +1,76 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:market-frontend-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-space-{{ .Values.bfl.username }}/market
|
||||
provider-service-ref: appstore-svc.os-framework:81
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:market-frontend-domain
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/market
|
||||
provider-service-ref: appstore-svc.os-framework:81
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:market-provider-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-system-{{ .Values.bfl.username }}/market
|
||||
provider-service-ref: appstore-svc.os-framework:81
|
||||
rules:
|
||||
- nonResourceURLs: ["/app-store/*"]
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:market-frontend-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:market-frontend-svc
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:market-frontend-domain
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:market-frontend-domain
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: market
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: system-server.user-system-{{ .Values.bfl.username }}.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 28080
|
||||
targetPort: 28080
|
||||
@@ -0,0 +1,64 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:middleware-frontend-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-space-{{ .Values.bfl.username }}/middleware
|
||||
provider-service-ref: middleware-service.os-platform:80
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:middleware-frontend-domain-controlhub
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/control-hub
|
||||
provider-service-ref: middleware-service.os-platform:80
|
||||
rules:
|
||||
- nonResourceURLs: ["/middleware/*"]
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:middleware-frontend-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:middleware-frontend-svc
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:middleware-frontend-domain-controlhub
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:middleware-frontend-domain-controlhub
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: middleware
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: system-server.user-system-{{ .Values.bfl.username }}.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 28080
|
||||
targetPort: 28080
|
||||
@@ -0,0 +1,145 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-space-{{ .Values.bfl.username }}/monitoring
|
||||
provider-service-ref: monitoring-server.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-domain-controlhub
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/control-hub
|
||||
provider-service-ref: monitoring-server.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/kapis/*"
|
||||
- "/api*"
|
||||
- "/capi/*"
|
||||
- "/apis/apps/*"
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-domain-dashboard
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/dashboard
|
||||
provider-service-ref: monitoring-server.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-domain-settings
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/settings
|
||||
provider-service-ref: monitoring-server.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/kapis/*"
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-domain-desktop
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/desktop
|
||||
provider-service-ref: monitoring-server.os-framework:80
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/kapis/*"
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:monitoring-frontend-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-svc
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:monitoring-frontend-domain-controlhub
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-domain-controlhub
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:monitoring-frontend-domain-dashboard
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-domain-dashboard
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:monitoring-frontend-domain-settings
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-domain-settings
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:monitoring-frontend-domain-desktop
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:monitoring-frontend-domain-desktop
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: monitoring
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: system-server.user-system-{{ .Values.bfl.username }}.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 28080
|
||||
targetPort: 28080
|
||||
@@ -1,4 +1,5 @@
|
||||
{{- $namespace := printf "%s%s" "user-system-" .Values.bfl.username -}}
|
||||
{{- $userspacenamespace := printf "%s%s" "user-space-" .Values.bfl.username -}}
|
||||
{{- $zinc_files_secret := (lookup "v1" "Secret" $namespace "zinc-files-secrets") -}}
|
||||
{{- $user_service_secret := (lookup "v1" "Secret" $namespace "user-service-secrets") -}}
|
||||
|
||||
@@ -50,7 +51,7 @@
|
||||
{{ $user_service_redis_password = randAlphaNum 16 | b64enc }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $user_service_nats_secret := (lookup "v1" "Secret" $namespace "user-service-nats-secret") -}}
|
||||
{{- $user_service_nats_secret := (lookup "v1" "Secret" $userspacenamespace "user-service-nats-secret") -}}
|
||||
{{- $nats_password := "" -}}
|
||||
{{ if $user_service_nats_secret -}}
|
||||
{{ $nats_password = (index $user_service_nats_secret "data" "nats_password") }}
|
||||
@@ -77,7 +78,7 @@ metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
@@ -92,7 +93,7 @@ metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
@@ -109,7 +110,7 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
ports:
|
||||
- name: "profile-editor"
|
||||
protocol: TCP
|
||||
@@ -127,7 +128,7 @@ metadata:
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
@@ -142,7 +143,7 @@ metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
@@ -152,38 +153,12 @@ spec:
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: vault-admin-server
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: vault-server.os-framework.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 3010
|
||||
targetPort: 3010
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: studio-svc
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: system-frontend
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8080
|
||||
targetPort: 87
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: files-fe-service
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
@@ -199,7 +174,7 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
@@ -212,7 +187,7 @@ metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
@@ -228,7 +203,7 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
@@ -237,39 +212,40 @@ spec:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: system-frontend-deployment
|
||||
name: olares-app-deployment
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: system-frontend
|
||||
applications.app.bytetrade.io/name: system-frontend
|
||||
app: olares-app
|
||||
applications.app.bytetrade.io/name: olares-app
|
||||
applications.app.bytetrade.io/owner: '{{ .Values.bfl.username }}'
|
||||
applications.app.bytetrade.io/group: 'true'
|
||||
applications.app.bytetrade.io/author: bytetrade.io
|
||||
annotations:
|
||||
applications.app.bytetrade.io/icon: '{"dashboard":"https://file.bttcdn.com/appstore/dashboard/icon.png","control-hub":"https://file.bttcdn.com/appstore/control-hub/icon.png","profile":"https://file.bttcdn.com/appstore/profile/icon.png","headscale": "https://file.bttcdn.com/appstore/headscale/icon.png","settings": "https://file.bttcdn.com/appstore/settings/icon.png","studio":"https://file.bttcdn.com/appstore/devbox/icon.png","files":"https://file.bttcdn.com/appstore/files/icon.png","vault":"https://file.bttcdn.com/appstore/vault/icon.png","market":"https://file.bttcdn.com/appstore/appstore/icon.png"}'
|
||||
applications.app.bytetrade.io/title: '{"dashboard": "Dashboard","control-hub":"Control Hub","profile":"Profile","headscale":"Headscale","settings":"Settings","studio":"Studio","files":"Files","vault":"Vault","market":"Market"}'
|
||||
applications.app.bytetrade.io/version: '{"dashboard": "0.0.1","control-hub":"0.0.1","profile":"0.0.1","headscale":"0.0.1","settings":"0.0.1","studio":"0.0.1","files":"0.0.1","vault":"0.0.1","market":"0.0.1"}'
|
||||
applications.app.bytetrade.io/policies: '{"dashboard":{"policies":[{"entranceName":"dashboard","uriRegex":"/js/script.js", "level":"public"},{"entranceName":"dashboard","uriRegex":"/js/api/send", "level":"public"}]}}'
|
||||
applications.app.bytetrade.io/entrances: '{"dashboard":[{"name":"dashboard","host":"dashboard-service","port":80,"title":"Dashboard","windowPushState":true}],"control-hub":[{"name":"control-hub","host":"control-hub-service","port":80,"title":"Control Hub","windowPushState":true}],"profile":[{"name":"profile", "host":"profile-service", "port":80,"title":"Profile","windowPushState":true}],"headscale":[{"name":"headscale", "host":"headscale-svc", "port":80,"title":"Headscale","invisible": true}],"settings":[{"name":"settings", "host":"settings-service", "port":80,"title":"Settings"}],"studio":[{"name":"studio","host":"studio-svc","port":8080,"title":"Studio","openMethod":"window"}],"files":[{"name":"files", "host":"files-fe-service", "port":80,"title":"Files","windowPushState":true}],"vault":[{"name":"vault", "host":"vault-service", "port":80,"title":"Vault","windowPushState":true}],"market":[{"name":"appstore", "host":"appstore-fe-service", "port":80,"title":"Market","windowPushState":true}]}'
|
||||
applications.app.bytetrade.io/default-thirdlevel-domains: '[{"appName": "olares-app","entranceName":"dashboard","thirdLevelDomain":"dashboard"},{"appName":"olares-app","entranceName":"control-hub","thirdLevelDomain":"control-hub"},{"appName":"olares-app","entranceName":"files","thirdLevelDomain":"files"},{"appName": "olares-app","entranceName":"vault","thirdLevelDomain":"vault"},{"appName":"olares-app","entranceName":"headscale","thirdLevelDomain":"headscale"},{"appName":"olares-app","entranceName":"settings","thirdLevelDomain":"settings"},{"appName": "olares-app","entranceName":"market","thirdLevelDomain":"market"},{"appName":"olares-app","entranceName":"profile","thirdLevelDomain":"profile"}]'
|
||||
applications.app.bytetrade.io/icon: https://file.bttcdn.com/appstore/olaresapps/icon.png
|
||||
applications.app.bytetrade.io/title: 'Olares Apps'
|
||||
applications.app.bytetrade.io/version: '0.0.1'
|
||||
applications.app.bytetrade.io/policies: '{"policies":[{"entranceName":"dashboard","uriRegex":"/js/script.js", "level":"public"},{"entranceName":"dashboard","uriRegex":"/js/api/send", "level":"public"}]}'
|
||||
applications.app.bytetrade.io/entrances: '[{"name":"files", "host":"files-fe-service", "port":80,"title":"Files","windowPushState":true,"icon":"https://file.bttcdn.com/appstore/files/icon.png"},{"name":"vault", "host":"vault-service", "port":80,"title":"Vault","windowPushState":true,"icon":"https://file.bttcdn.com/appstore/vault/icon.png"},{"name":"market", "host":"appstore-fe-service", "port":80,"title":"Market","windowPushState":true,"icon":"https://file.bttcdn.com/appstore/appstore/icon.png"},{"name":"settings", "host":"settings-service", "port":80,"title":"Settings","icon":"https://file.bttcdn.com/appstore/settings/icon.png"},{"name":"profile", "host":"profile-service", "port":80,"title":"Profile","windowPushState":true,"icon":"https://file.bttcdn.com/appstore/profile/icon.png"},{"name":"dashboard","host":"dashboard-service","port":80,"title":"Dashboard","windowPushState":true,"icon":"https://file.bttcdn.com/appstore/dashboard/icon.png"},{"name":"control-hub","host":"control-hub-service","port":80,"title":"Control Hub","windowPushState":true,"icon":"https://file.bttcdn.com/appstore/control-hub/icon.png"},{"name":"headscale", "host":"headscale-svc", "port":80,"title":"Headscale","invisible": true,"icon":"https://file.bttcdn.com/appstore/headscale/icon.png"}]'
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: system-frontend
|
||||
app: olares-app
|
||||
io.bytetrade.app: "true"
|
||||
annotations:
|
||||
{{ if .Values.telemetry }}
|
||||
instrumentation.opentelemetry.io/inject-nodejs: "olares-instrumentation"
|
||||
instrumentation.opentelemetry.io/nodejs-container-names: "user-service"
|
||||
instrumentation.opentelemetry.io/inject-nginx: "olares-instrumentation"
|
||||
instrumentation.opentelemetry.io/inject-nginx-container-names: "system-frontend"
|
||||
instrumentation.opentelemetry.io/inject-nginx-container-names: "olares-app"
|
||||
{{ end }}
|
||||
spec:
|
||||
priorityClassName: "system-cluster-critical"
|
||||
serviceAccountName: system-frontend
|
||||
initContainers:
|
||||
- args:
|
||||
- -it
|
||||
@@ -344,8 +320,8 @@ spec:
|
||||
value: "{{ $pg_password | b64dec }}"
|
||||
- name: PGDB
|
||||
value: user_space_{{ .Values.bfl.username }}_cloud_drive_integration
|
||||
- name: system-frontend-init
|
||||
image: beclab/system-frontend:v1.3.102
|
||||
- name: olares-app-init
|
||||
image: beclab/system-frontend:v1.4.30
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
@@ -381,7 +357,7 @@ spec:
|
||||
- debug
|
||||
- -c
|
||||
- /etc/envoy/envoy.yaml
|
||||
- name: system-frontend
|
||||
- name: olares-app
|
||||
image: beclab/docker-nginx-headers-more:ubuntu-v0.1.0
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
@@ -401,7 +377,6 @@ spec:
|
||||
- |
|
||||
rm /etc/nginx/conf.d/default.conf
|
||||
cp -r /www/nginxs/* /etc/nginx/conf.d/
|
||||
rm -rf /www/nginxs/
|
||||
nginx -g 'daemon off;'
|
||||
volumeMounts:
|
||||
- name: terminus-sidecar-config
|
||||
@@ -412,10 +387,10 @@ spec:
|
||||
mountPath: /www
|
||||
- name: wise-download-dir
|
||||
mountPath: /data/Home
|
||||
- name: system-frontend-nginx-config
|
||||
- name: olares-app-nginx-config
|
||||
mountPath: /etc/nginx/nginx.conf
|
||||
subPath: nginx.conf
|
||||
- name: system-frontend-nginx-config
|
||||
- name: olares-app-nginx-config
|
||||
mountPath: /etc/nginx/conf.d/headscale.conf
|
||||
subPath: headscale.conf
|
||||
env:
|
||||
@@ -458,7 +433,7 @@ spec:
|
||||
value: os.market.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_APPLICATION
|
||||
value: os.application.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_NOTIFICATION
|
||||
- name: NATS_SUBJECT_USER_NOTIFICATION
|
||||
value: os.notification.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_FILES
|
||||
value: os.files.{{ .Values.bfl.username}}
|
||||
@@ -467,7 +442,7 @@ spec:
|
||||
- name: NATS_SUBJECT_VAULT
|
||||
value: os.vault.{{ .Values.bfl.username}}
|
||||
- name: user-service
|
||||
image: beclab/user-service:v0.0.21
|
||||
image: beclab/user-service:v0.0.53
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
@@ -478,12 +453,8 @@ spec:
|
||||
{{- end }}
|
||||
- name: DEV_MODE
|
||||
value: ''
|
||||
- name: OS_SYSTEM_SERVER
|
||||
value: system-server.user-system-{{ .Values.bfl.username }}
|
||||
- name: OS_APP_SECRET
|
||||
value: '{{ .Values.os.settings.appSecret }}'
|
||||
- name: OS_APP_KEY
|
||||
value: {{ .Values.os.settings.appKey }}
|
||||
- name: MY_NAME
|
||||
value: '{{ .Values.bfl.username }}'
|
||||
- name: NODE_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
@@ -491,9 +462,9 @@ spec:
|
||||
- name: TERMINUSD_HOST
|
||||
value: $(NODE_IP):18088
|
||||
- name: APP_SERVICE_SERVICE_HOST
|
||||
value: app-service.os-framework
|
||||
value: app-service.user-system-{{ .Values.bfl.username }}
|
||||
- name: APP_SERVICE_SERVICE_PORT
|
||||
value: '6755'
|
||||
value: '28080'
|
||||
- name: APP_SERVICE_CHAIN_ID
|
||||
value: '10'
|
||||
- name: APP_SERVICE_VERIFYING_CONTRACT
|
||||
@@ -525,7 +496,7 @@ spec:
|
||||
value: os.market.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_APPLICATION
|
||||
value: os.application.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_NOTIFICATION
|
||||
- name: NATS_SUBJECT_USER_NOTIFICATION
|
||||
value: os.notification.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_FILES
|
||||
value: os.files.{{ .Values.bfl.username}}
|
||||
@@ -533,13 +504,17 @@ spec:
|
||||
value: os.knowledge.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_VAULT
|
||||
value: os.vault.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_BACKUP
|
||||
value: os.backup.{{ .Values.bfl.username}}
|
||||
- name: NATS_SUBJECT_INTENT
|
||||
value: os.intent.{{ .Values.bfl.username}}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: redis_password
|
||||
name: user-service-secrets
|
||||
- name: REDIS_HOST
|
||||
value: redis-cluster-proxy.user-system-guotest334
|
||||
value: redis-cluster-proxy.user-system-{{ .Values.bfl.username }}
|
||||
- name: REDIS_PORT
|
||||
value: '6379'
|
||||
|
||||
@@ -632,9 +607,9 @@ spec:
|
||||
hostPath:
|
||||
type: Directory
|
||||
path: '{{ .Values.userspace.appCache}}'
|
||||
- name: system-frontend-nginx-config
|
||||
- name: olares-app-nginx-config
|
||||
configMap:
|
||||
name: system-frontend-nginx-config
|
||||
name: olares-app-nginx-config
|
||||
items:
|
||||
- key: nginx.conf
|
||||
path: nginx.conf
|
||||
@@ -690,34 +665,7 @@ data:
|
||||
appData: "{{ .Values.userspace.appData }}"
|
||||
appCache: "{{ .Values.userspace.appCache }}"
|
||||
username: "{{ .Values.bfl.username }}"
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: files-provider
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: files
|
||||
deployment: files
|
||||
description: files provider
|
||||
endpoint: files-service.{{ .Release.Namespace }}
|
||||
group: service.files
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
opApis:
|
||||
- name: Query
|
||||
uri: /provider/query_file
|
||||
- name: GetSearchFolderStatus
|
||||
uri: /provider/get_search_folder_status
|
||||
- name: UpdateSearchFolderPaths
|
||||
uri: /provider/update_search_folder_paths
|
||||
- name: GetDatasetFolderStatus
|
||||
uri: /provider/get_dataset_folder_status
|
||||
- name: UpdateDatasetFolderPaths
|
||||
uri: /provider/update_dataset_folder_paths
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
@@ -855,6 +803,7 @@ data:
|
||||
- exact: x-bfl-user
|
||||
- exact: x-real-ip
|
||||
- exact: terminus-nonce
|
||||
- exact: x-provider-proxy
|
||||
headers_to_add:
|
||||
- key: X-Forwarded-Method
|
||||
value: '%REQ(:METHOD)%'
|
||||
@@ -973,279 +922,7 @@ kind: ConfigMap
|
||||
metadata:
|
||||
name: sidecar-upload-configs
|
||||
namespace: {{ .Release.Namespace }}
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ApplicationPermission
|
||||
metadata:
|
||||
name: dashboard-vault
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
app: dashboard
|
||||
appid: dashboard
|
||||
key: {{ .Values.os.dashboard.appKey }}
|
||||
secret: {{ .Values.os.dashboard.appSecret }}
|
||||
permissions:
|
||||
- dataType: secret
|
||||
group: secret.infisical
|
||||
ops:
|
||||
- RetrieveSecret?workspace=dashboard
|
||||
- CreateSecret?workspace=dashboard
|
||||
- DeleteSecret?workspace=dashboard
|
||||
- UpdateSecret?workspace=dashboard
|
||||
- ListSecret?workspace=dashboard
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ApplicationPermission
|
||||
metadata:
|
||||
name: profile
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
app: profile
|
||||
appid: profile
|
||||
key: {{ .Values.os.profile.appKey }}
|
||||
secret: {{ .Values.os.profile.appSecret }}
|
||||
permissions:
|
||||
- dataType: datastore
|
||||
group: service.bfl
|
||||
ops:
|
||||
- GetKey
|
||||
- GetKeyPrefix
|
||||
- SetKey
|
||||
- DeleteKey
|
||||
version: v1
|
||||
- dataType: nft
|
||||
group: service.settings
|
||||
ops:
|
||||
- getNFTAddress
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ApplicationPermission
|
||||
metadata:
|
||||
name: studio
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
app: studio
|
||||
appid: studio
|
||||
key: {{ .Values.os.studio.appKey }}
|
||||
secret: {{ .Values.os.studio.appSecret }}
|
||||
permissions:
|
||||
- dataType: app
|
||||
group: service.appstore
|
||||
ops:
|
||||
- InstallDevApp
|
||||
- UninstallDevApp
|
||||
version: v1
|
||||
- dataType: legacy_api
|
||||
group: api.intent
|
||||
ops:
|
||||
- POST
|
||||
version: v2
|
||||
status:
|
||||
state: active
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ApplicationPermission
|
||||
metadata:
|
||||
name: settings
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
app: settings
|
||||
appid: settings
|
||||
key: {{ .Values.os.settings.appKey }}
|
||||
secret: {{ .Values.os.settings.appSecret }}
|
||||
permissions:
|
||||
- dataType: config
|
||||
group: service.desktop
|
||||
ops:
|
||||
- Update
|
||||
version: v1
|
||||
- dataType: secret
|
||||
group: secret.infisical
|
||||
ops:
|
||||
- RetrieveSecret?workspace=settings
|
||||
- CreateSecret?workspace=settings
|
||||
- DeleteSecret?workspace=settings
|
||||
- UpdateSecret?workspace=settings
|
||||
- ListSecret?workspace=settings
|
||||
version: v1
|
||||
- dataType: headscale
|
||||
group: service.headscale
|
||||
ops:
|
||||
- GetMachine
|
||||
- RenameMachine
|
||||
- DeleteMachine
|
||||
- GetRoute
|
||||
- EnableRoute
|
||||
- DisableRoute
|
||||
- SetTags
|
||||
version: v1
|
||||
- dataType: files
|
||||
group: service.files
|
||||
ops:
|
||||
- Query
|
||||
- GetSearchFolderStatus
|
||||
- UpdateSearchFolderPaths
|
||||
- GetDatasetFolderStatus
|
||||
- UpdateDatasetFolderPaths
|
||||
version: v1
|
||||
- dataType: datastore
|
||||
group: service.bfl
|
||||
ops:
|
||||
- GetKey
|
||||
- GetKeyPrefix
|
||||
- SetKey
|
||||
- DeleteKey
|
||||
version: v1
|
||||
- dataType: app
|
||||
group: service.bfl
|
||||
ops:
|
||||
- UserApps
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: settings-nft
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: nft
|
||||
deployment: settings
|
||||
description: Get Cloud Bind NFT List
|
||||
endpoint: settings-service.{{ .Release.Namespace }}
|
||||
group: service.settings
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
opApis:
|
||||
- name: getNFTAddress
|
||||
uri: /api/cloud/getNFTAddress
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: settings-account
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: account
|
||||
deployment: settings
|
||||
description: Get Acccount saved in Settings
|
||||
endpoint: settings-service.{{ .Release.Namespace }}
|
||||
group: service.settings
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
opApis:
|
||||
- name: getAccount
|
||||
uri: /api/account
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: settings-backup-password
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: backupPassword
|
||||
deployment: settings
|
||||
description: Get Backup Plan's Password
|
||||
endpoint: settings-service.{{ .Release.Namespace }}
|
||||
group: service.settings
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
opApis:
|
||||
- name: getAccount
|
||||
uri: /api/backup/password
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: settings-event-watcher
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
callbacks:
|
||||
- filters:
|
||||
type:
|
||||
- backup-state-event
|
||||
op: Create
|
||||
uri: /api/event/backup_state_event
|
||||
- filters:
|
||||
type:
|
||||
- restore-state-event
|
||||
op: Create
|
||||
uri: /api/event/restore_state_event
|
||||
- filters:
|
||||
type:
|
||||
- app-installation-event
|
||||
op: Create
|
||||
uri: /api/event/app_installation_event
|
||||
- filters:
|
||||
type:
|
||||
- settings-event
|
||||
op: Create
|
||||
uri: /api/event/app_installation_event
|
||||
- filters:
|
||||
type:
|
||||
- entrance-state-event
|
||||
op: Create
|
||||
uri: /api/event/entrance_state_event
|
||||
- filters:
|
||||
type:
|
||||
- system-upgrade-event
|
||||
op: Create
|
||||
uri: /api/event/system_upgrade_event
|
||||
dataType: event
|
||||
deployment: settings
|
||||
description: desktop event watcher
|
||||
endpoint: settings-service.{{ .Release.Namespace }}
|
||||
group: message-disptahcer.system-server
|
||||
kind: watcher
|
||||
namespace: {{ .Release.Namespace }}
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: settings-account-retrieve
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: legacy_api
|
||||
deployment: settings
|
||||
description: settings account retrieve legacy api
|
||||
endpoint: settings-service.{{ .Release.Namespace }}
|
||||
group: service.settings
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
version: v1
|
||||
opApis:
|
||||
- name: POST
|
||||
uri: /api/account/retrieve
|
||||
- name: GET
|
||||
uri: /api/account/all
|
||||
- name: POST
|
||||
uri: /api/cookie/retrieve
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
@@ -1315,166 +992,6 @@ spec:
|
||||
- protocol: TCP
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: internal-kubectl
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ .Release.Namespace }}:edge-desktop-rb
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: internal-kubectl
|
||||
roleRef:
|
||||
# kind: Role
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: app-event-watcher
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
callbacks:
|
||||
- filters:
|
||||
type:
|
||||
- app-installation-event
|
||||
op: Create
|
||||
uri: /server/app_installation_event
|
||||
- filters:
|
||||
type:
|
||||
- entrance-state-event
|
||||
op: Create
|
||||
uri: /server/entrance_state_event
|
||||
- filters:
|
||||
type:
|
||||
- settings-event
|
||||
op: Create
|
||||
uri: /server/app_installation_event
|
||||
- filters:
|
||||
type:
|
||||
- system-upgrade-event
|
||||
op: Create
|
||||
uri: /server/system_upgrade_event
|
||||
dataType: event
|
||||
deployment: edge-desktop
|
||||
description: desktop event watcher
|
||||
endpoint: edge-desktop.{{ .Release.Namespace }}
|
||||
group: message-disptahcer.system-server
|
||||
kind: watcher
|
||||
namespace: {{ .Release.Namespace }}
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: intent-api
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: legacy_api
|
||||
deployment: edge-desktop
|
||||
description: edge-desktop legacy api
|
||||
endpoint: edge-desktop.{{ .Release.Namespace }}
|
||||
group: api.intent
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
version: v1
|
||||
opApis:
|
||||
- name: POST
|
||||
uri: /server/intent/send
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: intent-api-v2
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: legacy_api
|
||||
deployment: edge-desktop
|
||||
description: edge-desktop legacy api
|
||||
endpoint: edge-desktop.{{ .Release.Namespace }}
|
||||
group: api.intent
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
version: v2
|
||||
opApis:
|
||||
- name: POST
|
||||
uri: /server/intent/send
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: destktop-ai-provider
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: ai_message
|
||||
deployment: edge-desktop
|
||||
description: search ai callback
|
||||
endpoint: edge-desktop.{{ .Release.Namespace }}
|
||||
group: service.desktop
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
opApis:
|
||||
- name: AIMessage
|
||||
uri: /server/ai_message
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ApplicationPermission
|
||||
metadata:
|
||||
name: desktop
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
app: desktop
|
||||
appid: desktop
|
||||
key: {{ .Values.os.desktop.appKey }}
|
||||
secret: {{ .Values.os.desktop.appSecret }}
|
||||
permissions:
|
||||
- dataType: files
|
||||
group: service.files
|
||||
ops:
|
||||
- Query
|
||||
version: v1
|
||||
- dataType: datastore
|
||||
group: service.bfl
|
||||
ops:
|
||||
- GetKey
|
||||
- GetKeyPrefix
|
||||
- SetKey
|
||||
- DeleteKey
|
||||
version: v1
|
||||
- dataType: app
|
||||
group: service.bfl
|
||||
ops:
|
||||
- UserApps
|
||||
version: v1
|
||||
- dataType: app
|
||||
group: service.appstore
|
||||
ops:
|
||||
- UninstallDevApp
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -1543,6 +1060,7 @@ data:
|
||||
- exact: x-bfl-user
|
||||
- exact: x-real-ip
|
||||
- exact: terminus-nonce
|
||||
- exact: x-provider-proxy
|
||||
headers_to_add:
|
||||
- key: X-Forwarded-Method
|
||||
value: '%REQ(:METHOD)%'
|
||||
@@ -1718,6 +1236,7 @@ data:
|
||||
- exact: x-bfl-user
|
||||
- exact: x-real-ip
|
||||
- exact: terminus-nonce
|
||||
- exact: x-provider-proxy
|
||||
headers_to_add:
|
||||
- key: X-Forwarded-Method
|
||||
value: '%REQ(:METHOD)%'
|
||||
@@ -1907,6 +1426,7 @@ data:
|
||||
- exact: x-bfl-user
|
||||
- exact: x-real-ip
|
||||
- exact: terminus-nonce
|
||||
- exact: x-provider-proxy
|
||||
headers_to_add:
|
||||
- key: X-Forwarded-Method
|
||||
value: '%REQ(:METHOD)%'
|
||||
@@ -2029,7 +1549,7 @@ metadata:
|
||||
kind: ConfigMap
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: system-frontend-nginx-config
|
||||
name: olares-app-nginx-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
annotations:
|
||||
kubesphere.io/creator: bytetrade.io
|
||||
@@ -2143,37 +1663,53 @@ spec:
|
||||
key: nats_password
|
||||
name: user-service-nats-secret
|
||||
subjects:
|
||||
- name: "files.*"
|
||||
- name: files.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
pub: allow
|
||||
sub: allow
|
||||
- name: "notification.*"
|
||||
- name: notification.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
pub: allow
|
||||
sub: allow
|
||||
- name: "search.*"
|
||||
- name: search.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
pub: allow
|
||||
sub: allow
|
||||
- name: "seahub.*"
|
||||
- name: seahub.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
sub: allow
|
||||
pub: allow
|
||||
- name: "vault.*"
|
||||
- name: vault.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
sub: allow
|
||||
pub: allow
|
||||
- name: "application.*"
|
||||
- name: application.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
sub: allow
|
||||
pub: allow
|
||||
- name: "knowledge.*"
|
||||
- name: knowledge.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
sub: allow
|
||||
pub: allow
|
||||
- name: "market.*"
|
||||
- name: market.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
sub: allow
|
||||
pub: allow
|
||||
- name: backup.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
sub: allow
|
||||
pub: allow
|
||||
- name: intent.{{ .Values.bfl.username }}
|
||||
permission:
|
||||
sub: allow
|
||||
pub: allow
|
||||
|
||||
user: user-service-{{ .Values.bfl.username }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
name: system-frontend
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: backend:{{ .Values.bfl.username }}:secret-settings-provider-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:secret-settings-provider-svc
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: system-frontend
|
||||
namespace: {{ .Release.Namespace }}
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: backend:{{ .Values.bfl.username }}:system-frontend:secret-dashboard-provider-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:secret-dashboard-provider-svc
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: system-frontend
|
||||
namespace: {{ .Release.Namespace }}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:settings-provider-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-system-{{ .Values.bfl.username }}/settings
|
||||
provider-service-ref: settings-service.{{ .Release.Namespace }}
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/api/cloud/getNFTAddress"
|
||||
- "/api/account/"
|
||||
- "/api/backup/password"
|
||||
- "/api/account/retrieve"
|
||||
- "/api/account/all"
|
||||
- "/api/cookie/retrieve"
|
||||
- "/api/cookie"
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:edge-desktop-provider-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-system-{{ .Values.bfl.username }}/edge-desktop
|
||||
provider-service-ref: edge-desktop.{{ .Release.Namespace }}
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/server/intent/send"
|
||||
- "/server/ai_message"
|
||||
verbs: ["*"]
|
||||
@@ -0,0 +1,88 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:vault-frontend-svc
|
||||
annotations:
|
||||
provider-registry-ref: user-space-{{ .Values.bfl.username }}/vault
|
||||
provider-service-ref: vault-server.os-framework:3010
|
||||
rules:
|
||||
- nonResourceURLs: ["/vault*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:vault-frontend-domain-settings
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/settings
|
||||
provider-service-ref: vault-server.os-framework:3010
|
||||
rules:
|
||||
- nonResourceURLs: ["/vault*"]
|
||||
verbs: ["*"]
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Values.bfl.username }}:vault-frontend-domain
|
||||
annotations:
|
||||
provider-registry-ref: {{ .Values.bfl.username }}/vault
|
||||
provider-service-ref: vault-server.os-framework:3000
|
||||
rules:
|
||||
- nonResourceURLs: ["/server*"]
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:vault-frontend-svc
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:vault-frontend-svc
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:vault-frontend-domain-settings
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:vault-frontend-domain-settings
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: user:{{ .Values.bfl.username }}:vault-frontend-domain
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Values.bfl.username }}:vault-frontend-domain
|
||||
subjects:
|
||||
- kind: User
|
||||
name: '{{ .Values.bfl.username }}'
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: vault
|
||||
namespace: user-space-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
type: ExternalName
|
||||
externalName: system-server.user-system-{{ .Values.bfl.username }}.svc.cluster.local
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 28080
|
||||
targetPort: 28080
|
||||
@@ -44,5 +44,3 @@ os:
|
||||
dashboard:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
kubesphere:
|
||||
redis_password: ""
|
||||
|
||||
@@ -29,7 +29,7 @@ spec:
|
||||
|
||||
containers:
|
||||
- name: wizard
|
||||
image: beclab/wizard:v1.3.57
|
||||
image: beclab/wizard:v1.4.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 80
|
||||
|
||||
@@ -34,5 +34,3 @@ os:
|
||||
appstore:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
kubesphere:
|
||||
redis_password: ""
|
||||
|
||||
@@ -2,6 +2,7 @@ $currentPath = Get-Location
|
||||
$architecture = $env:PROCESSOR_ARCHITECTURE
|
||||
$downloadCdnUrlFromEnv = $env:DOWNLOAD_CDN_URL
|
||||
$version = "#__VERSION__"
|
||||
$releaseID = "#__RELEASE_ID__"
|
||||
$downloadUrl = "https://dc3p1870nn3cj.cloudfront.net"
|
||||
|
||||
function Test-Wait {
|
||||
@@ -49,7 +50,11 @@ if (-Not (Test-Path $CLI_PROGRAM_PATH)) {
|
||||
}
|
||||
|
||||
$CLI_VERSION = "$version"
|
||||
$CLI_FILE = "olares-cli-v{0}_windows_{1}.tar.gz" -f $CLI_VERSION, $arch
|
||||
if (-not [string]::IsNullOrEmpty($releaseID) -and $releaseID.Substring(0,3) -ne "#__") {
|
||||
$CLI_FILE = "olares-cli-v{0}_windows_{1}.{2}.tar.gz" -f $CLI_VERSION, $arch, $releaseID
|
||||
} else {
|
||||
$CLI_FILE = "olares-cli-v{0}_windows_{1}.tar.gz" -f $CLI_VERSION, $arch
|
||||
}
|
||||
$CLI_URL = "{0}/{1}" -f $downloadUrl, $CLI_FILE
|
||||
$CLI_PATH = "{0}{1}" -f $CLI_PROGRAM_PATH, $CLI_FILE
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function command_exists() {
|
||||
if [[ x"$VERSION" == x"" ]]; then
|
||||
if [[ "$LOCAL_RELEASE" == "1" ]]; then
|
||||
ts=$(date +%Y%m%d%H%M%S)
|
||||
export VERSION="1.12.0-$ts"
|
||||
export VERSION="1.12.2-$ts"
|
||||
echo "will build and use a local release of Olares with version: $VERSION"
|
||||
echo ""
|
||||
else
|
||||
@@ -20,7 +20,7 @@ fi
|
||||
|
||||
if [[ "x${VERSION}" == "x" || "x${VERSION:3}" == "xVERSION__" ]]; then
|
||||
echo "error: Olares version is unspecified, please set the VERSION env var and rerun this script."
|
||||
echo "for example: VERSION=1.12.0-20241124 bash $0"
|
||||
echo "for example: VERSION=1.12.2-20241124 bash $0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -74,9 +74,15 @@ if [ -z ${cdn_url} ]; then
|
||||
cdn_url="https://dc3p1870nn3cj.cloudfront.net"
|
||||
fi
|
||||
|
||||
CLI_FILE="olares-cli-v${VERSION}_linux_${ARCH}.tar.gz"
|
||||
RELEASE_ID="#__RELEASE_ID__"
|
||||
if [[ $RELEASE_ID == "" || "${RELEASE_ID:3}" == "RELEASE_ID__" ]]; then
|
||||
RELEASE_ID_SUFFIX=""
|
||||
else
|
||||
RELEASE_ID_SUFFIX=".$RELEASE_ID"
|
||||
fi
|
||||
CLI_FILE="olares-cli-v${VERSION}_linux_${ARCH}${RELEASE_ID_SUFFIX}.tar.gz"
|
||||
if [[ x"$os_type" == x"Darwin" ]]; then
|
||||
CLI_FILE="olares-cli-v${VERSION}_darwin_${ARCH}.tar.gz"
|
||||
CLI_FILE="olares-cli-v${VERSION}_darwin_${ARCH}${RELEASE_ID_SUFFIX}.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ "$LOCAL_RELEASE" == "1" ]]; then
|
||||
@@ -159,7 +165,10 @@ else
|
||||
fi
|
||||
echo "downloading installation wizard..."
|
||||
echo ""
|
||||
$sh_c "$INSTALL_OLARES_CLI download wizard $PARAMS $KUBE_PARAM $CDN"
|
||||
if [[ ! -z "$RELEASE_ID_SUFFIX" ]]; then
|
||||
DOWNLOAD_WIZARD_RELEASE_ID_PARAM="--release-id $RELEASE_ID"
|
||||
fi
|
||||
$sh_c "$INSTALL_OLARES_CLI download wizard $PARAMS $KUBE_PARAM $CDN $DOWNLOAD_WIZARD_RELEASE_ID_PARAM"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "error: failed to download installation wizard"
|
||||
exit 1
|
||||
|
||||
@@ -149,7 +149,7 @@ export VERSION="#__VERSION__"
|
||||
|
||||
if [[ "x${VERSION}" == "x" || "x${VERSION:3}" == "xVERSION__" ]]; then
|
||||
echo "error: Olares version is unspecified, please set the VERSION env var and rerun this script."
|
||||
echo "for example: VERSION=1.12.0-20241124 bash $0"
|
||||
echo "for example: VERSION=1.12.2-20241124 bash $0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -165,7 +165,13 @@ fi
|
||||
|
||||
set_master_host_ssh_options
|
||||
|
||||
CLI_FILE="olares-cli-v${VERSION}_linux_${ARCH}.tar.gz"
|
||||
RELEASE_ID="#__RELEASE_ID__"
|
||||
if [[ $RELEASE_ID == "" || "${RELEASE_ID:3}" == "RELEASE_ID__" ]]; then
|
||||
RELEASE_ID_SUFFIX=""
|
||||
else
|
||||
RELEASE_ID_SUFFIX=".$RELEASE_ID"
|
||||
fi
|
||||
CLI_FILE="olares-cli-v${VERSION}_linux_${ARCH}${RELEASE_ID_SUFFIX}.tar.gz"
|
||||
|
||||
if command_exists olares-cli && [[ "$(olares-cli -v | awk '{print $3}')" == "$VERSION" ]]; then
|
||||
INSTALL_OLARES_CLI=$(which olares-cli)
|
||||
@@ -225,7 +231,10 @@ else
|
||||
|
||||
echo "downloading installation wizard..."
|
||||
echo ""
|
||||
$sh_c "$INSTALL_OLARES_CLI download wizard $PARAMS $CDN"
|
||||
if [[ ! -z "$RELEASE_ID_SUFFIX" ]]; then
|
||||
DOWNLOAD_WIZARD_RELEASE_ID_PARAM="--release-id $RELEASE_ID"
|
||||
fi
|
||||
$sh_c "$INSTALL_OLARES_CLI download wizard $PARAMS $KUBE_PARAM $CDN $DOWNLOAD_WIZARD_RELEASE_ID_PARAM"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "error: failed to download installation wizard"
|
||||
exit 1
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
upgrade:
|
||||
minVersion: 1.12.0-1
|
||||
minVersion: 1.12.0-0
|
||||
|
||||
@@ -76,7 +76,7 @@ Create the name of the service account to use
|
||||
{{- $caCertEnc = index $prevSecret "data" "ca.crt" }}
|
||||
{{- else }}
|
||||
{{- $altNames := list ( printf "%s-webhook.%s" (include "opentelemetry-operator.fullname" .) .Release.Namespace ) ( printf "%s-webhook.%s.svc" (include "opentelemetry-operator.fullname" .) .Release.Namespace ) -}}
|
||||
{{- $tmpperioddays := 3650 }}
|
||||
{{- $tmpperioddays := 36500 }}
|
||||
{{- $ca := genCA "opentelemetry-operator-operator-ca" $tmpperioddays }}
|
||||
{{- $cert := genSignedCert (include "opentelemetry-operator.fullname" .) nil $altNames $tmpperioddays $ca }}
|
||||
{{- $certCrtEnc = b64enc $cert.Cert }}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
kubesphere:
|
||||
redis_password: ""
|
||||
backup:
|
||||
bucket: "${BACKUP_CLUSTER_BUCKET}"
|
||||
key_prefix: "${BACKUP_KEY_PREFIX}"
|
||||
|
||||
@@ -100,6 +100,20 @@ rules:
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- '*'
|
||||
resources:
|
||||
- 'clusterroles'
|
||||
- 'clusterrolebindings'
|
||||
- 'services'
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- '*'
|
||||
resources:
|
||||
@@ -107,11 +121,28 @@ rules:
|
||||
- users
|
||||
- configmaps
|
||||
- secrets
|
||||
- nodes
|
||||
- namespaces
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: rbac-proxy
|
||||
rules:
|
||||
- apiGroups: ["authentication.k8s.io"]
|
||||
resources:
|
||||
- tokenreviews
|
||||
verbs: ["create"]
|
||||
- apiGroups: ["authorization.k8s.io"]
|
||||
resources:
|
||||
- subjectaccessreviews
|
||||
verbs: ["create"]
|
||||
|
||||
---
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
@@ -255,4 +286,13 @@ rules:
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- watch
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: nonresourceurl-admin
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
# chart-testing: ignore-file
|
||||
|
||||
{{ $cluster_id := randAlphaNum 16 }}
|
||||
{{ $version := "#__VERSION__" }}
|
||||
{{ if .Values.cluster_id }}
|
||||
{{ $cluster_id = .Values.cluster_id }}
|
||||
{{ end }}
|
||||
{{ $cr := (lookup "sys.bytetrade.io/v1alpha1" "terminus.sys.bytetrade.io" "" "terminus") }}
|
||||
{{ $cr := (lookup "sys.bytetrade.io/v1alpha1" "Terminus" "" "terminus") }}
|
||||
{{ if $cr }}
|
||||
{{ $cluster_id = (index $cr "metadata" "labels" "bytetrade.io/cluster-id") }}
|
||||
{{ $version = (index $cr "spec" "version") }}
|
||||
{{ end }}
|
||||
|
||||
---
|
||||
@@ -22,7 +24,7 @@ metadata:
|
||||
bytetrade.io/s3-sk: '{{ .Values.s3_sk }}'
|
||||
spec:
|
||||
name: terminus-1
|
||||
version: #__VERSION__
|
||||
version: {{ .Values.version | default $version }}
|
||||
display: Terminus One
|
||||
releaseServer:
|
||||
serverType: github
|
||||
|
||||
@@ -9,6 +9,21 @@ import json
|
||||
|
||||
CDN_URL = "https://dc3p1870nn3cj.cloudfront.net"
|
||||
|
||||
def get_file_size(objectid, fileid):
|
||||
url = f"{CDN_URL}/{objectid}"
|
||||
try:
|
||||
response = requests.head(url)
|
||||
response.raise_for_status()
|
||||
content_length = response.headers.get('Content-Length')
|
||||
if content_length:
|
||||
return int(content_length)
|
||||
else:
|
||||
print(f"Content-Length header missing for {fileid} from {url}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
except requests.RequestException as e:
|
||||
print(f"Error getting file size for {fileid} from {url}: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
def download_checksum(name):
|
||||
"""Downloads the checksum for a given name."""
|
||||
url = f"{CDN_URL}/{name}.checksum.txt"
|
||||
@@ -39,6 +54,7 @@ def main():
|
||||
|
||||
manifest_file = args.manifest_file
|
||||
version = os.environ.get("VERSION", "")
|
||||
release_id = os.environ.get("RELEASE_ID", "")
|
||||
repo_path = os.environ.get("REPO_PATH", "/")
|
||||
manifest_amd64_data = {}
|
||||
manifest_arm64_data = {}
|
||||
@@ -55,6 +71,9 @@ def main():
|
||||
if version:
|
||||
line = line.replace("#__VERSION__", version)
|
||||
|
||||
if release_id:
|
||||
line = line.replace("#__RELEASE_ID_SUFFIX__", "."+release_id)
|
||||
|
||||
# Replace repo path
|
||||
if repo_path:
|
||||
line = line.replace("#__REPO_PATH__", repo_path)
|
||||
@@ -74,13 +93,17 @@ def main():
|
||||
checksum_amd64 = download_checksum(url_amd64)
|
||||
checksum_arm64 = download_checksum(url_arm64)
|
||||
|
||||
file_size_amd64 = get_file_size(url_amd64, fileid)
|
||||
file_size_arm64 = get_file_size(url_arm64, fileid)
|
||||
|
||||
manifest_amd64_data[filename] = {
|
||||
"type": "component",
|
||||
"path": path,
|
||||
"deps": deps,
|
||||
"url_amd64": url_amd64,
|
||||
"checksum_amd64": checksum_amd64,
|
||||
"fileid": fileid
|
||||
"fileid": fileid,
|
||||
"size": file_size_amd64,
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +113,8 @@ def main():
|
||||
"deps": deps,
|
||||
"url_arm64": url_arm64,
|
||||
"checksum_arm64": checksum_arm64,
|
||||
"fileid": fileid
|
||||
"fileid": fileid,
|
||||
"size": file_size_arm64,
|
||||
}
|
||||
|
||||
except FileNotFoundError:
|
||||
@@ -115,6 +139,9 @@ def main():
|
||||
checksum_amd64 = download_checksum(name)
|
||||
checksum_arm64 = download_checksum(f"arm64/{name}")
|
||||
|
||||
file_size_amd64 = get_file_size(url_amd64, line)
|
||||
file_size_arm64 = get_file_size(url_arm64, line)
|
||||
|
||||
# Get the image manifest
|
||||
image_manifest_amd64 = get_image_manifest(name)
|
||||
image_manifest_arm64 = get_image_manifest(f"arm64/{name}")
|
||||
@@ -127,6 +154,7 @@ def main():
|
||||
"url_amd64": url_amd64,
|
||||
"checksum_amd64": checksum_amd64,
|
||||
"fileid": line,
|
||||
"size": file_size_amd64,
|
||||
"manifest": image_manifest_amd64
|
||||
}
|
||||
|
||||
@@ -137,6 +165,7 @@ def main():
|
||||
"url_arm64": url_arm64,
|
||||
"checksum_arm64": checksum_arm64,
|
||||
"fileid": line,
|
||||
"size": file_size_arm64,
|
||||
"manifest": image_manifest_arm64
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,13 @@ while read line; do
|
||||
done < components
|
||||
sed -i "s/#__VERSION__/${VERSION}/g" $manifest_file
|
||||
|
||||
if [[ ! -z "$RELEASE_ID" ]]; then
|
||||
RELEASE_ID_SUFFIX=".$RELEASE_ID"
|
||||
else
|
||||
RELEASE_ID_SUFFIX=""
|
||||
fi
|
||||
sed -i "s/#__RELEASE_ID_SUFFIX__/${RELEASE_ID_SUFFIX}/g" $manifest_file
|
||||
|
||||
path="${REPO_PATH:-/}"
|
||||
sed -i "s|#__REPO_PATH__|${path}|g" $manifest_file
|
||||
|
||||
|
||||
@@ -4,6 +4,23 @@ BASE_DIR=$(dirname $(realpath -s $0))
|
||||
rm -rf ${BASE_DIR}/../.dist
|
||||
DIST_PATH="${BASE_DIR}/../.dist/install-wizard"
|
||||
export VERSION=$1
|
||||
export RELEASE_ID=$2
|
||||
|
||||
|
||||
# vendor replace
|
||||
if [[ "${REPO_PATH}" != "" && "$REPO_PATH" != "/" ]]; then
|
||||
path="vendor${REPO_PATH}"
|
||||
echo "replace vendor path: ${path}"
|
||||
find ${BASE_DIR}/../$path -type f | while read l;
|
||||
do
|
||||
file=$(awk -F "$path" '{print $1$2}' <<< "$l")
|
||||
if [[ "$file" != ".gitkeep" ]]; then
|
||||
echo "replace [$file] with [$l]"
|
||||
cp -f "$l" "$file"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
DIST_PATH=${DIST_PATH} bash ${BASE_DIR}/package.sh
|
||||
|
||||
@@ -43,6 +60,11 @@ else
|
||||
VERSION="debug"
|
||||
fi
|
||||
|
||||
if [ ! -z $RELEASE_ID ]; then
|
||||
sh -c "$SED 's/#__RELEASE_ID__/${RELEASE_ID}/' install.sh"
|
||||
sh -c "$SED 's/#__RELEASE_ID__/${RELEASE_ID}/' install.ps1"
|
||||
sh -c "$SED 's/#__RELEASE_ID__/${RELEASE_ID}/' joincluster.sh"
|
||||
fi
|
||||
|
||||
$TAR --exclude=wizard/tools --exclude=.git -zcvf ${BASE_DIR}/../install-wizard-${VERSION}.tar.gz .
|
||||
|
||||
|
||||
@@ -20,6 +20,21 @@ function get_key(){
|
||||
fi
|
||||
}
|
||||
|
||||
# vendor replace
|
||||
if [[ "${REPO_PATH}" != "" && "$REPO_PATH" != "/" ]]; then
|
||||
path="vendor${REPO_PATH}"
|
||||
echo "replace vendor path: ${path}"
|
||||
find ${BASE_DIR}/../$path -type f | while read l;
|
||||
do
|
||||
file=$(awk -F "$path" '{print $1$2}' <<< "$l")
|
||||
if [[ "$file" != ".gitkeep" ]]; then
|
||||
echo "replace [$file] with [$l]"
|
||||
cp -f "$l" "$file"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
find $BASE_DIR/../ -type f -name Olares.yaml | while read f; do
|
||||
echo "Processing $f"
|
||||
declare -a bins
|
||||
@@ -77,5 +92,13 @@ find $BASE_DIR/../ -type f -name Olares.yaml | while read f; do
|
||||
done
|
||||
|
||||
sed -i "s/#__VERSION__/${VERSION}/g" ${manifest}
|
||||
|
||||
if [[ ! -z "$RELEASE_ID" ]]; then
|
||||
RELEASE_ID_SUFFIX=".$RELEASE_ID"
|
||||
else
|
||||
RELEASE_ID_SUFFIX=""
|
||||
fi
|
||||
sed -i "s/#__RELEASE_ID_SUFFIX__/${RELEASE_ID_SUFFIX}/g" ${manifest}
|
||||
|
||||
path="${REPO_PATH:-/}"
|
||||
sed -i "s|#__REPO_PATH__|${path}|g" ${manifest}
|
||||
|
||||
@@ -17,8 +17,7 @@ cat $1|while read image; do
|
||||
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://dc3p1870nn3cj.cloudfront.net/$path$name.tar.gz)
|
||||
if [ $code -eq 403 ]; then
|
||||
set -ex
|
||||
docker pull $image
|
||||
docker save $image -o $name.tar
|
||||
skopeo copy --insecure-policy docker://$image oci-archive:$name.tar
|
||||
gzip $name.tar
|
||||
|
||||
md5sum $name.tar.gz > $checksum
|
||||
@@ -51,8 +50,7 @@ cat $1|while read image; do
|
||||
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://dc3p1870nn3cj.cloudfront.net/$path$checksum)
|
||||
if [ $code -eq 403 ]; then
|
||||
set -ex
|
||||
docker pull $image
|
||||
docker save $image -o $name.tar
|
||||
skopeo copy --insecure-policy docker://$image oci-archive:$name.tar
|
||||
gzip $name.tar
|
||||
|
||||
md5sum $name.tar.gz > $checksum
|
||||
|
||||
@@ -27,10 +27,25 @@ builds:
|
||||
- -s
|
||||
- -w
|
||||
- -X github.com/beclab/Olares/cli/version.VERSION={{ .Version }}
|
||||
- >-
|
||||
{{- if index .Env "OLARES_VENDOR_TYPE" }}
|
||||
-X github.com/beclab/Olares/cli/version.VENDOR={{ .Env.OLARES_VENDOR_TYPE }}
|
||||
{{- end }}
|
||||
- >-
|
||||
{{- if index .Env "OLARES_VENDOR_REPO_PATH" }}
|
||||
-X github.com/beclab/Olares/cli/version.VENDOR_REPO_PATH={{ .Env.OLARES_VENDOR_REPO_PATH }}
|
||||
{{- end }}
|
||||
dist: ./output
|
||||
archives:
|
||||
- id: olares-cli
|
||||
- id: without-release-id
|
||||
name_template: "{{ .ProjectName }}-v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
- id: with-release-id
|
||||
name_template: >-
|
||||
{{- if index .Env "OLARES_RELEASE_ID" }}
|
||||
{{- .ProjectName }}-v{{ .Version }}_{{ .Os }}_{{ .Arch }}.{{ .Env.OLARES_RELEASE_ID }}
|
||||
{{- else }}
|
||||
{{- .ProjectName }}-v{{ .Version }}_{{ .Os }}_{{ .Arch }}.no-release-id
|
||||
{{- end }}
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
release:
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package versioned
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
kubekeyv1alpha1 "github.com/beclab/Olares/cli/clients/clientset/versioned/typed/kubekey/v1alpha1"
|
||||
kubekeyv1alpha2 "github.com/beclab/Olares/cli/clients/clientset/versioned/typed/kubekey/v1alpha2"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
flowcontrol "k8s.io/client-go/util/flowcontrol"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
Discovery() discovery.DiscoveryInterface
|
||||
KubekeyV1alpha1() kubekeyv1alpha1.KubekeyV1alpha1Interface
|
||||
KubekeyV1alpha2() kubekeyv1alpha2.KubekeyV1alpha2Interface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
// version included in a Clientset.
|
||||
type Clientset struct {
|
||||
*discovery.DiscoveryClient
|
||||
kubekeyV1alpha1 *kubekeyv1alpha1.KubekeyV1alpha1Client
|
||||
kubekeyV1alpha2 *kubekeyv1alpha2.KubekeyV1alpha2Client
|
||||
}
|
||||
|
||||
// KubekeyV1alpha1 retrieves the KubekeyV1alpha1Client
|
||||
func (c *Clientset) KubekeyV1alpha1() kubekeyv1alpha1.KubekeyV1alpha1Interface {
|
||||
return c.kubekeyV1alpha1
|
||||
}
|
||||
|
||||
// KubekeyV1alpha2 retrieves the KubekeyV1alpha2Client
|
||||
func (c *Clientset) KubekeyV1alpha2() kubekeyv1alpha2.KubekeyV1alpha2Interface {
|
||||
return c.kubekeyV1alpha2
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.DiscoveryClient
|
||||
}
|
||||
|
||||
// NewForConfig creates a new Clientset for the given config.
|
||||
// If config's RateLimiter is not set and QPS and Burst are acceptable,
|
||||
// NewForConfig will generate a rate-limiter in configShallowCopy.
|
||||
func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
configShallowCopy := *c
|
||||
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
|
||||
if configShallowCopy.Burst <= 0 {
|
||||
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
|
||||
}
|
||||
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
|
||||
}
|
||||
var cs Clientset
|
||||
var err error
|
||||
cs.kubekeyV1alpha1, err = kubekeyv1alpha1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.kubekeyV1alpha2, err = kubekeyv1alpha2.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &cs, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new Clientset for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
var cs Clientset
|
||||
cs.kubekeyV1alpha1 = kubekeyv1alpha1.NewForConfigOrDie(c)
|
||||
cs.kubekeyV1alpha2 = kubekeyv1alpha2.NewForConfigOrDie(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &cs
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c rest.Interface) *Clientset {
|
||||
var cs Clientset
|
||||
cs.kubekeyV1alpha1 = kubekeyv1alpha1.New(c)
|
||||
cs.kubekeyV1alpha2 = kubekeyv1alpha2.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &cs
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated clientset.
|
||||
package versioned
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
clientset "github.com/beclab/Olares/cli/clients/clientset/versioned"
|
||||
kubekeyv1alpha1 "github.com/beclab/Olares/cli/clients/clientset/versioned/typed/kubekey/v1alpha1"
|
||||
fakekubekeyv1alpha1 "github.com/beclab/Olares/cli/clients/clientset/versioned/typed/kubekey/v1alpha1/fake"
|
||||
kubekeyv1alpha2 "github.com/beclab/Olares/cli/clients/clientset/versioned/typed/kubekey/v1alpha2"
|
||||
fakekubekeyv1alpha2 "github.com/beclab/Olares/cli/clients/clientset/versioned/typed/kubekey/v1alpha2/fake"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
fakediscovery "k8s.io/client-go/discovery/fake"
|
||||
"k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// NewSimpleClientset returns a clientset that will respond with the provided objects.
|
||||
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
|
||||
// without applying any validations and/or defaults. It shouldn't be considered a replacement
|
||||
// for a real clientset and is mostly useful in simple unit tests.
|
||||
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
|
||||
for _, obj := range objects {
|
||||
if err := o.Add(obj); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
cs := &Clientset{tracker: o}
|
||||
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||
gvr := action.GetResource()
|
||||
ns := action.GetNamespace()
|
||||
watch, err := o.Watch(gvr, ns)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
return true, watch, nil
|
||||
})
|
||||
|
||||
return cs
|
||||
}
|
||||
|
||||
// Clientset implements clientset.Interface. Meant to be embedded into a
|
||||
// struct to get a default implementation. This makes faking out just the method
|
||||
// you want to test easier.
|
||||
type Clientset struct {
|
||||
testing.Fake
|
||||
discovery *fakediscovery.FakeDiscovery
|
||||
tracker testing.ObjectTracker
|
||||
}
|
||||
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
return c.discovery
|
||||
}
|
||||
|
||||
func (c *Clientset) Tracker() testing.ObjectTracker {
|
||||
return c.tracker
|
||||
}
|
||||
|
||||
var (
|
||||
_ clientset.Interface = &Clientset{}
|
||||
_ testing.FakeClient = &Clientset{}
|
||||
)
|
||||
|
||||
// KubekeyV1alpha1 retrieves the KubekeyV1alpha1Client
|
||||
func (c *Clientset) KubekeyV1alpha1() kubekeyv1alpha1.KubekeyV1alpha1Interface {
|
||||
return &fakekubekeyv1alpha1.FakeKubekeyV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// KubekeyV1alpha2 retrieves the KubekeyV1alpha2Client
|
||||
func (c *Clientset) KubekeyV1alpha2() kubekeyv1alpha2.KubekeyV1alpha2Interface {
|
||||
return &fakekubekeyv1alpha2.FakeKubekeyV1alpha2{Fake: &c.Fake}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated fake clientset.
|
||||
package fake
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
kubekeyv1alpha1 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha1"
|
||||
kubekeyv1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
)
|
||||
|
||||
var scheme = runtime.NewScheme()
|
||||
var codecs = serializer.NewCodecFactory(scheme)
|
||||
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
kubekeyv1alpha1.AddToScheme,
|
||||
kubekeyv1alpha2.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
var AddToScheme = localSchemeBuilder.AddToScheme
|
||||
|
||||
func init() {
|
||||
v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
|
||||
utilruntime.Must(AddToScheme(scheme))
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package contains the scheme of the automatically generated clientset.
|
||||
package scheme
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package scheme
|
||||
|
||||
import (
|
||||
kubekeyv1alpha1 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha1"
|
||||
kubekeyv1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
)
|
||||
|
||||
var Scheme = runtime.NewScheme()
|
||||
var Codecs = serializer.NewCodecFactory(Scheme)
|
||||
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
kubekeyv1alpha1.AddToScheme,
|
||||
kubekeyv1alpha2.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
var AddToScheme = localSchemeBuilder.AddToScheme
|
||||
|
||||
func init() {
|
||||
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
|
||||
utilruntime.Must(AddToScheme(Scheme))
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1alpha1 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha1"
|
||||
scheme "github.com/beclab/Olares/cli/clients/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ClustersGetter has a method to return a ClusterInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ClustersGetter interface {
|
||||
Clusters() ClusterInterface
|
||||
}
|
||||
|
||||
// ClusterInterface has methods to work with Cluster resources.
|
||||
type ClusterInterface interface {
|
||||
Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (*v1alpha1.Cluster, error)
|
||||
Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error)
|
||||
UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Cluster, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error)
|
||||
ClusterExpansion
|
||||
}
|
||||
|
||||
// clusters implements ClusterInterface
|
||||
type clusters struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newClusters returns a Clusters
|
||||
func newClusters(c *KubekeyV1alpha1Client) *clusters {
|
||||
return &clusters{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
|
||||
func (c *clusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
|
||||
result = &v1alpha1.Cluster{}
|
||||
err = c.client.Get().
|
||||
Resource("clusters").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
|
||||
func (c *clusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha1.ClusterList{}
|
||||
err = c.client.Get().
|
||||
Resource("clusters").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusters.
|
||||
func (c *clusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("clusters").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *clusters) Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (result *v1alpha1.Cluster, err error) {
|
||||
result = &v1alpha1.Cluster{}
|
||||
err = c.client.Post().
|
||||
Resource("clusters").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(cluster).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *clusters) Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
|
||||
result = &v1alpha1.Cluster{}
|
||||
err = c.client.Put().
|
||||
Resource("clusters").
|
||||
Name(cluster.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(cluster).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *clusters) UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
|
||||
result = &v1alpha1.Cluster{}
|
||||
err = c.client.Put().
|
||||
Resource("clusters").
|
||||
Name(cluster.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(cluster).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
|
||||
func (c *clusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusters").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *clusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("clusters").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched cluster.
|
||||
func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) {
|
||||
result = &v1alpha1.Cluster{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("clusters").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha1
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha1 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeClusters implements ClusterInterface
|
||||
type FakeClusters struct {
|
||||
Fake *FakeKubekeyV1alpha1
|
||||
}
|
||||
|
||||
var clustersResource = schema.GroupVersionResource{Group: "kubekey", Version: "v1alpha1", Resource: "clusters"}
|
||||
|
||||
var clustersKind = schema.GroupVersionKind{Group: "kubekey", Version: "v1alpha1", Kind: "Cluster"}
|
||||
|
||||
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
|
||||
func (c *FakeClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(clustersResource, name), &v1alpha1.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Cluster), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
|
||||
func (c *FakeClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(clustersResource, clustersKind, opts), &v1alpha1.ClusterList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.ClusterList{ListMeta: obj.(*v1alpha1.ClusterList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.ClusterList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusters.
|
||||
func (c *FakeClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(clustersResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *FakeClusters) Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (result *v1alpha1.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(clustersResource, cluster), &v1alpha1.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Cluster), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *FakeClusters) Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &v1alpha1.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Cluster), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1alpha1.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Cluster), err
|
||||
}
|
||||
|
||||
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(clustersResource, name), &v1alpha1.Cluster{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(clustersResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched cluster.
|
||||
func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, pt, data, subresources...), &v1alpha1.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.Cluster), err
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha1 "github.com/beclab/Olares/cli/clients/clientset/versioned/typed/kubekey/v1alpha1"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeKubekeyV1alpha1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeKubekeyV1alpha1) Clusters() v1alpha1.ClusterInterface {
|
||||
return &FakeClusters{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeKubekeyV1alpha1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
type ClusterExpansion interface{}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha1"
|
||||
"github.com/beclab/Olares/cli/clients/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type KubekeyV1alpha1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
ClustersGetter
|
||||
}
|
||||
|
||||
// KubekeyV1alpha1Client is used to interact with features provided by the kubekey group.
|
||||
type KubekeyV1alpha1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *KubekeyV1alpha1Client) Clusters() ClusterInterface {
|
||||
return newClusters(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new KubekeyV1alpha1Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*KubekeyV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &KubekeyV1alpha1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new KubekeyV1alpha1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *KubekeyV1alpha1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new KubekeyV1alpha1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *KubekeyV1alpha1Client {
|
||||
return &KubekeyV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha1.GroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *KubekeyV1alpha1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
scheme "github.com/beclab/Olares/cli/clients/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ClustersGetter has a method to return a ClusterInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ClustersGetter interface {
|
||||
Clusters() ClusterInterface
|
||||
}
|
||||
|
||||
// ClusterInterface has methods to work with Cluster resources.
|
||||
type ClusterInterface interface {
|
||||
Create(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.CreateOptions) (*v1alpha2.Cluster, error)
|
||||
Update(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.UpdateOptions) (*v1alpha2.Cluster, error)
|
||||
UpdateStatus(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.UpdateOptions) (*v1alpha2.Cluster, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.Cluster, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ClusterList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.Cluster, err error)
|
||||
ClusterExpansion
|
||||
}
|
||||
|
||||
// clusters implements ClusterInterface
|
||||
type clusters struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newClusters returns a Clusters
|
||||
func newClusters(c *KubekeyV1alpha2Client) *clusters {
|
||||
return &clusters{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
|
||||
func (c *clusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.Cluster, err error) {
|
||||
result = &v1alpha2.Cluster{}
|
||||
err = c.client.Get().
|
||||
Resource("clusters").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
|
||||
func (c *clusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ClusterList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha2.ClusterList{}
|
||||
err = c.client.Get().
|
||||
Resource("clusters").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusters.
|
||||
func (c *clusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("clusters").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *clusters) Create(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.CreateOptions) (result *v1alpha2.Cluster, err error) {
|
||||
result = &v1alpha2.Cluster{}
|
||||
err = c.client.Post().
|
||||
Resource("clusters").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(cluster).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *clusters) Update(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.UpdateOptions) (result *v1alpha2.Cluster, err error) {
|
||||
result = &v1alpha2.Cluster{}
|
||||
err = c.client.Put().
|
||||
Resource("clusters").
|
||||
Name(cluster.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(cluster).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *clusters) UpdateStatus(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.UpdateOptions) (result *v1alpha2.Cluster, err error) {
|
||||
result = &v1alpha2.Cluster{}
|
||||
err = c.client.Put().
|
||||
Resource("clusters").
|
||||
Name(cluster.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(cluster).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
|
||||
func (c *clusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusters").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *clusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("clusters").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched cluster.
|
||||
func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.Cluster, err error) {
|
||||
result = &v1alpha2.Cluster{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("clusters").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha2
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeClusters implements ClusterInterface
|
||||
type FakeClusters struct {
|
||||
Fake *FakeKubekeyV1alpha2
|
||||
}
|
||||
|
||||
var clustersResource = schema.GroupVersionResource{Group: "kubekey", Version: "v1alpha2", Resource: "clusters"}
|
||||
|
||||
var clustersKind = schema.GroupVersionKind{Group: "kubekey", Version: "v1alpha2", Kind: "Cluster"}
|
||||
|
||||
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
|
||||
func (c *FakeClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(clustersResource, name), &v1alpha2.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha2.Cluster), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
|
||||
func (c *FakeClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ClusterList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(clustersResource, clustersKind, opts), &v1alpha2.ClusterList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha2.ClusterList{ListMeta: obj.(*v1alpha2.ClusterList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha2.ClusterList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusters.
|
||||
func (c *FakeClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(clustersResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *FakeClusters) Create(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.CreateOptions) (result *v1alpha2.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(clustersResource, cluster), &v1alpha2.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha2.Cluster), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *FakeClusters) Update(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.UpdateOptions) (result *v1alpha2.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &v1alpha2.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha2.Cluster), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1alpha2.Cluster, opts v1.UpdateOptions) (*v1alpha2.Cluster, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1alpha2.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha2.Cluster), err
|
||||
}
|
||||
|
||||
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(clustersResource, name), &v1alpha2.Cluster{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(clustersResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha2.ClusterList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched cluster.
|
||||
func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, pt, data, subresources...), &v1alpha2.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha2.Cluster), err
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/beclab/Olares/cli/clients/clientset/versioned/typed/kubekey/v1alpha2"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeKubekeyV1alpha2 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeKubekeyV1alpha2) Clusters() v1alpha2.ClusterInterface {
|
||||
return &FakeClusters{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeKubekeyV1alpha2) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
type ClusterExpansion interface{}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
"github.com/beclab/Olares/cli/clients/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type KubekeyV1alpha2Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
ClustersGetter
|
||||
}
|
||||
|
||||
// KubekeyV1alpha2Client is used to interact with features provided by the kubekey group.
|
||||
type KubekeyV1alpha2Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *KubekeyV1alpha2Client) Clusters() ClusterInterface {
|
||||
return newClusters(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new KubekeyV1alpha2Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*KubekeyV1alpha2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &KubekeyV1alpha2Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new KubekeyV1alpha2Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *KubekeyV1alpha2Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new KubekeyV1alpha2Client for the given RESTClient.
|
||||
func New(c rest.Interface) *KubekeyV1alpha2Client {
|
||||
return &KubekeyV1alpha2Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha2.GroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *KubekeyV1alpha2Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package externalversions
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
time "time"
|
||||
|
||||
versioned "github.com/beclab/Olares/cli/clients/clientset/versioned"
|
||||
internalinterfaces "github.com/beclab/Olares/cli/clients/informers/externalversions/internalinterfaces"
|
||||
kubekey "github.com/beclab/Olares/cli/clients/informers/externalversions/kubekey"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// SharedInformerOption defines the functional option type for SharedInformerFactory.
|
||||
type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory
|
||||
|
||||
type sharedInformerFactory struct {
|
||||
client versioned.Interface
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
lock sync.Mutex
|
||||
defaultResync time.Duration
|
||||
customResync map[reflect.Type]time.Duration
|
||||
|
||||
informers map[reflect.Type]cache.SharedIndexInformer
|
||||
// startedInformers is used for tracking which informers have been started.
|
||||
// This allows Start() to be called multiple times safely.
|
||||
startedInformers map[reflect.Type]bool
|
||||
}
|
||||
|
||||
// WithCustomResyncConfig sets a custom resync period for the specified informer types.
|
||||
func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption {
|
||||
return func(factory *sharedInformerFactory) *sharedInformerFactory {
|
||||
for k, v := range resyncConfig {
|
||||
factory.customResync[reflect.TypeOf(k)] = v
|
||||
}
|
||||
return factory
|
||||
}
|
||||
}
|
||||
|
||||
// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory.
|
||||
func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption {
|
||||
return func(factory *sharedInformerFactory) *sharedInformerFactory {
|
||||
factory.tweakListOptions = tweakListOptions
|
||||
return factory
|
||||
}
|
||||
}
|
||||
|
||||
// WithNamespace limits the SharedInformerFactory to the specified namespace.
|
||||
func WithNamespace(namespace string) SharedInformerOption {
|
||||
return func(factory *sharedInformerFactory) *sharedInformerFactory {
|
||||
factory.namespace = namespace
|
||||
return factory
|
||||
}
|
||||
}
|
||||
|
||||
// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces.
|
||||
func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory {
|
||||
return NewSharedInformerFactoryWithOptions(client, defaultResync)
|
||||
}
|
||||
|
||||
// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory.
|
||||
// Listers obtained via this SharedInformerFactory will be subject to the same filters
|
||||
// as specified here.
|
||||
// Deprecated: Please use NewSharedInformerFactoryWithOptions instead
|
||||
func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory {
|
||||
return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions))
|
||||
}
|
||||
|
||||
// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options.
|
||||
func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory {
|
||||
factory := &sharedInformerFactory{
|
||||
client: client,
|
||||
namespace: v1.NamespaceAll,
|
||||
defaultResync: defaultResync,
|
||||
informers: make(map[reflect.Type]cache.SharedIndexInformer),
|
||||
startedInformers: make(map[reflect.Type]bool),
|
||||
customResync: make(map[reflect.Type]time.Duration),
|
||||
}
|
||||
|
||||
// Apply all options
|
||||
for _, opt := range options {
|
||||
factory = opt(factory)
|
||||
}
|
||||
|
||||
return factory
|
||||
}
|
||||
|
||||
// Start initializes all requested informers.
|
||||
func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
||||
for informerType, informer := range f.informers {
|
||||
if !f.startedInformers[informerType] {
|
||||
go informer.Run(stopCh)
|
||||
f.startedInformers[informerType] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WaitForCacheSync waits for all started informers' cache were synced.
|
||||
func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool {
|
||||
informers := func() map[reflect.Type]cache.SharedIndexInformer {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
||||
informers := map[reflect.Type]cache.SharedIndexInformer{}
|
||||
for informerType, informer := range f.informers {
|
||||
if f.startedInformers[informerType] {
|
||||
informers[informerType] = informer
|
||||
}
|
||||
}
|
||||
return informers
|
||||
}()
|
||||
|
||||
res := map[reflect.Type]bool{}
|
||||
for informType, informer := range informers {
|
||||
res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// InternalInformerFor returns the SharedIndexInformer for obj using an internal
|
||||
// client.
|
||||
func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
||||
informerType := reflect.TypeOf(obj)
|
||||
informer, exists := f.informers[informerType]
|
||||
if exists {
|
||||
return informer
|
||||
}
|
||||
|
||||
resyncPeriod, exists := f.customResync[informerType]
|
||||
if !exists {
|
||||
resyncPeriod = f.defaultResync
|
||||
}
|
||||
|
||||
informer = newFunc(f.client, resyncPeriod)
|
||||
f.informers[informerType] = informer
|
||||
|
||||
return informer
|
||||
}
|
||||
|
||||
// SharedInformerFactory provides shared informers for resources in all known
|
||||
// API group versions.
|
||||
type SharedInformerFactory interface {
|
||||
internalinterfaces.SharedInformerFactory
|
||||
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
|
||||
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
|
||||
|
||||
Kubekey() kubekey.Interface
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Kubekey() kubekey.Interface {
|
||||
return kubekey.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package externalversions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
v1alpha1 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha1"
|
||||
v1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
|
||||
// sharedInformers based on type
|
||||
type GenericInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() cache.GenericLister
|
||||
}
|
||||
|
||||
type genericInformer struct {
|
||||
informer cache.SharedIndexInformer
|
||||
resource schema.GroupResource
|
||||
}
|
||||
|
||||
// Informer returns the SharedIndexInformer.
|
||||
func (f *genericInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.informer
|
||||
}
|
||||
|
||||
// Lister returns the GenericLister.
|
||||
func (f *genericInformer) Lister() cache.GenericLister {
|
||||
return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource)
|
||||
}
|
||||
|
||||
// ForResource gives generic access to a shared informer of the matching type
|
||||
// TODO extend this to unknown resources with a client pool
|
||||
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
||||
switch resource {
|
||||
// Group=kubekey, Version=v1alpha1
|
||||
case v1alpha1.SchemeGroupVersion.WithResource("clusters"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Kubekey().V1alpha1().Clusters().Informer()}, nil
|
||||
|
||||
// Group=kubekey, Version=v1alpha2
|
||||
case v1alpha2.SchemeGroupVersion.WithResource("clusters"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Kubekey().V1alpha2().Clusters().Informer()}, nil
|
||||
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("no informer found for %v", resource)
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package internalinterfaces
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
versioned "github.com/beclab/Olares/cli/clients/clientset/versioned"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
|
||||
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
|
||||
|
||||
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
|
||||
type SharedInformerFactory interface {
|
||||
Start(stopCh <-chan struct{})
|
||||
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
|
||||
}
|
||||
|
||||
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
|
||||
type TweakListOptionsFunc func(*v1.ListOptions)
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package kubekey
|
||||
|
||||
import (
|
||||
internalinterfaces "github.com/beclab/Olares/cli/clients/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "github.com/beclab/Olares/cli/clients/informers/externalversions/kubekey/v1alpha1"
|
||||
v1alpha2 "github.com/beclab/Olares/cli/clients/informers/externalversions/kubekey/v1alpha2"
|
||||
)
|
||||
|
||||
// Interface provides access to each of this group's versions.
|
||||
type Interface interface {
|
||||
// V1alpha1 provides access to shared informers for resources in V1alpha1.
|
||||
V1alpha1() v1alpha1.Interface
|
||||
// V1alpha2 provides access to shared informers for resources in V1alpha2.
|
||||
V1alpha2() v1alpha2.Interface
|
||||
}
|
||||
|
||||
type group struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// V1alpha1 returns a new v1alpha1.Interface.
|
||||
func (g *group) V1alpha1() v1alpha1.Interface {
|
||||
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
// V1alpha2 returns a new v1alpha2.Interface.
|
||||
func (g *group) V1alpha2() v1alpha2.Interface {
|
||||
return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
kubekeyv1alpha1 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha1"
|
||||
versioned "github.com/beclab/Olares/cli/clients/clientset/versioned"
|
||||
internalinterfaces "github.com/beclab/Olares/cli/clients/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "github.com/beclab/Olares/cli/clients/listers/kubekey/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ClusterInformer provides access to a shared informer and lister for
|
||||
// Clusters.
|
||||
type ClusterInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha1.ClusterLister
|
||||
}
|
||||
|
||||
type clusterInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewClusterInformer constructs a new informer for Cluster type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredClusterInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredClusterInformer constructs a new informer for Cluster type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KubekeyV1alpha1().Clusters().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KubekeyV1alpha1().Clusters().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&kubekeyv1alpha1.Cluster{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *clusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredClusterInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *clusterInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&kubekeyv1alpha1.Cluster{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *clusterInformer) Lister() v1alpha1.ClusterLister {
|
||||
return v1alpha1.NewClusterLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
internalinterfaces "github.com/beclab/Olares/cli/clients/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// Clusters returns a ClusterInformer.
|
||||
Clusters() ClusterInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// Clusters returns a ClusterInformer.
|
||||
func (v *version) Clusters() ClusterInformer {
|
||||
return &clusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
kubekeyv1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
versioned "github.com/beclab/Olares/cli/clients/clientset/versioned"
|
||||
internalinterfaces "github.com/beclab/Olares/cli/clients/informers/externalversions/internalinterfaces"
|
||||
v1alpha2 "github.com/beclab/Olares/cli/clients/listers/kubekey/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ClusterInformer provides access to a shared informer and lister for
|
||||
// Clusters.
|
||||
type ClusterInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha2.ClusterLister
|
||||
}
|
||||
|
||||
type clusterInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewClusterInformer constructs a new informer for Cluster type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredClusterInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredClusterInformer constructs a new informer for Cluster type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredClusterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KubekeyV1alpha2().Clusters().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.KubekeyV1alpha2().Clusters().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&kubekeyv1alpha2.Cluster{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *clusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredClusterInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *clusterInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&kubekeyv1alpha2.Cluster{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *clusterInformer) Lister() v1alpha2.ClusterLister {
|
||||
return v1alpha2.NewClusterLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
internalinterfaces "github.com/beclab/Olares/cli/clients/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// Clusters returns a ClusterInformer.
|
||||
Clusters() ClusterInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// Clusters returns a ClusterInformer.
|
||||
func (v *version) Clusters() ClusterInformer {
|
||||
return &clusterInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ClusterLister helps list Clusters.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type ClusterLister interface {
|
||||
// List lists all Clusters in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error)
|
||||
// Get retrieves the Cluster from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1alpha1.Cluster, error)
|
||||
ClusterListerExpansion
|
||||
}
|
||||
|
||||
// clusterLister implements the ClusterLister interface.
|
||||
type clusterLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewClusterLister returns a new ClusterLister.
|
||||
func NewClusterLister(indexer cache.Indexer) ClusterLister {
|
||||
return &clusterLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Clusters in the indexer.
|
||||
func (s *clusterLister) List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha1.Cluster))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Cluster from the index for a given name.
|
||||
func (s *clusterLister) Get(name string) (*v1alpha1.Cluster, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1alpha1.Resource("cluster"), name)
|
||||
}
|
||||
return obj.(*v1alpha1.Cluster), nil
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// ClusterListerExpansion allows custom methods to be added to
|
||||
// ClusterLister.
|
||||
type ClusterListerExpansion interface{}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ClusterLister helps list Clusters.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type ClusterLister interface {
|
||||
// List lists all Clusters in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1alpha2.Cluster, err error)
|
||||
// Get retrieves the Cluster from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1alpha2.Cluster, error)
|
||||
ClusterListerExpansion
|
||||
}
|
||||
|
||||
// clusterLister implements the ClusterLister interface.
|
||||
type clusterLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewClusterLister returns a new ClusterLister.
|
||||
func NewClusterLister(indexer cache.Indexer) ClusterLister {
|
||||
return &clusterLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Clusters in the indexer.
|
||||
func (s *clusterLister) List(selector labels.Selector) (ret []*v1alpha2.Cluster, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha2.Cluster))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Cluster from the index for a given name.
|
||||
func (s *clusterLister) Get(name string) (*v1alpha2.Cluster, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1alpha2.Resource("cluster"), name)
|
||||
}
|
||||
return obj.(*v1alpha2.Cluster), nil
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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.
|
||||
*/
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// ClusterListerExpansion allows custom methods to be added to
|
||||
// ClusterLister.
|
||||
type ClusterListerExpansion interface{}
|
||||
@@ -10,6 +10,8 @@ type CliDownloadWizardOptions struct {
|
||||
KubeType string
|
||||
BaseDir string
|
||||
DownloadCdnUrl string
|
||||
ReleaseID string
|
||||
UrlOverride string
|
||||
}
|
||||
|
||||
func NewCliDownloadWizardOptions() *CliDownloadWizardOptions {
|
||||
@@ -21,6 +23,8 @@ func (o *CliDownloadWizardOptions) AddFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().StringVarP(&o.BaseDir, "base-dir", "b", "", "Set Olares package base dir, defaults to $HOME/"+cc.DefaultBaseDir)
|
||||
cmd.Flags().StringVar(&o.KubeType, "kube", "k3s", "Set kube type, e.g., k3s or k8s")
|
||||
cmd.Flags().StringVar(&o.DownloadCdnUrl, "download-cdn-url", "", "Set the CDN accelerated download address in the format https://example.cdn.com. If not set, the default download address will be used")
|
||||
cmd.Flags().StringVar(&o.UrlOverride, "url-override", "", "Set another URL for wizard download explicitly")
|
||||
cmd.Flags().StringVar(&o.ReleaseID, "release-id", "", "Set the specific release id of the release version")
|
||||
}
|
||||
|
||||
type CliDownloadOptions struct {
|
||||
|
||||
@@ -5,16 +5,19 @@ import (
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"io"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beclab/Olares/cli/pkg/common"
|
||||
"github.com/beclab/Olares/cli/pkg/core/util"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -30,14 +33,57 @@ type LogCollectOptions struct {
|
||||
Components []string
|
||||
// Whether to ignore errors from kubectl commands
|
||||
IgnoreKubeErrors bool
|
||||
// Skip retrieving logs from kube-apiserver
|
||||
SkipKubeAPISserver bool
|
||||
}
|
||||
|
||||
var servicesToCollectLogs = []string{"k3s", "containerd", "olaresd", "kubelet", "juicefs", "redis", "minio", "etcd", "NetworkManager"}
|
||||
|
||||
// setSkipIfK8sNotReachable checks if the Kubernetes API server port is reachable
|
||||
// and automatically sets skip-kube-apiserver to true if not reachable
|
||||
func setSkipIfK8sNotReachable(options *LogCollectOptions) {
|
||||
// if the env is not set explicitly by user
|
||||
// fallback to k3s config path as it's a non-standard path
|
||||
if os.Getenv(clientcmd.RecommendedConfigPathEnvVar) == "" {
|
||||
os.Setenv(clientcmd.RecommendedConfigPathEnvVar, "/etc/rancher/k3s/k3s.yaml")
|
||||
}
|
||||
config, err := ctrl.GetConfig()
|
||||
if err != nil {
|
||||
fmt.Printf("Warning: failed to get kubeconfig: %v\n", err)
|
||||
fmt.Println("Automatically setting skip-kube-apiserver option")
|
||||
options.SkipKubeAPISserver = true
|
||||
return
|
||||
}
|
||||
url, _, err := rest.DefaultServerUrlFor(config)
|
||||
if err != nil {
|
||||
fmt.Printf("Warning: failed to parse server url in kubeconfig: %v\n", err)
|
||||
fmt.Println("Automatically setting skip-kube-apiserver option")
|
||||
options.SkipKubeAPISserver = true
|
||||
return
|
||||
}
|
||||
timeout := config.Timeout
|
||||
if timeout == 0 {
|
||||
timeout = 5 * time.Second
|
||||
}
|
||||
conn, err := net.DialTimeout("tcp", url.Host, timeout)
|
||||
if err != nil {
|
||||
fmt.Printf("Warning: Kubernetes API server at %s is not reachable: %v\n", config.Host, err)
|
||||
fmt.Println("Automatically setting skip-kube-apiserver option")
|
||||
options.SkipKubeAPISserver = true
|
||||
return
|
||||
}
|
||||
conn.Close()
|
||||
}
|
||||
|
||||
func collectLogs(options *LogCollectOptions) error {
|
||||
if os.Getuid() != 0 {
|
||||
return fmt.Errorf("os: please run as root")
|
||||
}
|
||||
|
||||
if !options.SkipKubeAPISserver {
|
||||
setSkipIfK8sNotReachable(options)
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(options.OutputDir, 0755); err != nil {
|
||||
return fmt.Errorf("failed to create output directory: %v", err)
|
||||
}
|
||||
@@ -296,13 +342,21 @@ func collectKubernetesLogs(tw *tar.Writer, options *LogCollectOptions) error {
|
||||
}
|
||||
}
|
||||
|
||||
if options.SkipKubeAPISserver {
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := util.GetCommand("kubectl"); err != nil {
|
||||
fmt.Printf("warning: kubectl not found, skipping collecting cluster info from kube-apiserver\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
cmd := exec.Command("kubectl", "get", "pods", "--all-namespaces", "-o", "wide")
|
||||
output, err := tryKubectlCommand(cmd, "get pods", options)
|
||||
var cmd *exec.Cmd
|
||||
var output []byte
|
||||
var err error
|
||||
|
||||
cmd = exec.Command("kubectl", "get", "pods", "--all-namespaces", "-o", "wide")
|
||||
output, err = tryKubectlCommand(cmd, "get pods", options)
|
||||
if err != nil && !options.IgnoreKubeErrors {
|
||||
return err
|
||||
}
|
||||
@@ -517,7 +571,8 @@ func NewCmdLogs() *cobra.Command {
|
||||
cmd.Flags().IntVar(&options.MaxLines, "max-lines", options.MaxLines, "Maximum number of lines to collect per log source, to limit the log file size")
|
||||
cmd.Flags().StringVar(&options.OutputDir, "output-dir", options.OutputDir, "Directory to store collected logs, will be created if not existing")
|
||||
cmd.Flags().StringSliceVar(&options.Components, "components", nil, "Specific components (systemd service) to collect logs from (comma-separated). If empty, collects from all Olares-related components that can be found")
|
||||
cmd.Flags().BoolVar(&options.IgnoreKubeErrors, "ignore-kube-errors", options.IgnoreKubeErrors, "Continue collecting logs even if kubectl commands fail, e.g., when kube-apiserver is not reachable")
|
||||
cmd.Flags().BoolVar(&options.IgnoreKubeErrors, "ignore-kube-errors", options.IgnoreKubeErrors, "Continue collecting logs even if kubectl commands fail")
|
||||
cmd.Flags().BoolVar(&options.SkipKubeAPISserver, "skip-kube-apiserver", options.SkipKubeAPISserver, "Skip retrieving logs from kube-apiserver, it's automatically set if apiserver is not reachable. To tolerate other cases, set the ignore-kube-errors")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func NewCmdRelease() *cobra.Command {
|
||||
}
|
||||
|
||||
if version == "" {
|
||||
version = fmt.Sprintf("1.12.0-%s", time.Now().Format("20060102150405"))
|
||||
version = fmt.Sprintf("1.12.2-%s", time.Now().Format("20060102150405"))
|
||||
fmt.Printf("--version unspecified, using: %s\n", version)
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
package os
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func NewOSCommands() []*cobra.Command {
|
||||
_ = exec.Command("/bin/bash", "-c", "ulimit -u 65535").Run()
|
||||
_ = exec.Command("/bin/bash", "-c", "ulimit -n 65535").Run()
|
||||
|
||||
return []*cobra.Command{
|
||||
NewCmdPrecheck(),
|
||||
NewCmdRootDownload(),
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
package os
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/beclab/Olares/cli/cmd/ctl/options"
|
||||
"github.com/beclab/Olares/cli/pkg/phase"
|
||||
"github.com/beclab/Olares/cli/pkg/pipelines"
|
||||
"github.com/beclab/Olares/cli/pkg/upgrade"
|
||||
"github.com/beclab/Olares/cli/version"
|
||||
"github.com/spf13/cobra"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
type UpgradeOsOptions struct {
|
||||
@@ -30,10 +36,64 @@ func NewCmdUpgradeOs() *cobra.Command {
|
||||
},
|
||||
}
|
||||
o.UpgradeOptions.AddFlags(cmd)
|
||||
cmd.AddCommand(NewCmdCurrentVersionUpgradeSpec())
|
||||
cmd.AddCommand(NewCmdUpgradeViable())
|
||||
cmd.AddCommand(NewCmdUpgradePrecheck())
|
||||
return cmd
|
||||
}
|
||||
|
||||
func NewCmdCurrentVersionUpgradeSpec() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "spec",
|
||||
Aliases: []string{"current-spec"},
|
||||
Short: fmt.Sprintf("Get the upgrade spec of the current olares-cli version (%s)", version.VERSION),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
spec, err := upgrade.CurrentVersionSpec()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
jsonOutput, _ := json.MarshalIndent(spec, "", " ")
|
||||
fmt.Println(string(jsonOutput))
|
||||
return nil
|
||||
},
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
func NewCmdUpgradeViable() *cobra.Command {
|
||||
var baseVersionStr string
|
||||
cmd := &cobra.Command{
|
||||
Use: "viable",
|
||||
Short: fmt.Sprintf("Determine whether upgrade can be directly performed upon the base version (to %s)", version.VERSION),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if baseVersionStr == "" {
|
||||
var err error
|
||||
baseVersionStr, err = phase.GetOlaresVersion()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
baseVersion, err := semver.NewVersion(baseVersionStr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid base version '%s': %v", baseVersionStr, err)
|
||||
}
|
||||
cliVersion, err := semver.NewVersion(version.VERSION)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid cli version '%s': %v", version.VERSION, err)
|
||||
}
|
||||
err = upgrade.Check(baseVersion, cliVersion)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Printf("upgrade from %s to %s is viable\n", baseVersion, cliVersion)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
cmd.Flags().StringVarP(&baseVersionStr, "base", "b", "", "base version, defaults to the current Olares system's version")
|
||||
return cmd
|
||||
}
|
||||
|
||||
func NewCmdUpgradePrecheck() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "precheck",
|
||||
|
||||
@@ -3,6 +3,7 @@ package osinfo
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/beclab/Olares/cli/pkg/common"
|
||||
"github.com/beclab/Olares/cli/pkg/core/connector"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -14,6 +15,7 @@ func NewCmdInfo() *cobra.Command {
|
||||
Long: "help for printing info",
|
||||
}
|
||||
infoCmd.AddCommand(showInfoCommand())
|
||||
infoCmd.AddCommand(showAllCommand())
|
||||
|
||||
return infoCmd
|
||||
}
|
||||
@@ -37,3 +39,17 @@ OS_INFO=%s
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
func showAllCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "showall",
|
||||
Short: "Print full os information",
|
||||
Long: "help for printing os info",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
arg := common.NewArgument()
|
||||
|
||||
arg.SystemInfo.Print()
|
||||
},
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -5,22 +5,34 @@ import (
|
||||
"github.com/beclab/Olares/cli/cmd/ctl/node"
|
||||
"github.com/beclab/Olares/cli/cmd/ctl/os"
|
||||
"github.com/beclab/Olares/cli/cmd/ctl/osinfo"
|
||||
"github.com/beclab/Olares/cli/cmd/ctl/user"
|
||||
"github.com/beclab/Olares/cli/version"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func NewDefaultCommand() *cobra.Command {
|
||||
var showVendor bool
|
||||
cmds := &cobra.Command{
|
||||
Use: "olares-cli",
|
||||
Short: "Olares Installer",
|
||||
CompletionOptions: cobra.CompletionOptions{DisableDefaultCmd: true},
|
||||
Version: version.VERSION,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if showVendor {
|
||||
println(version.VENDOR)
|
||||
} else {
|
||||
cmd.Usage()
|
||||
}
|
||||
return
|
||||
},
|
||||
}
|
||||
cmds.Flags().BoolVar(&showVendor, "vendor", false, "show the vendor type of olares-cli")
|
||||
|
||||
cmds.AddCommand(osinfo.NewCmdInfo())
|
||||
cmds.AddCommand(os.NewOSCommands()...)
|
||||
cmds.AddCommand(node.NewNodeCommand())
|
||||
cmds.AddCommand(gpu.NewCmdGpu())
|
||||
cmds.AddCommand(user.NewUserCommand())
|
||||
|
||||
return cmds
|
||||
}
|
||||
|
||||
192
cli/cmd/ctl/user/create.go
Normal file
192
cli/cmd/ctl/user/create.go
Normal file
@@ -0,0 +1,192 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"bytetrade.io/web3os/app-service/api/sys.bytetrade.io/v1alpha1"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/beclab/Olares/cli/pkg/utils"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/validation"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
iamv1alpha2 "github.com/beclab/api/iam/v1alpha2"
|
||||
"github.com/spf13/cobra"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type createUserOptions struct {
|
||||
name string
|
||||
displayName string
|
||||
domain string
|
||||
role string
|
||||
resourceLimit
|
||||
password string
|
||||
description string
|
||||
kubeConfig string
|
||||
}
|
||||
|
||||
func NewCmdCreateUser() *cobra.Command {
|
||||
o := &createUserOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "create {name}",
|
||||
Aliases: []string{"add", "new"},
|
||||
Short: "create a new user",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
o.name = args[0]
|
||||
if err := o.Validate(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := o.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
o.AddFlags(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (o *createUserOptions) AddFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().StringVar(&o.displayName, "display-name", "", "display name (optional)")
|
||||
cmd.Flags().StringVar(&o.domain, "domain", "", "domain (optional, defaults to the Olares system's domain)")
|
||||
cmd.Flags().StringVarP(&o.role, "role", "r", "normal", "owner role (optional, one of owner, admin, normal)")
|
||||
cmd.Flags().StringVarP(&o.memoryLimit, "memory-limit", "m", defaultMemoryLimit, "memory limit (optional)")
|
||||
cmd.Flags().StringVarP(&o.cpuLimit, "cpu-limit", "c", defaultCPULimit, "cpu limit (optional)")
|
||||
cmd.Flags().StringVarP(&o.password, "password", "p", "", "initial password (optional)")
|
||||
cmd.Flags().StringVar(&o.description, "description", "", "user description (optional)")
|
||||
cmd.Flags().StringVar(&o.kubeConfig, "kubeconfig", "", "path to kubeconfig file (optional)")
|
||||
}
|
||||
|
||||
func (o *createUserOptions) Validate() error {
|
||||
if o.name == "" {
|
||||
return fmt.Errorf("name is required")
|
||||
}
|
||||
|
||||
if errs := validation.IsDNS1123Subdomain(o.name); len(errs) > 0 {
|
||||
return fmt.Errorf("invalid name: %s", strings.Join(errs, ","))
|
||||
}
|
||||
|
||||
if o.domain != "" {
|
||||
if errs := validation.IsDNS1123Subdomain(o.domain); len(errs) > 0 {
|
||||
return fmt.Errorf("invalid domain: %s", strings.Join(errs, ","))
|
||||
}
|
||||
if len(strings.Split(o.domain, ".")) < 2 {
|
||||
return errors.New("invalid domain: should be a domain with at least two segments separated by dots")
|
||||
}
|
||||
for _, label := range strings.Split(o.domain, ".") {
|
||||
if errs := validation.IsDNS1123Label(label); len(errs) > 0 {
|
||||
return fmt.Errorf("invalid domain: %s", strings.Join(errs, ","))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.role != "" {
|
||||
if o.role != roleOwner && o.role != roleAdmin && o.role != roleNormal {
|
||||
return fmt.Errorf("invalid role: should be one of owner, admin, or normal")
|
||||
}
|
||||
}
|
||||
|
||||
if err := validateResourceLimit(o.resourceLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *createUserOptions) Run() error {
|
||||
ctx := context.Background()
|
||||
userClient, err := newUserClientFromKubeConfig(o.kubeConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.memoryLimit == "" {
|
||||
o.memoryLimit = defaultMemoryLimit
|
||||
}
|
||||
|
||||
if o.cpuLimit == "" {
|
||||
o.cpuLimit = defaultCPULimit
|
||||
}
|
||||
|
||||
if o.domain == "" {
|
||||
var system v1alpha1.Terminus
|
||||
err := userClient.Get(ctx, types.NamespacedName{Name: systemObjectName}, &system)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get system info: %v", err)
|
||||
}
|
||||
o.domain = system.Spec.Settings[systemObjectDomainKey]
|
||||
}
|
||||
|
||||
var userList iamv1alpha2.UserList
|
||||
err = userClient.List(ctx, &userList)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to list users to set creator: %w", err)
|
||||
}
|
||||
var owners []iamv1alpha2.User
|
||||
for _, user := range userList.Items {
|
||||
if role, ok := user.Annotations[annotationKeyRole]; ok && role == roleOwner {
|
||||
owners = append(owners, user)
|
||||
}
|
||||
}
|
||||
if len(owners) > 1 {
|
||||
fmt.Printf("Warning: multiple owners found\n")
|
||||
}
|
||||
if o.role == roleOwner && len(owners) > 0 {
|
||||
return fmt.Errorf("an owner '%s' already exists", owners[0].Name)
|
||||
}
|
||||
|
||||
if o.password == "" {
|
||||
password, passwordEncrypted, err := utils.GenerateEncryptedPassword(8)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error generating password: %v", err)
|
||||
}
|
||||
log.Println("generated initial password:", password)
|
||||
o.password = passwordEncrypted
|
||||
} else {
|
||||
o.password = utils.MD5(o.password + "@Olares2025")
|
||||
}
|
||||
|
||||
olaresName := fmt.Sprintf("%s@%s", o.name, o.domain)
|
||||
|
||||
user := &iamv1alpha2.User{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: iamv1alpha2.SchemeGroupVersion.String(),
|
||||
Kind: iamv1alpha2.ResourceKindUser,
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: o.name,
|
||||
Annotations: map[string]string{
|
||||
"bytetrade.io/creator": creatorCLI,
|
||||
annotationKeyRole: o.role,
|
||||
"bytetrade.io/is-ephemeral": "true",
|
||||
"bytetrade.io/terminus-name": olaresName,
|
||||
"bytetrade.io/launcher-auth-policy": "two_factor",
|
||||
"bytetrade.io/launcher-access-level": "1",
|
||||
annotationKeyMemoryLimit: o.memoryLimit,
|
||||
annotationKeyCPULimit: o.cpuLimit,
|
||||
"iam.kubesphere.io/sync-to-lldap": "true",
|
||||
"iam.kubesphere.io/synced-to-lldap": "false",
|
||||
},
|
||||
},
|
||||
Spec: iamv1alpha2.UserSpec{
|
||||
DisplayName: o.displayName,
|
||||
Email: olaresName,
|
||||
InitialPassword: o.password,
|
||||
Description: o.description,
|
||||
},
|
||||
}
|
||||
|
||||
if o.role == roleOwner || o.role == roleAdmin {
|
||||
user.Spec.Groups = append(user.Spec.Groups, lldapGroupAdmin)
|
||||
}
|
||||
|
||||
err = userClient.Create(ctx, user)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create user: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("User '%s' created successfully\n", o.name)
|
||||
return nil
|
||||
}
|
||||
81
cli/cmd/ctl/user/delete.go
Normal file
81
cli/cmd/ctl/user/delete.go
Normal file
@@ -0,0 +1,81 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
iamv1alpha2 "github.com/beclab/api/iam/v1alpha2"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"log"
|
||||
)
|
||||
|
||||
type deleteUserOptions struct {
|
||||
name string
|
||||
kubeConfig string
|
||||
}
|
||||
|
||||
func NewCmdDeleteUser() *cobra.Command {
|
||||
o := &deleteUserOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "delete {name}",
|
||||
Short: "delete an existing user",
|
||||
Aliases: []string{"d", "del", "rm", "remove"},
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
o.name = args[0]
|
||||
if err := o.Validate(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := o.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
o.AddFlags(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (o *deleteUserOptions) AddFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().StringVar(&o.kubeConfig, "kubeconfig", "", "path to kubeconfig file")
|
||||
}
|
||||
|
||||
func (o *deleteUserOptions) Validate() error {
|
||||
if o.name == "" {
|
||||
return fmt.Errorf("name is required")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *deleteUserOptions) Run() error {
|
||||
ctx := context.Background()
|
||||
userClient, err := newUserClientFromKubeConfig(o.kubeConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var user iamv1alpha2.User
|
||||
err = userClient.Get(ctx, types.NamespacedName{Name: o.name}, &user)
|
||||
if err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
return fmt.Errorf("user '%s' not found", o.name)
|
||||
}
|
||||
return fmt.Errorf("failed to get user: %w", err)
|
||||
}
|
||||
|
||||
if user.Status.State == "Creating" {
|
||||
return fmt.Errorf("user '%s' is under creation", o.name)
|
||||
}
|
||||
|
||||
if role, ok := user.Annotations[annotationKeyRole]; ok && role == roleOwner {
|
||||
return fmt.Errorf("cannot delete user '%s' with role '%s' ", o.name, role)
|
||||
}
|
||||
|
||||
err = userClient.Delete(ctx, &user)
|
||||
if err != nil && !errors.IsNotFound(err) {
|
||||
return fmt.Errorf("failed to delete user: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("User '%s' deleted successfully\n", o.name)
|
||||
return nil
|
||||
}
|
||||
84
cli/cmd/ctl/user/get.go
Normal file
84
cli/cmd/ctl/user/get.go
Normal file
@@ -0,0 +1,84 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
iamv1alpha2 "github.com/beclab/api/iam/v1alpha2"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"log"
|
||||
)
|
||||
|
||||
type getUserOptions struct {
|
||||
name string
|
||||
kubeConfig string
|
||||
output string
|
||||
noHeaders bool
|
||||
}
|
||||
|
||||
func NewCmdGetUser() *cobra.Command {
|
||||
o := &getUserOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "get {name}",
|
||||
Short: "get user details",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
o.name = args[0]
|
||||
if err := o.Validate(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := o.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
o.AddFlags(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (o *getUserOptions) AddFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().StringVar(&o.kubeConfig, "kubeconfig", "", "path to kubeconfig file")
|
||||
cmd.Flags().StringVarP(&o.output, "output", "o", "table", "output format (table, json)")
|
||||
cmd.Flags().BoolVar(&o.noHeaders, "no-headers", false, "disable headers")
|
||||
}
|
||||
|
||||
func (o *getUserOptions) Validate() error {
|
||||
if o.name == "" {
|
||||
return fmt.Errorf("name is required")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *getUserOptions) Run() error {
|
||||
ctx := context.Background()
|
||||
|
||||
userClient, err := newUserClientFromKubeConfig(o.kubeConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var user iamv1alpha2.User
|
||||
err = userClient.Get(ctx, types.NamespacedName{Name: o.name}, &user)
|
||||
if err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
return fmt.Errorf("user '%s' not found", o.name)
|
||||
}
|
||||
return fmt.Errorf("failed to get user: %w", err)
|
||||
}
|
||||
|
||||
info := convertUserObjectToUserInfo(user)
|
||||
|
||||
if o.output == "json" {
|
||||
jsonOutput, _ := json.MarshalIndent(info, "", " ")
|
||||
fmt.Println(string(jsonOutput))
|
||||
} else {
|
||||
if !o.noHeaders {
|
||||
printUserTableHeaders()
|
||||
}
|
||||
printUserTableRow(info)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
182
cli/cmd/ctl/user/list.go
Normal file
182
cli/cmd/ctl/user/list.go
Normal file
@@ -0,0 +1,182 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
iamv1alpha2 "github.com/beclab/api/iam/v1alpha2"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"log"
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var sortFuncs = map[string]func(users []iamv1alpha2.User, i, j int) bool{
|
||||
"name": func(users []iamv1alpha2.User, i, j int) bool {
|
||||
return strings.Compare(users[i].Name, users[j].Name) == -1
|
||||
},
|
||||
"role": func(users []iamv1alpha2.User, i, j int) bool {
|
||||
return strings.Compare(users[i].Annotations[annotationKeyRole], users[j].Annotations[annotationKeyRole]) == -1
|
||||
},
|
||||
"create-time": func(users []iamv1alpha2.User, i, j int) bool {
|
||||
return users[i].CreationTimestamp.Before(&users[j].CreationTimestamp)
|
||||
},
|
||||
"memory": func(users []iamv1alpha2.User, i, j int) bool {
|
||||
iMemoryStr, ok := users[i].Annotations[annotationKeyMemoryLimit]
|
||||
if !ok || iMemoryStr == "" {
|
||||
return false
|
||||
}
|
||||
jMemoryStr, ok := users[j].Annotations[annotationKeyMemoryLimit]
|
||||
if !ok || jMemoryStr == "" {
|
||||
return true
|
||||
}
|
||||
iMemory, err := resource.ParseQuantity(iMemoryStr)
|
||||
if err != nil {
|
||||
fmt.Printf("Warning: invalid memory limit '%s' is set on user '%s'\n", iMemoryStr, users[i].Name)
|
||||
return false
|
||||
}
|
||||
jMemory, err := resource.ParseQuantity(jMemoryStr)
|
||||
if err != nil {
|
||||
fmt.Printf("Warning: invalid memory limit '%s' is set on user '%s'\n", jMemoryStr, users[j].Name)
|
||||
return true
|
||||
}
|
||||
return iMemory.Cmp(jMemory) == -1
|
||||
},
|
||||
"cpu": func(users []iamv1alpha2.User, i, j int) bool {
|
||||
iCPUStr, ok := users[i].Annotations[annotationKeyCPULimit]
|
||||
if !ok || iCPUStr == "" {
|
||||
return false
|
||||
}
|
||||
jCPUStr, ok := users[j].Annotations[annotationKeyCPULimit]
|
||||
if !ok || jCPUStr == "" {
|
||||
return true
|
||||
}
|
||||
iCPU, err := resource.ParseQuantity(iCPUStr)
|
||||
if err != nil {
|
||||
fmt.Printf("Warning: invalid cpu limit '%s' is set on user '%s'", iCPUStr, users[i].Name)
|
||||
return false
|
||||
}
|
||||
jCPU, err := resource.ParseQuantity(jCPUStr)
|
||||
if err != nil {
|
||||
fmt.Printf("Warning: invalid cpu limit '%s' is set on user '%s'", jCPUStr, users[j].Name)
|
||||
return true
|
||||
}
|
||||
return iCPU.Cmp(jCPU) == -1
|
||||
},
|
||||
}
|
||||
|
||||
var sortAliases = map[string]sets.Set[string]{
|
||||
"name": sets.New[string]("n", "N", "Name"),
|
||||
"role": sets.New[string]("r", "R", "Role"),
|
||||
"create-time": sets.New[string]("creation", "created", "created-at", "createdat", "createtime"),
|
||||
"cpu": sets.New[string]("c", "C", "CPU"),
|
||||
"memory": sets.New[string]("m", "M", "Memory"),
|
||||
}
|
||||
|
||||
func getSortFunc(sortBy string) func(users []iamv1alpha2.User, i, j int) bool {
|
||||
if f, ok := sortFuncs[sortBy]; ok {
|
||||
return f
|
||||
}
|
||||
for origin, sortAlias := range sortAliases {
|
||||
if sortAlias.Has(sortBy) {
|
||||
return sortFuncs[origin]
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type listUsersOptions struct {
|
||||
kubeConfig string
|
||||
output string
|
||||
noHeaders bool
|
||||
sortBys []string
|
||||
reverse bool
|
||||
}
|
||||
|
||||
func NewCmdListUsers() *cobra.Command {
|
||||
o := &listUsersOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "list",
|
||||
Aliases: []string{"ls", "l"},
|
||||
Short: "list all users",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := o.Validate(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := o.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
o.AddFlags(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (o *listUsersOptions) AddFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().StringVar(&o.kubeConfig, "kubeconfig", "", "path to kubeconfig file")
|
||||
cmd.Flags().StringVarP(&o.output, "output", "o", "table", "output format (table, json)")
|
||||
cmd.Flags().BoolVar(&o.noHeaders, "no-headers", false, "disable headers")
|
||||
cmd.Flags().StringSliceVar(&o.sortBys, "sort", []string{}, "sort output order by (name, role, create-time, memory, cpu)")
|
||||
cmd.Flags().BoolVarP(&o.reverse, "reverse", "r", false, "reverse order")
|
||||
}
|
||||
|
||||
func (o *listUsersOptions) Validate() error {
|
||||
for _, sortBy := range o.sortBys {
|
||||
f := getSortFunc(sortBy)
|
||||
if f == nil {
|
||||
return fmt.Errorf("unknown sort option: %s", sortBy)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *listUsersOptions) Run() error {
|
||||
ctx := context.Background()
|
||||
|
||||
userClient, err := newUserClientFromKubeConfig(o.kubeConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var userList iamv1alpha2.UserList
|
||||
err = userClient.List(ctx, &userList)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to list users: %w", err)
|
||||
}
|
||||
|
||||
for _, sortBy := range o.sortBys {
|
||||
sort.SliceStable(userList.Items, func(i, j int) bool {
|
||||
f := getSortFunc(sortBy)
|
||||
if f == nil {
|
||||
log.Fatalf("unkown sort option: %s", sortBy)
|
||||
}
|
||||
return f(userList.Items, i, j)
|
||||
})
|
||||
}
|
||||
|
||||
if o.reverse {
|
||||
slices.Reverse(userList.Items)
|
||||
}
|
||||
|
||||
users := make([]userInfo, 0, len(userList.Items))
|
||||
for _, user := range userList.Items {
|
||||
users = append(users, convertUserObjectToUserInfo(user))
|
||||
}
|
||||
|
||||
if o.output == "json" {
|
||||
jsonOutput, _ := json.MarshalIndent(users, "", " ")
|
||||
fmt.Println(string(jsonOutput))
|
||||
} else {
|
||||
if !o.noHeaders {
|
||||
printUserTableHeaders()
|
||||
}
|
||||
for _, user := range users {
|
||||
printUserTableRow(user)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
16
cli/cmd/ctl/user/root.go
Normal file
16
cli/cmd/ctl/user/root.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package user
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
func NewUserCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "user",
|
||||
Short: "user management operations",
|
||||
}
|
||||
cmd.AddCommand(NewCmdCreateUser())
|
||||
cmd.AddCommand(NewCmdDeleteUser())
|
||||
cmd.AddCommand(NewCmdListUsers())
|
||||
cmd.AddCommand(NewCmdGetUser())
|
||||
// cmd.AddCommand(NewCmdUpdateUserLimits())
|
||||
return cmd
|
||||
}
|
||||
43
cli/cmd/ctl/user/types.go
Normal file
43
cli/cmd/ctl/user/types.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package user
|
||||
|
||||
type resourceLimit struct {
|
||||
memoryLimit string
|
||||
cpuLimit string
|
||||
}
|
||||
|
||||
type userInfo struct {
|
||||
UID string `json:"uid"`
|
||||
Name string `json:"name"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Description string `json:"description"`
|
||||
Email string `json:"email"`
|
||||
State string `json:"state"`
|
||||
LastLoginTime *int64 `json:"last_login_time"`
|
||||
CreationTimestamp int64 `json:"creation_timestamp"`
|
||||
Avatar string `json:"avatar"`
|
||||
TerminusName string `json:"terminusName"`
|
||||
WizardComplete bool `json:"wizard_complete"`
|
||||
Roles []string `json:"roles"`
|
||||
MemoryLimit string `json:"memory_limit"`
|
||||
CpuLimit string `json:"cpu_limit"`
|
||||
}
|
||||
|
||||
var (
|
||||
annotationKeyRole = "bytetrade.io/owner-role"
|
||||
annotationKeyMemoryLimit = "bytetrade.io/user-memory-limit"
|
||||
annotationKeyCPULimit = "bytetrade.io/user-cpu-limit"
|
||||
|
||||
roleOwner = "owner"
|
||||
roleAdmin = "admin"
|
||||
roleNormal = "normal"
|
||||
|
||||
creatorCLI = "cli"
|
||||
|
||||
lldapGroupAdmin = "lldap_admin"
|
||||
|
||||
defaultMemoryLimit = "3G"
|
||||
defaultCPULimit = "1"
|
||||
|
||||
systemObjectName = "terminus"
|
||||
systemObjectDomainKey = "domainName"
|
||||
)
|
||||
97
cli/cmd/ctl/user/update.go
Normal file
97
cli/cmd/ctl/user/update.go
Normal file
@@ -0,0 +1,97 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
iamv1alpha2 "github.com/beclab/api/iam/v1alpha2"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"log"
|
||||
)
|
||||
|
||||
type updateUserLimitsOptions struct {
|
||||
name string
|
||||
resourceLimit
|
||||
kubeConfig string
|
||||
}
|
||||
|
||||
func NewCmdUpdateUserLimits() *cobra.Command {
|
||||
o := &updateUserLimitsOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "update-limits {name}",
|
||||
Aliases: []string{"update-limit", "ulimit", "ulimits"},
|
||||
Short: "update user resource limits",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
o.name = args[0]
|
||||
if err := o.Validate(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := o.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
o.AddFlags(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (o *updateUserLimitsOptions) AddFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().StringVarP(&o.memoryLimit, "memory-limit", "m", "", "memory limit")
|
||||
cmd.Flags().StringVarP(&o.cpuLimit, "cpu-limit", "c", "", "cpu limit")
|
||||
cmd.Flags().StringVar(&o.kubeConfig, "kubeconfig", "", "path to kubeconfig file")
|
||||
}
|
||||
|
||||
func (o *updateUserLimitsOptions) Validate() error {
|
||||
if o.name == "" {
|
||||
return fmt.Errorf("user name is required")
|
||||
}
|
||||
|
||||
if o.memoryLimit == "" && o.cpuLimit == "" {
|
||||
return fmt.Errorf("one of memory limit or cpu limit is required")
|
||||
}
|
||||
|
||||
if err := validateResourceLimit(o.resourceLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *updateUserLimitsOptions) Run() error {
|
||||
ctx := context.Background()
|
||||
|
||||
userClient, err := newUserClientFromKubeConfig(o.kubeConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var user iamv1alpha2.User
|
||||
err = userClient.Get(ctx, types.NamespacedName{Name: o.name}, &user)
|
||||
if err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
return fmt.Errorf("user '%s' not found", o.name)
|
||||
}
|
||||
return fmt.Errorf("failed to get user: %w", err)
|
||||
}
|
||||
|
||||
if user.Annotations == nil {
|
||||
user.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
if o.memoryLimit != "" {
|
||||
user.Annotations[annotationKeyMemoryLimit] = o.memoryLimit
|
||||
}
|
||||
if o.cpuLimit != "" {
|
||||
user.Annotations[annotationKeyCPULimit] = o.cpuLimit
|
||||
}
|
||||
|
||||
err = userClient.Update(ctx, &user)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update user: %w", err)
|
||||
}
|
||||
|
||||
fmt.Printf("User '%s' resource limits updated successfully\n", o.name)
|
||||
return nil
|
||||
}
|
||||
120
cli/cmd/ctl/user/utils.go
Normal file
120
cli/cmd/ctl/user/utils.go
Normal file
@@ -0,0 +1,120 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"bytetrade.io/web3os/app-service/api/sys.bytetrade.io/v1alpha1"
|
||||
"fmt"
|
||||
iamv1alpha2 "github.com/beclab/api/iam/v1alpha2"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"os"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
func newUserClientFromKubeConfig(kubeconfig string) (client.Client, error) {
|
||||
if kubeconfig == "" {
|
||||
kubeconfig = os.Getenv("KUBECONFIG")
|
||||
if kubeconfig == "" {
|
||||
kubeconfig = clientcmd.RecommendedHomeFile
|
||||
}
|
||||
}
|
||||
|
||||
config, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get kubeconfig: %w", err)
|
||||
}
|
||||
|
||||
scheme := runtime.NewScheme()
|
||||
|
||||
if err := iamv1alpha2.AddToScheme(scheme); err != nil {
|
||||
return nil, fmt.Errorf("failed to add user scheme: %w", err)
|
||||
}
|
||||
|
||||
if err := v1alpha1.AddToScheme(scheme); err != nil {
|
||||
return nil, fmt.Errorf("failed to add system scheme: %w", err)
|
||||
}
|
||||
|
||||
userClient, err := client.New(config, client.Options{Scheme: scheme})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create user client: %w", err)
|
||||
}
|
||||
return userClient, nil
|
||||
}
|
||||
|
||||
func validateResourceLimit(limit resourceLimit) error {
|
||||
if limit.memoryLimit != "" {
|
||||
memLimit, err := resource.ParseQuantity(limit.memoryLimit)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid memory limit: %v", err)
|
||||
}
|
||||
minMemLimit, _ := resource.ParseQuantity(defaultMemoryLimit)
|
||||
if memLimit.Cmp(minMemLimit) < 0 {
|
||||
return fmt.Errorf("invalid memory limit: %s is less than minimum required: %s", memLimit.String(), minMemLimit.String())
|
||||
}
|
||||
}
|
||||
|
||||
if limit.cpuLimit != "" {
|
||||
cpuLimit, err := resource.ParseQuantity(limit.cpuLimit)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid cpu limit: %v", err)
|
||||
}
|
||||
minCPULimit, _ := resource.ParseQuantity(defaultCPULimit)
|
||||
if cpuLimit.Cmp(minCPULimit) < 0 {
|
||||
return fmt.Errorf("invalid cpu limit: %s is less than minimum required: %s", cpuLimit.String(), minCPULimit.String())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func convertUserObjectToUserInfo(user iamv1alpha2.User) userInfo {
|
||||
info := userInfo{
|
||||
UID: string(user.UID),
|
||||
Name: user.Name,
|
||||
DisplayName: user.Spec.DisplayName,
|
||||
Description: user.Spec.Description,
|
||||
Email: user.Spec.Email,
|
||||
State: string(user.Status.State),
|
||||
CreationTimestamp: user.CreationTimestamp.Unix(),
|
||||
}
|
||||
|
||||
if user.Annotations != nil {
|
||||
if role, ok := user.Annotations[annotationKeyRole]; ok {
|
||||
info.Roles = []string{role}
|
||||
}
|
||||
if terminusName, ok := user.Annotations["bytetrade.io/terminus-name"]; ok {
|
||||
info.TerminusName = terminusName
|
||||
}
|
||||
if avatar, ok := user.Annotations["bytetrade.io/avatar"]; ok {
|
||||
info.Avatar = avatar
|
||||
}
|
||||
if memoryLimit, ok := user.Annotations[annotationKeyMemoryLimit]; ok {
|
||||
info.MemoryLimit = memoryLimit
|
||||
}
|
||||
if cpuLimit, ok := user.Annotations[annotationKeyCPULimit]; ok {
|
||||
info.CpuLimit = cpuLimit
|
||||
}
|
||||
}
|
||||
|
||||
if user.Status.LastLoginTime != nil {
|
||||
lastLogin := user.Status.LastLoginTime.Unix()
|
||||
info.LastLoginTime = &lastLogin
|
||||
}
|
||||
|
||||
return info
|
||||
}
|
||||
|
||||
func printUserTableHeaders() {
|
||||
fmt.Printf("%-20s %-10s %-10s %-30s %-10s %-10s %-10s\n", "NAME", "ROLE", "STATE", "CREATE TIME", "ACTIVATED", "MEMORY", "CPU")
|
||||
}
|
||||
|
||||
func printUserTableRow(info userInfo) {
|
||||
role := roleNormal
|
||||
if len(info.Roles) > 0 {
|
||||
role = info.Roles[0]
|
||||
}
|
||||
fmt.Printf("%-20s %-10s %-10s %-30s %-10s %-10s %-10s\n",
|
||||
info.Name, role, info.State, time.Unix(info.CreationTimestamp, 0).Format(time.RFC3339), strconv.FormatBool(info.WizardComplete), info.MemoryLimit, info.CpuLimit)
|
||||
}
|
||||
@@ -1,16 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/beclab/Olares/cli/cmd/ctl"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd := ctl.NewDefaultCommand()
|
||||
_ = exec.Command("/bin/bash", "-c", "ulimit -u 65535").Run()
|
||||
_ = exec.Command("/bin/bash", "-c", "ulimit -n 65535").Run()
|
||||
|
||||
if err := cmd.Execute(); err != nil {
|
||||
// fmt.Println(err)
|
||||
|
||||
@@ -1,986 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 kubekey
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beclab/Olares/cli/pkg/core/logger"
|
||||
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
kubekeyv1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
|
||||
yamlV2 "gopkg.in/yaml.v2"
|
||||
kubeErr "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
"sigs.k8s.io/controller-runtime/pkg/event"
|
||||
"sigs.k8s.io/controller-runtime/pkg/predicate"
|
||||
|
||||
batchv1 "k8s.io/api/batch/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
CreateCluster = "create cluster"
|
||||
AddNodes = "add nodes"
|
||||
)
|
||||
|
||||
// ClusterReconciler reconciles a Cluster object
|
||||
type ClusterReconciler struct {
|
||||
client.Client
|
||||
Scheme *runtime.Scheme
|
||||
}
|
||||
|
||||
// +kubebuilder:rbac:groups=kubekey.kubesphere.io,resources=clusters,verbs=get;list;watch;create;update;patch;delete
|
||||
// +kubebuilder:rbac:groups=kubekey.kubesphere.io,resources=clusters/status,verbs=get;update;patch
|
||||
// +kubebuilder:rbac:groups=core,resources=*,verbs=get;list;watch;create;update;patch;delete
|
||||
// +kubebuilder:rbac:groups=storage.k8s.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
|
||||
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=*
|
||||
// +kubebuilder:rbac:groups=installer.kubesphere.io,resources=clusterconfigurations,verbs=*
|
||||
// +kubebuilder:rbac:groups=admissionregistration.k8s.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=apiregistration.k8s.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=auditing.kubesphere.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=autoscaling,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=certificates.k8s.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=config.istio.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=core.kubefed.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=devops.kubesphere.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=events.kubesphere.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=batch,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=extensions,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=iam.kubesphere.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=jaegertracing.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=logging.kubesphere.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=monitoring.coreos.com,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=networking.istio.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=notification.kubesphere.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=policy,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=storage.kubesphere.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=tenant.kubesphere.io,resources=*,verbs=*
|
||||
// +kubebuilder:rbac:groups=cluster.kubesphere.io,resources=*,verbs=*
|
||||
|
||||
func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
|
||||
|
||||
cluster := &kubekeyv1alpha2.Cluster{}
|
||||
cmFound := &corev1.ConfigMap{}
|
||||
jobFound := &batchv1.Job{}
|
||||
var (
|
||||
clusterAlreadyExist bool
|
||||
addHosts, removeHosts []kubekeyv1alpha2.HostCfg
|
||||
)
|
||||
// Fetch the Cluster object
|
||||
if err := r.Get(ctx, req.NamespacedName, cluster); err != nil {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
logger.Info("Cluster resource not found. Ignoring since object must be deleted")
|
||||
return ctrl.Result{}, nil
|
||||
}
|
||||
logger.Error(err, "Failed to get Cluster")
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
|
||||
// Check if the configMap already exists
|
||||
if err := r.Get(ctx, types.NamespacedName{Name: cluster.Name, Namespace: req.Namespace}, cmFound); err == nil {
|
||||
clusterAlreadyExist = true
|
||||
}
|
||||
|
||||
// create a new cluster
|
||||
if cluster.Status.NodesCount == 0 {
|
||||
// Ensure that the current pipeline execution is complete
|
||||
if cluster.Status.PiplineInfo.Status != "" {
|
||||
return ctrl.Result{RequeueAfter: 3 * time.Second}, nil
|
||||
}
|
||||
|
||||
if !clusterAlreadyExist {
|
||||
// create kubesphere cluster
|
||||
if err := newKubeSphereCluster(r, cluster); err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
|
||||
if err := updateClusterConfigMap(r, ctx, cluster, cmFound); err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
return ctrl.Result{RequeueAfter: 1 * time.Second}, nil
|
||||
}
|
||||
|
||||
// If the CR cluster define current cluster
|
||||
nodes, err := currentClusterDiff(r, ctx, cluster)
|
||||
if err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
if len(nodes) != 0 {
|
||||
logger.Info("Cluster resource defines current cluster")
|
||||
if err := adaptExistedCluster(nodes, cluster); err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
if err := r.Status().Update(context.TODO(), cluster); err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
|
||||
return ctrl.Result{RequeueAfter: 1 * time.Second}, nil
|
||||
}
|
||||
|
||||
// If the CR cluster define other existed cluster
|
||||
otherClusterNodes, err := otherClusterDiff(r, ctx, cluster)
|
||||
if err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
if len(otherClusterNodes) != 0 {
|
||||
logger.Info("Cluster resource defines other existed cluster")
|
||||
if err := adaptExistedCluster(otherClusterNodes, cluster); err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
if err := r.Status().Update(context.TODO(), cluster); err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
|
||||
return ctrl.Result{RequeueAfter: 1 * time.Second}, nil
|
||||
}
|
||||
|
||||
if err := updateRunJob(r, req, ctx, cluster, jobFound, CreateCluster); err != nil {
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Second}, err
|
||||
}
|
||||
|
||||
addHosts = cluster.Spec.Hosts
|
||||
sendHostsAction(1, addHosts)
|
||||
|
||||
// Ensure that the cluster has been created successfully, otherwise re-enter Reconcile.
|
||||
return ctrl.Result{RequeueAfter: 3 * time.Second}, nil
|
||||
}
|
||||
|
||||
// add nodes to cluster
|
||||
if cluster.Status.NodesCount != 0 && len(cluster.Spec.Hosts) > cluster.Status.NodesCount {
|
||||
// Ensure that the current pipeline execution is complete
|
||||
if cluster.Status.PiplineInfo.Status != "" {
|
||||
return ctrl.Result{RequeueAfter: 3 * time.Second}, nil
|
||||
}
|
||||
|
||||
if err := updateClusterConfigMap(r, ctx, cluster, cmFound); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
if err := updateRunJob(r, req, ctx, cluster, jobFound, AddNodes); err != nil {
|
||||
return ctrl.Result{Requeue: true}, err
|
||||
}
|
||||
|
||||
currentNodes := map[string]string{}
|
||||
for _, node := range cluster.Status.Nodes {
|
||||
currentNodes[node.Hostname] = node.Hostname
|
||||
}
|
||||
|
||||
for _, host := range cluster.Spec.Hosts {
|
||||
if _, ok := currentNodes[host.Name]; !ok {
|
||||
addHosts = append(addHosts, host)
|
||||
}
|
||||
}
|
||||
sendHostsAction(1, addHosts)
|
||||
|
||||
// Ensure that the nodes has been added successfully, otherwise re-enter Reconcile.
|
||||
return ctrl.Result{RequeueAfter: 3 * time.Second}, nil
|
||||
}
|
||||
|
||||
// Completion of pipeline execution, clearing pipeline status information
|
||||
cluster.Status.PiplineInfo.Status = ""
|
||||
if err := r.Status().Update(context.TODO(), cluster); err != nil {
|
||||
return ctrl.Result{RequeueAfter: 3 * time.Second}, err
|
||||
}
|
||||
|
||||
// Synchronizing Node Information
|
||||
kubeConfigCm := &corev1.ConfigMap{}
|
||||
if err := r.Get(ctx, types.NamespacedName{Name: fmt.Sprintf("%s-kubeconfig", cluster.Name), Namespace: req.Namespace}, kubeConfigCm); err == nil && len(cluster.Status.Nodes) != 0 {
|
||||
// fixme: this code will delete the kube config configmap when user delete the CR cluster.
|
||||
// And if user apply this deleted CR cluster again, kk will no longer be able to find the kube config.
|
||||
|
||||
//kubeConfigCm.OwnerReferences = []metav1.OwnerReference{{
|
||||
// APIVersion: cluster.APIVersion,
|
||||
// Kind: cluster.Kind,
|
||||
// Name: cluster.Name,
|
||||
// UID: cluster.UID,
|
||||
//}}
|
||||
//if err := r.Update(ctx, kubeConfigCm); err != nil {
|
||||
// return ctrl.Result{Requeue: true}, err
|
||||
//}
|
||||
kubeconfig, err := base64.StdEncoding.DecodeString(kubeConfigCm.Data["kubeconfig"])
|
||||
if err != nil {
|
||||
return ctrl.Result{Requeue: true}, err
|
||||
}
|
||||
|
||||
config, err := clientcmd.RESTConfigFromKubeConfig(kubeconfig)
|
||||
if err != nil {
|
||||
return ctrl.Result{Requeue: true}, err
|
||||
}
|
||||
|
||||
clientset, err := kubernetes.NewForConfig(config)
|
||||
if err != nil {
|
||||
return ctrl.Result{Requeue: true}, err
|
||||
}
|
||||
|
||||
nodeList, err := clientset.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
|
||||
if err != nil {
|
||||
return ctrl.Result{Requeue: true}, err
|
||||
}
|
||||
|
||||
currentNodes := map[string]string{}
|
||||
for _, node := range nodeList.Items {
|
||||
currentNodes[node.Name] = node.Name
|
||||
}
|
||||
for _, etcd := range cluster.Spec.RoleGroups["etcd"] {
|
||||
if _, ok := currentNodes[etcd]; !ok {
|
||||
currentNodes[etcd] = etcd
|
||||
}
|
||||
}
|
||||
|
||||
nodes := cluster.Status.Nodes
|
||||
var newNodes []kubekeyv1alpha2.NodeStatus
|
||||
|
||||
for _, node := range nodes {
|
||||
if _, ok := currentNodes[node.Hostname]; ok {
|
||||
newNodes = append(newNodes, node)
|
||||
}
|
||||
}
|
||||
|
||||
hosts := cluster.Spec.Hosts
|
||||
var newHosts []kubekeyv1alpha2.HostCfg
|
||||
for _, host := range hosts {
|
||||
if _, ok := currentNodes[host.Name]; ok {
|
||||
newHosts = append(newHosts, host)
|
||||
} else {
|
||||
removeHosts = append(removeHosts, host)
|
||||
}
|
||||
}
|
||||
|
||||
sendHostsAction(0, removeHosts)
|
||||
|
||||
var newEtcd, newMaster, newWorker []string
|
||||
for _, node := range newNodes {
|
||||
if node.Roles["etcd"] {
|
||||
newEtcd = append(newEtcd, node.Hostname)
|
||||
}
|
||||
if node.Roles["master"] {
|
||||
newMaster = append(newMaster, node.Hostname)
|
||||
}
|
||||
if node.Roles["worker"] {
|
||||
newWorker = append(newWorker, node.Hostname)
|
||||
}
|
||||
}
|
||||
|
||||
cluster.Spec.Hosts = newHosts
|
||||
cluster.Spec.RoleGroups = map[string][]string{
|
||||
"master": newMaster,
|
||||
"etcd": newEtcd,
|
||||
"worker": newWorker,
|
||||
}
|
||||
|
||||
if err := r.Update(ctx, cluster); err != nil {
|
||||
return ctrl.Result{Requeue: true}, nil
|
||||
}
|
||||
|
||||
// Fetch the Cluster object
|
||||
if err := r.Get(ctx, req.NamespacedName, cluster); err != nil {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
logger.Info("Cluster resource not found. Ignoring since object must be deleted")
|
||||
return ctrl.Result{}, nil
|
||||
}
|
||||
logger.Error(err, "Failed to get Cluster")
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
|
||||
cluster.Status.Nodes = newNodes
|
||||
cluster.Status.NodesCount = len(newNodes)
|
||||
cluster.Status.MasterCount = len(newMaster)
|
||||
cluster.Status.WorkerCount = len(newWorker)
|
||||
if err := r.Status().Update(ctx, cluster); err != nil {
|
||||
return ctrl.Result{Requeue: true}, nil
|
||||
}
|
||||
}
|
||||
return ctrl.Result{RequeueAfter: 2 * time.Minute}, nil
|
||||
}
|
||||
|
||||
func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||
return ctrl.NewControllerManagedBy(mgr).
|
||||
For(&kubekeyv1alpha2.Cluster{}).
|
||||
WithEventFilter(ignoreDeletionPredicate()).
|
||||
Complete(r)
|
||||
}
|
||||
|
||||
func ignoreDeletionPredicate() predicate.Predicate {
|
||||
return predicate.Funcs{
|
||||
UpdateFunc: func(e event.UpdateEvent) bool {
|
||||
// Ignore updates to CR status in which case metadata.Generation does not change
|
||||
return e.ObjectOld.GetGeneration() != e.ObjectNew.GetGeneration()
|
||||
},
|
||||
DeleteFunc: func(e event.DeleteEvent) bool {
|
||||
// Evaluates to false if the object has been confirmed deleted.
|
||||
return !e.DeleteStateUnknown
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (r *ClusterReconciler) configMapForCluster(c *kubekeyv1alpha2.Cluster) *corev1.ConfigMap {
|
||||
type Metadata struct {
|
||||
Name string `yaml:"name" json:"name,omitempty"`
|
||||
}
|
||||
clusterConfiguration := struct {
|
||||
ApiVersion string `yaml:"apiVersion" json:"apiVersion,omitempty"`
|
||||
Kind string `yaml:"kind" json:"kind,omitempty"`
|
||||
Metadata Metadata `yaml:"metadata" json:"metadata,omitempty"`
|
||||
Spec kubekeyv1alpha2.ClusterSpec `yaml:"spec" json:"spec,omitempty"`
|
||||
}{ApiVersion: c.APIVersion, Kind: c.Kind, Metadata: Metadata{Name: c.Name}, Spec: c.Spec}
|
||||
|
||||
clusterStr, _ := yaml.Marshal(clusterConfiguration)
|
||||
|
||||
cm := &corev1.ConfigMap{
|
||||
TypeMeta: metav1.TypeMeta{},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: c.Name,
|
||||
Namespace: c.Namespace,
|
||||
Labels: map[string]string{"kubekey.kubesphere.io/name": c.Name},
|
||||
OwnerReferences: []metav1.OwnerReference{{
|
||||
APIVersion: c.APIVersion,
|
||||
Kind: c.Kind,
|
||||
Name: c.Name,
|
||||
UID: c.UID,
|
||||
}},
|
||||
},
|
||||
Data: map[string]string{"cluster.yaml": string(clusterStr)},
|
||||
}
|
||||
return cm
|
||||
}
|
||||
|
||||
func (r *ClusterReconciler) jobForCluster(c *kubekeyv1alpha2.Cluster, action string) *batchv1.Job {
|
||||
var (
|
||||
backoffLimit int32 = 0
|
||||
name string
|
||||
args []string
|
||||
)
|
||||
if action == CreateCluster {
|
||||
name = fmt.Sprintf("%s-create-cluster", c.Name)
|
||||
args = []string{"create", "cluster", "-f", "/home/kubekey/config/cluster.yaml", "-y", "--in-cluster", "true", "--namespace", c.Namespace}
|
||||
} else if action == AddNodes {
|
||||
name = fmt.Sprintf("%s-add-nodes", c.Name)
|
||||
args = []string{"add", "nodes", "-f", "/home/kubekey/config/cluster.yaml", "-y", "--in-cluster", "true", "--ignore-err", "true", "--namespace", c.Namespace}
|
||||
}
|
||||
|
||||
podlist := &corev1.PodList{}
|
||||
listOpts := []client.ListOption{
|
||||
client.InNamespace(c.Namespace),
|
||||
client.MatchingLabels{"control-plane": "controller-manager"},
|
||||
}
|
||||
err := r.List(context.TODO(), podlist, listOpts...)
|
||||
if err != nil {
|
||||
logger.Error(err, "Failed to list kubekey controller-manager pod")
|
||||
}
|
||||
nodeName := podlist.Items[0].Spec.NodeName
|
||||
var image string
|
||||
for _, container := range podlist.Items[0].Spec.Containers {
|
||||
if container.Name == "manager" {
|
||||
image = container.Image
|
||||
}
|
||||
}
|
||||
|
||||
imageRepoList := strings.Split(image, "/")
|
||||
var kubekey int64
|
||||
kubekey = 1000
|
||||
|
||||
job := &batchv1.Job{
|
||||
TypeMeta: metav1.TypeMeta{},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: c.Namespace,
|
||||
Labels: map[string]string{"kubekey.kubesphere.io/name": c.Name},
|
||||
OwnerReferences: []metav1.OwnerReference{{
|
||||
APIVersion: c.APIVersion,
|
||||
Kind: c.Kind,
|
||||
Name: c.Name,
|
||||
UID: c.UID,
|
||||
}},
|
||||
},
|
||||
Spec: batchv1.JobSpec{
|
||||
BackoffLimit: &backoffLimit,
|
||||
Template: corev1.PodTemplateSpec{
|
||||
ObjectMeta: metav1.ObjectMeta{},
|
||||
Spec: corev1.PodSpec{
|
||||
Volumes: []corev1.Volume{
|
||||
{
|
||||
Name: "config",
|
||||
VolumeSource: corev1.VolumeSource{
|
||||
ConfigMap: &corev1.ConfigMapVolumeSource{
|
||||
LocalObjectReference: corev1.LocalObjectReference{
|
||||
Name: c.Name,
|
||||
},
|
||||
Items: []corev1.KeyToPath{{
|
||||
Key: "cluster.yaml",
|
||||
Path: "cluster.yaml",
|
||||
}},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "kube-binaries",
|
||||
VolumeSource: corev1.VolumeSource{
|
||||
EmptyDir: &corev1.EmptyDirVolumeSource{},
|
||||
},
|
||||
},
|
||||
},
|
||||
SecurityContext: &corev1.PodSecurityContext{
|
||||
RunAsUser: &kubekey,
|
||||
FSGroup: &kubekey,
|
||||
},
|
||||
InitContainers: []corev1.Container{
|
||||
{
|
||||
Name: "kube-binaries",
|
||||
Image: fmt.Sprintf("%s/kube-binaries:%s", strings.Join(imageRepoList[:len(imageRepoList)-1], "/"), c.Spec.Kubernetes.Version),
|
||||
Command: []string{
|
||||
"sh",
|
||||
"-c",
|
||||
"cp -r -f /kubekey/* /home/kubekey/kubekey/",
|
||||
},
|
||||
VolumeMounts: []corev1.VolumeMount{
|
||||
{
|
||||
Name: "kube-binaries",
|
||||
MountPath: "/home/kubekey/kubekey",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Containers: []corev1.Container{{
|
||||
Name: "runner",
|
||||
Image: image,
|
||||
ImagePullPolicy: "IfNotPresent",
|
||||
Command: []string{"/home/kubekey/kk"},
|
||||
Args: args,
|
||||
VolumeMounts: []corev1.VolumeMount{
|
||||
{
|
||||
Name: "config",
|
||||
MountPath: "/home/kubekey/config",
|
||||
},
|
||||
{
|
||||
Name: "kube-binaries",
|
||||
MountPath: "/home/kubekey/kubekey",
|
||||
},
|
||||
},
|
||||
}},
|
||||
NodeName: nodeName,
|
||||
ServiceAccountName: "kubekey-controller-manager",
|
||||
RestartPolicy: "Never",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
return job
|
||||
}
|
||||
|
||||
func updateStatusRunner(r *ClusterReconciler, req ctrl.Request, cluster *kubekeyv1alpha2.Cluster, action string) error {
|
||||
var (
|
||||
name string
|
||||
)
|
||||
if action == CreateCluster {
|
||||
name = fmt.Sprintf("%s-create-cluster", cluster.Name)
|
||||
} else if action == AddNodes {
|
||||
name = fmt.Sprintf("%s-add-nodes", cluster.Name)
|
||||
}
|
||||
|
||||
podlist := &corev1.PodList{}
|
||||
listOpts := []client.ListOption{
|
||||
client.InNamespace(req.Namespace),
|
||||
client.MatchingLabels{"job-name": name},
|
||||
}
|
||||
for i := 0; i < 100; i++ {
|
||||
_ = r.List(context.TODO(), podlist, listOpts...)
|
||||
if len(podlist.Items) == 1 {
|
||||
// Fetch the Cluster object
|
||||
if err := r.Get(context.TODO(), req.NamespacedName, cluster); err != nil {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
if len(podlist.Items[0].ObjectMeta.GetName()) != 0 && len(podlist.Items[0].Status.ContainerStatuses[0].Name) != 0 && podlist.Items[0].Status.Phase != "Pending" {
|
||||
cluster.Status.JobInfo = kubekeyv1alpha2.JobInfo{
|
||||
Namespace: req.Namespace,
|
||||
Name: name,
|
||||
Pods: []kubekeyv1alpha2.PodInfo{{
|
||||
Name: podlist.Items[0].ObjectMeta.GetName(),
|
||||
Containers: []kubekeyv1alpha2.ContainerInfo{{Name: podlist.Items[0].Status.ContainerStatuses[0].Name}},
|
||||
}},
|
||||
}
|
||||
|
||||
if err := r.Status().Update(context.TODO(), cluster); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
time.Sleep(6 * time.Second)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func updateClusterConfigMap(r *ClusterReconciler, ctx context.Context, cluster *kubekeyv1alpha2.Cluster, cmFound *corev1.ConfigMap) error {
|
||||
// Check if the configmap already exists, if not create a new one
|
||||
if err := r.Get(ctx, types.NamespacedName{Name: cluster.Name, Namespace: cluster.Namespace}, cmFound); err != nil && !kubeErr.IsNotFound(err) {
|
||||
logger.Error(err, "Failed to get ConfigMap", "ConfigMap.Namespace", cmFound.Namespace, "ConfigMap.Name", cmFound.Name)
|
||||
return err
|
||||
} else if err == nil {
|
||||
if err := r.Delete(ctx, cmFound); err != nil {
|
||||
logger.Error(err, "Failed to delete old ConfigMap", "ConfigMap.Namespace", cmFound.Namespace, "ConfigMap.Name", cmFound.Name)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Define a new configmap
|
||||
cmCluster := r.configMapForCluster(cluster)
|
||||
logger.Info("Creating a new ConfigMap", "ConfigMap.Namespace", cmCluster.Namespace, "ConfigMap.Name", cmCluster.Name)
|
||||
if err := r.Create(ctx, cmCluster); err != nil {
|
||||
logger.Error(err, "Failed to create new ConfigMap", "ConfigMap.Namespace", cmCluster.Namespace, "ConfigMap.Name", cmCluster.Name)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func updateRunJob(r *ClusterReconciler, req ctrl.Request, ctx context.Context, cluster *kubekeyv1alpha2.Cluster, jobFound *batchv1.Job, action string) error {
|
||||
var (
|
||||
name string
|
||||
)
|
||||
if action == CreateCluster {
|
||||
name = fmt.Sprintf("%s-create-cluster", cluster.Name)
|
||||
} else if action == AddNodes {
|
||||
name = fmt.Sprintf("%s-add-nodes", cluster.Name)
|
||||
}
|
||||
|
||||
// Check if the job already exists, if not create a new one
|
||||
if err := r.Get(ctx, types.NamespacedName{Name: name, Namespace: req.Namespace}, jobFound); err != nil && !kubeErr.IsNotFound(err) {
|
||||
return err
|
||||
} else if err == nil && (jobFound.Status.Failed != 0 || jobFound.Status.Succeeded != 0) {
|
||||
// delete old pods
|
||||
podlist := &corev1.PodList{}
|
||||
listOpts := []client.ListOption{
|
||||
client.InNamespace(req.Namespace),
|
||||
client.MatchingLabels{"job-name": name},
|
||||
}
|
||||
if err := r.List(context.TODO(), podlist, listOpts...); err == nil && len(podlist.Items) != 0 {
|
||||
for _, pod := range podlist.Items {
|
||||
_ = r.Delete(ctx, &pod)
|
||||
}
|
||||
}
|
||||
logger.Info("Prepare to delete old job", "Job.Namespace", jobFound.Namespace, "Job.Name", jobFound.Name)
|
||||
if err := r.Delete(ctx, jobFound); err != nil {
|
||||
logger.Error(err, "Failed to delete old Job", "Job.Namespace", jobFound.Namespace, "Job.Name", jobFound.Name)
|
||||
return err
|
||||
}
|
||||
logger.Info("Deleting old job success", "Job.Namespace", jobFound.Namespace, "Job.Name", jobFound.Name)
|
||||
|
||||
err := wait.PollInfinite(1*time.Second, func() (bool, error) {
|
||||
logger.Info("Checking old job is deleted", "Job.Namespace", jobFound.Namespace, "Job.Name", jobFound.Name)
|
||||
if e := r.Get(ctx, types.NamespacedName{Name: name, Namespace: req.Namespace}, jobFound); e != nil {
|
||||
if kubeErr.IsNotFound(e) {
|
||||
return true, nil
|
||||
}
|
||||
return false, e
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error(err, "Failed to loop check old job is deleted", "Job.Namespace", jobFound.Namespace, "Job.Name", jobFound.Name)
|
||||
return err
|
||||
}
|
||||
|
||||
jobCluster := r.jobForCluster(cluster, action)
|
||||
logger.Info("Creating a new Job to scale cluster", "Job.Namespace", jobCluster.Namespace, "Job.Name", jobCluster.Name)
|
||||
if err := r.Create(ctx, jobCluster); err != nil {
|
||||
logger.Error(err, "Failed to create new Job", "Job.Namespace", jobCluster.Namespace, "Job.Name", jobCluster.Name)
|
||||
return err
|
||||
}
|
||||
} else if kubeErr.IsNotFound(err) {
|
||||
jobCluster := r.jobForCluster(cluster, action)
|
||||
logger.Info("Creating a new Job to create cluster", "Job.Namespace", jobCluster.Namespace, "Job.Name", jobCluster.Name)
|
||||
if err := r.Create(ctx, jobCluster); err != nil {
|
||||
logger.Error(err, "Failed to create new Job", "Job.Namespace", jobCluster.Namespace, "Job.Name", jobCluster.Name)
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := updateStatusRunner(r, req, cluster, action); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func sendHostsAction(action int, hosts []kubekeyv1alpha2.HostCfg) {
|
||||
if os.Getenv("HOSTS_MANAGER") == "true" {
|
||||
type HostsAction struct {
|
||||
Hosts []kubekeyv1alpha2.HostCfg `json:"hosts,omitempty"`
|
||||
Action int `json:"action,omitempty"`
|
||||
}
|
||||
newHostsAction := HostsAction{
|
||||
Hosts: hosts,
|
||||
Action: action,
|
||||
}
|
||||
|
||||
fmt.Println(newHostsAction)
|
||||
hostsInfoBytes, err := json.Marshal(newHostsAction)
|
||||
if err != nil {
|
||||
logger.Error(err, "Failed to marshal hosts info")
|
||||
}
|
||||
|
||||
fmt.Println(string(hostsInfoBytes))
|
||||
req, err := http.NewRequest("POST", "http://localhost:8090/api/v1alpha2/hosts", bytes.NewReader(hostsInfoBytes))
|
||||
if err != nil {
|
||||
logger.Error(err, "Failed to create request")
|
||||
}
|
||||
|
||||
req.Header.Add("Content-Type", "application/json")
|
||||
|
||||
_, err = http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
logger.Error(err, "Failed to send hosts info")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type NodeInfo struct {
|
||||
Name string
|
||||
Address string
|
||||
Master bool
|
||||
Worker bool
|
||||
Etcd bool
|
||||
}
|
||||
|
||||
type Configuration struct {
|
||||
Etcd Etcd `yaml:"etcd"`
|
||||
}
|
||||
|
||||
type Etcd struct {
|
||||
External External `yaml:"external"`
|
||||
}
|
||||
|
||||
type External struct {
|
||||
Endpoints []string `yaml:"endpoints"`
|
||||
}
|
||||
|
||||
func currentClusterDiff(r *ClusterReconciler, ctx context.Context, c *kubekeyv1alpha2.Cluster) ([]kubekeyv1alpha2.NodeStatus, error) {
|
||||
newNodes := make([]kubekeyv1alpha2.NodeStatus, 0)
|
||||
|
||||
allSpecHostsMap := make(map[string]NodeInfo)
|
||||
for _, host := range c.Spec.Hosts {
|
||||
allSpecHostsMap[host.InternalAddress] = NodeInfo{
|
||||
Name: host.Name,
|
||||
Address: host.InternalAddress,
|
||||
}
|
||||
}
|
||||
|
||||
nodeList := &corev1.NodeList{}
|
||||
if err := r.List(ctx, nodeList, &client.ListOptions{}); err != nil {
|
||||
return newNodes, err
|
||||
}
|
||||
|
||||
// get cluster nodes which in spec hosts
|
||||
currentHostsMap := make(map[string]NodeInfo)
|
||||
for _, node := range nodeList.Items {
|
||||
isMaster := false
|
||||
isWorker := false
|
||||
|
||||
if _, ok := node.Labels["node-role.kubernetes.io/control-plane"]; ok {
|
||||
isMaster = true
|
||||
}
|
||||
if _, ok := node.Labels["node-role.kubernetes.io/master"]; ok {
|
||||
isMaster = true
|
||||
}
|
||||
if _, ok := node.Labels["node-role.kubernetes.io/worker"]; ok {
|
||||
isWorker = true
|
||||
}
|
||||
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == corev1.NodeInternalIP {
|
||||
if _, ok := allSpecHostsMap[address.Address]; ok {
|
||||
currentHostsMap[address.Address] = NodeInfo{
|
||||
Address: address.Address,
|
||||
Name: node.Name,
|
||||
Master: isMaster,
|
||||
Worker: isWorker,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// spec cluster is different from current cluster
|
||||
if len(currentHostsMap) == 0 {
|
||||
return newNodes, nil
|
||||
}
|
||||
|
||||
if len(currentHostsMap) < len(nodeList.Items) {
|
||||
return newNodes, errors.New("the number of spec hosts are not enough compared with the cluster exist hosts")
|
||||
}
|
||||
|
||||
// mark which ip or node name is etcd role
|
||||
etcdSpecMap := make(map[string]bool)
|
||||
kubeadmConfig := &corev1.ConfigMap{}
|
||||
err := r.Get(ctx, types.NamespacedName{Name: "kubeadm-config", Namespace: "kube-system"}, kubeadmConfig)
|
||||
if err == nil {
|
||||
configuration, ok := kubeadmConfig.Data["ClusterConfiguration"]
|
||||
if !ok {
|
||||
return newNodes, errors.Errorf("Failed to get ClusterConfiguration key in kubeadm-config configmap")
|
||||
}
|
||||
|
||||
conf := &Configuration{}
|
||||
if err := yamlV2.Unmarshal([]byte(configuration), conf); err != nil {
|
||||
return newNodes, err
|
||||
}
|
||||
|
||||
for _, endpoint := range conf.Etcd.External.Endpoints {
|
||||
ip, err := findIpAddress(endpoint)
|
||||
if err != nil {
|
||||
return newNodes, errors.Wrap(err, "Failed to find etcd external endpoints")
|
||||
}
|
||||
etcdSpecMap[ip] = true
|
||||
}
|
||||
} else {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
for _, etcdHostName := range c.Spec.RoleGroups["etcd"] {
|
||||
etcdSpecMap[etcdHostName] = true
|
||||
}
|
||||
} else {
|
||||
return newNodes, errors.Wrap(errors.WithStack(err), "Failed to get kubeadm-config")
|
||||
}
|
||||
}
|
||||
|
||||
// add etcd node info to current hosts map
|
||||
for _, host := range allSpecHostsMap {
|
||||
_, nameOk := etcdSpecMap[host.Name]
|
||||
_, ipOk := etcdSpecMap[host.Address]
|
||||
if !nameOk && !ipOk {
|
||||
continue
|
||||
}
|
||||
if exist, ok := currentHostsMap[host.Address]; ok {
|
||||
exist.Etcd = true
|
||||
currentHostsMap[host.Address] = exist
|
||||
} else {
|
||||
currentHostsMap[host.Address] = NodeInfo{
|
||||
Address: host.Address,
|
||||
Name: host.Name,
|
||||
Etcd: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, host := range currentHostsMap {
|
||||
newNodes = append(newNodes, kubekeyv1alpha2.NodeStatus{
|
||||
InternalIP: host.Address,
|
||||
Hostname: host.Name,
|
||||
Roles: map[string]bool{"master": host.Master, "worker": host.Worker, "etcd": host.Etcd},
|
||||
})
|
||||
}
|
||||
return newNodes, nil
|
||||
}
|
||||
|
||||
func findIpAddress(endpoint string) (string, error) {
|
||||
ipv4Regexp, err := regexp.Compile(`[\d]+\.[\d]+\.[\d]+\.[\d]+`)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
ip := ipv4Regexp.FindStringSubmatch(endpoint)
|
||||
|
||||
if len(ip) != 0 {
|
||||
return ip[0], nil
|
||||
}
|
||||
return "", errors.Errorf("Failed to find ip address in %s", endpoint)
|
||||
}
|
||||
|
||||
func adaptExistedCluster(newNodes []kubekeyv1alpha2.NodeStatus, c *kubekeyv1alpha2.Cluster) error {
|
||||
var newMaster, newWorker, newEtcd []string
|
||||
for _, node := range newNodes {
|
||||
if node.Roles["etcd"] {
|
||||
newEtcd = append(newEtcd, node.Hostname)
|
||||
}
|
||||
if node.Roles["master"] {
|
||||
newMaster = append(newMaster, node.Hostname)
|
||||
}
|
||||
if node.Roles["worker"] {
|
||||
newWorker = append(newWorker, node.Hostname)
|
||||
}
|
||||
}
|
||||
|
||||
c.Status.NodesCount = len(newNodes)
|
||||
c.Status.MasterCount = len(newMaster)
|
||||
c.Status.EtcdCount = len(newEtcd)
|
||||
c.Status.WorkerCount = len(newWorker)
|
||||
c.Status.Nodes = newNodes
|
||||
c.Status.Version = c.Spec.Kubernetes.Version
|
||||
c.Status.NetworkPlugin = c.Spec.Network.Plugin
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func otherClusterDiff(r *ClusterReconciler, ctx context.Context, c *kubekeyv1alpha2.Cluster) ([]kubekeyv1alpha2.NodeStatus, error) {
|
||||
newNodes := make([]kubekeyv1alpha2.NodeStatus, 0)
|
||||
|
||||
allSpecHostsMap := make(map[string]NodeInfo)
|
||||
for _, host := range c.Spec.Hosts {
|
||||
allSpecHostsMap[host.InternalAddress] = NodeInfo{
|
||||
Name: host.Name,
|
||||
Address: host.InternalAddress,
|
||||
}
|
||||
}
|
||||
|
||||
kubeConfigFound := &corev1.ConfigMap{}
|
||||
if err := r.Get(ctx, types.NamespacedName{Name: fmt.Sprintf("%s-kubeconfig", c.Name), Namespace: c.Namespace}, kubeConfigFound); err != nil {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
return newNodes, nil
|
||||
}
|
||||
return newNodes, err
|
||||
}
|
||||
|
||||
kubeconfig, err := base64.StdEncoding.DecodeString(kubeConfigFound.Data["kubeconfig"])
|
||||
if err != nil {
|
||||
return newNodes, err
|
||||
}
|
||||
|
||||
config, err := clientcmd.RESTConfigFromKubeConfig(kubeconfig)
|
||||
if err != nil {
|
||||
return newNodes, err
|
||||
}
|
||||
|
||||
clientset, err := kubernetes.NewForConfig(config)
|
||||
if err != nil {
|
||||
return newNodes, err
|
||||
}
|
||||
|
||||
nodeList, err := clientset.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
|
||||
if err != nil {
|
||||
return newNodes, err
|
||||
}
|
||||
|
||||
// get cluster nodes which in spec hosts
|
||||
currentHostsMap := make(map[string]NodeInfo)
|
||||
for _, node := range nodeList.Items {
|
||||
isMaster := false
|
||||
isWorker := false
|
||||
|
||||
if _, ok := node.Labels["node-role.kubernetes.io/control-plane"]; ok {
|
||||
isMaster = true
|
||||
}
|
||||
if _, ok := node.Labels["node-role.kubernetes.io/master"]; ok {
|
||||
isMaster = true
|
||||
}
|
||||
if _, ok := node.Labels["node-role.kubernetes.io/worker"]; ok {
|
||||
isWorker = true
|
||||
}
|
||||
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == corev1.NodeInternalIP {
|
||||
if _, ok := allSpecHostsMap[address.Address]; ok {
|
||||
currentHostsMap[address.Address] = NodeInfo{
|
||||
Address: address.Address,
|
||||
Name: node.Name,
|
||||
Master: isMaster,
|
||||
Worker: isWorker,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// spec cluster is different from current cluster
|
||||
if len(currentHostsMap) == 0 {
|
||||
return newNodes, nil
|
||||
}
|
||||
|
||||
if len(currentHostsMap) < len(nodeList.Items) {
|
||||
return newNodes, errors.New("the number of spec hosts are not enough compared with the cluster exist hosts")
|
||||
}
|
||||
|
||||
// mark which ip or node name is etcd role
|
||||
etcdSpecMap := make(map[string]bool)
|
||||
kubeadmConfig, err := clientset.CoreV1().ConfigMaps("kube-system").Get(ctx, "kubeadm-config", metav1.GetOptions{})
|
||||
if err == nil {
|
||||
configuration, ok := kubeadmConfig.Data["ClusterConfiguration"]
|
||||
if !ok {
|
||||
return newNodes, errors.Errorf("Failed to get ClusterConfiguration key in kubeadm-config configmap")
|
||||
}
|
||||
|
||||
conf := &Configuration{}
|
||||
if err := yamlV2.Unmarshal([]byte(configuration), conf); err != nil {
|
||||
return newNodes, err
|
||||
}
|
||||
|
||||
for _, endpoint := range conf.Etcd.External.Endpoints {
|
||||
ip, err := findIpAddress(endpoint)
|
||||
if err != nil {
|
||||
return newNodes, errors.Wrap(err, "Failed to find etcd external endpoints")
|
||||
}
|
||||
etcdSpecMap[ip] = true
|
||||
}
|
||||
} else {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
for _, etcdHostName := range c.Spec.RoleGroups["etcd"] {
|
||||
etcdSpecMap[etcdHostName] = true
|
||||
}
|
||||
} else {
|
||||
return newNodes, errors.Wrap(errors.WithStack(err), "Failed to get kubeadm-config")
|
||||
}
|
||||
}
|
||||
|
||||
// add etcd node info to current hosts map
|
||||
for _, host := range allSpecHostsMap {
|
||||
|
||||
_, nameOk := etcdSpecMap[host.Name]
|
||||
_, ipOk := etcdSpecMap[host.Address]
|
||||
if !nameOk && !ipOk {
|
||||
continue
|
||||
}
|
||||
if exist, ok := currentHostsMap[host.Address]; ok {
|
||||
exist.Etcd = true
|
||||
currentHostsMap[host.Address] = exist
|
||||
} else {
|
||||
currentHostsMap[host.Address] = NodeInfo{
|
||||
Address: host.Address,
|
||||
Name: host.Name,
|
||||
Etcd: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, host := range currentHostsMap {
|
||||
newNodes = append(newNodes, kubekeyv1alpha2.NodeStatus{
|
||||
InternalIP: host.Address,
|
||||
Hostname: host.Name,
|
||||
Roles: map[string]bool{"master": host.Master, "worker": host.Worker, "etcd": host.Etcd},
|
||||
})
|
||||
}
|
||||
return newNodes, nil
|
||||
}
|
||||
@@ -1,436 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 kubekey
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"text/template"
|
||||
|
||||
kubekeyapiv1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
"github.com/beclab/Olares/cli/pkg/addons"
|
||||
"github.com/beclab/Olares/cli/pkg/common"
|
||||
"github.com/beclab/Olares/cli/pkg/core/ending"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
kubekeyclientset "github.com/beclab/Olares/cli/clients/clientset/versioned"
|
||||
"github.com/beclab/Olares/cli/pkg/core/util"
|
||||
"github.com/lithammer/dedent"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
kubeErr "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
kube "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
||||
const (
|
||||
// Pending representative the cluster is being created.
|
||||
Pending = "pending"
|
||||
// Success representative the cluster cluster has been created successfully.
|
||||
Success = "success"
|
||||
// Failed creation failure.
|
||||
Failed = "failed"
|
||||
)
|
||||
|
||||
var (
|
||||
newNodes []string
|
||||
clusterKubeSphere = template.Must(template.New("cluster.kubesphere.io").Parse(
|
||||
dedent.Dedent(`apiVersion: cluster.kubesphere.io/v1alpha1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
finalizers:
|
||||
- finalizer.cluster.kubesphere.io
|
||||
labels:
|
||||
cluster-role.kubesphere.io/member: ""
|
||||
kubesphere.io/managed: "true"
|
||||
kubekey.kubesphere.io/name: {{ .Name }}
|
||||
name: {{ .Name }}
|
||||
spec:
|
||||
connection:
|
||||
kubeconfig: {{ .Kubeconfig }}
|
||||
type: direct
|
||||
enable: {{ .Enable }}
|
||||
joinFederation: {{ .JoinFedration }}
|
||||
provider: kubesphere
|
||||
`)))
|
||||
)
|
||||
|
||||
func generateClusterKubeSphere(name string, kubeconfig string, enable, joinFedration bool) (string, error) {
|
||||
return util.Render(clusterKubeSphere, util.Data{
|
||||
"Name": name,
|
||||
"Kubeconfig": kubeconfig,
|
||||
"Enable": enable,
|
||||
"JoinFedration": joinFedration,
|
||||
})
|
||||
}
|
||||
|
||||
// CheckClusterRole is used to check the cluster's role (host or member).
|
||||
func CheckClusterRole() (bool, *rest.Config, error) {
|
||||
// creates the in-cluster config
|
||||
config, err := rest.InClusterConfig()
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
// creates the clientset
|
||||
clientset, err := kube.NewForConfig(config)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
var hostClusterFlag bool
|
||||
if err := clientset.RESTClient().Get().
|
||||
AbsPath("/apis/cluster.kubesphere.io/v1alpha1/clusters").
|
||||
Name("host").
|
||||
Do(context.TODO()).Error(); err == nil {
|
||||
hostClusterFlag = true
|
||||
}
|
||||
return hostClusterFlag, config, nil
|
||||
}
|
||||
|
||||
func newKubeSphereCluster(r *ClusterReconciler, c *kubekeyapiv1alpha2.Cluster) error {
|
||||
if hostClusterFlag, config, err := CheckClusterRole(); err != nil {
|
||||
return err
|
||||
} else if hostClusterFlag {
|
||||
obj, err := generateClusterKubeSphere(c.Name, "Cg==", false, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addons.DoServerSideApply(context.TODO(), config, []byte(obj)); err != nil {
|
||||
err = r.Delete(context.TODO(), c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
kscluster, err := addons.GetCluster(c.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ownerReferencePatch := fmt.Sprintf(`{"metadata": {"ownerReferences": [{"apiVersion": "%s", "kind": "%s", "name": "%s", "uid": "%s"}]}}`, kscluster.GetAPIVersion(), kscluster.GetKind(), kscluster.GetName(), kscluster.GetUID())
|
||||
if err := r.Patch(context.TODO(), c, client.RawPatch(types.MergePatchType, []byte(ownerReferencePatch))); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// UpdateKubeSphereCluster is used to update the cluster object of KubeSphere's multicluster.
|
||||
func UpdateKubeSphereCluster(runtime *common.KubeRuntime) error {
|
||||
if hostClusterFlag, config, err := CheckClusterRole(); err != nil {
|
||||
return err
|
||||
} else if hostClusterFlag {
|
||||
obj, err := generateClusterKubeSphere(runtime.ClusterName, runtime.Kubeconfig, true, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addons.DoServerSideApply(context.TODO(), config, []byte(obj)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewKubekeyClient is used to create a kubekey cluster client.
|
||||
func NewKubekeyClient() (*kubekeyclientset.Clientset, error) {
|
||||
// creates the in-cluster config
|
||||
config, err := rest.InClusterConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// creates the clientset
|
||||
clientset := kubekeyclientset.NewForConfigOrDie(config)
|
||||
|
||||
return clientset, nil
|
||||
}
|
||||
|
||||
func getCluster(name string) (*kubekeyapiv1alpha2.Cluster, error) {
|
||||
clientset, err := NewKubekeyClient()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clusterObj, err := clientset.KubekeyV1alpha2().Clusters().Get(context.TODO(), name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return clusterObj, nil
|
||||
}
|
||||
|
||||
// UpdateClusterConditions is used for updating cluster installation process information or adding nodes.
|
||||
func UpdateClusterConditions(runtime *common.KubeRuntime, step string, result *ending.ModuleResult) error {
|
||||
m := make(map[string]kubekeyapiv1alpha2.Event)
|
||||
allStatus := true
|
||||
for k, v := range result.HostResults {
|
||||
if v.GetStatus() == ending.FAILED {
|
||||
allStatus = false
|
||||
}
|
||||
e := kubekeyapiv1alpha2.Event{
|
||||
Step: step,
|
||||
Status: v.GetStatus().String(),
|
||||
}
|
||||
if v.GetErr() != nil {
|
||||
e.Message = v.GetErr().Error()
|
||||
}
|
||||
m[k] = e
|
||||
}
|
||||
condition := kubekeyapiv1alpha2.Condition{
|
||||
Step: step,
|
||||
StartTime: metav1.Time{Time: result.StartTime},
|
||||
EndTime: metav1.Time{Time: result.EndTime},
|
||||
Status: allStatus,
|
||||
Events: m,
|
||||
}
|
||||
|
||||
cluster, err := getCluster(runtime.ClusterName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
length := len(cluster.Status.Conditions)
|
||||
if length <= 0 {
|
||||
cluster.Status.Conditions = append(cluster.Status.Conditions, condition)
|
||||
} else if cluster.Status.Conditions[length-1].Step == condition.Step {
|
||||
cluster.Status.Conditions[length-1] = condition
|
||||
} else {
|
||||
cluster.Status.Conditions = append(cluster.Status.Conditions, condition)
|
||||
}
|
||||
|
||||
cluster.Status.PiplineInfo.Status = "Running"
|
||||
if _, err := runtime.ClientSet.KubekeyV1alpha2().Clusters().UpdateStatus(context.TODO(), cluster, metav1.UpdateOptions{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// UpdateStatus is used to update status for a new or expanded cluster.
|
||||
func UpdateStatus(runtime *common.KubeRuntime) error {
|
||||
cluster, err := getCluster(runtime.ClusterName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cluster.Status.Version = runtime.Cluster.Kubernetes.Version
|
||||
cluster.Status.NodesCount = len(runtime.GetAllHosts())
|
||||
cluster.Status.MasterCount = len(runtime.GetHostsByRole(common.Master))
|
||||
cluster.Status.WorkerCount = len(runtime.GetHostsByRole(common.Worker))
|
||||
cluster.Status.EtcdCount = len(runtime.GetHostsByRole(common.ETCD))
|
||||
cluster.Status.NetworkPlugin = runtime.Cluster.Network.Plugin
|
||||
cluster.Status.Nodes = []kubekeyapiv1alpha2.NodeStatus{}
|
||||
|
||||
for _, node := range runtime.GetAllHosts() {
|
||||
cluster.Status.Nodes = append(cluster.Status.Nodes, kubekeyapiv1alpha2.NodeStatus{
|
||||
InternalIP: node.GetInternalAddress(),
|
||||
Hostname: node.GetName(),
|
||||
Roles: map[string]bool{"etcd": node.IsRole(common.ETCD), "master": node.IsRole(common.Master), "worker": node.IsRole(common.Worker)},
|
||||
})
|
||||
}
|
||||
|
||||
cluster.Status.PiplineInfo.Status = "Terminated"
|
||||
if _, err := runtime.ClientSet.KubekeyV1alpha2().Clusters().UpdateStatus(context.TODO(), cluster, metav1.UpdateOptions{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getClusterClientSet(runtime *common.KubeRuntime) (*kube.Clientset, error) {
|
||||
// creates the in-cluster config
|
||||
inClusterConfig, err := rest.InClusterConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// creates the clientset
|
||||
clientset, err := kube.NewForConfig(inClusterConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cm, err := clientset.
|
||||
CoreV1().
|
||||
ConfigMaps(runtime.Arg.Namespace).
|
||||
Get(context.TODO(), fmt.Sprintf("%s-kubeconfig", runtime.ClusterName), metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
kubeConfigBase64, ok := cm.Data["kubeconfig"]
|
||||
if !ok {
|
||||
return nil, errors.Errorf("get kubeconfig from %s configmap failed", runtime.ClusterName)
|
||||
}
|
||||
|
||||
kubeConfigStr, err := base64.StdEncoding.DecodeString(kubeConfigBase64)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
config, err := clientcmd.NewClientConfigFromBytes(kubeConfigStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
restConfig, err := config.ClientConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clientsetForCluster, err := kube.NewForConfig(restConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return clientsetForCluster, nil
|
||||
}
|
||||
|
||||
func nodeForCluster(name string, labels map[string]string) *corev1.Node {
|
||||
node := &corev1.Node{
|
||||
TypeMeta: metav1.TypeMeta{},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Labels: labels,
|
||||
},
|
||||
Spec: corev1.NodeSpec{},
|
||||
Status: corev1.NodeStatus{},
|
||||
}
|
||||
|
||||
return node
|
||||
}
|
||||
|
||||
// CreateNodeForCluster is used to create new nodes for the cluster to be add nodes.
|
||||
func CreateNodeForCluster(runtime *common.KubeRuntime) error {
|
||||
clientsetForCluster, err := getClusterClientSet(runtime)
|
||||
if err != nil {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
nodeInfo := make(map[string]string)
|
||||
nodeList, err := clientsetForCluster.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, node := range nodeList.Items {
|
||||
nodeInfo[node.Name] = node.Status.NodeInfo.KubeletVersion
|
||||
}
|
||||
|
||||
for _, host := range runtime.GetHostsByRole(common.K8s) {
|
||||
if _, ok := nodeInfo[host.GetName()]; !ok {
|
||||
labels := map[string]string{"kubekey.kubesphere.io/import-status": Pending}
|
||||
if host.IsRole(common.Master) {
|
||||
labels["node-role.kubernetes.io/master"] = ""
|
||||
}
|
||||
if host.IsRole(common.Worker) {
|
||||
labels["node-role.kubernetes.io/worker"] = ""
|
||||
}
|
||||
node := nodeForCluster(host.GetName(), labels)
|
||||
if _, err = clientsetForCluster.CoreV1().Nodes().Create(context.TODO(), node, metav1.CreateOptions{}); err != nil {
|
||||
return err
|
||||
}
|
||||
newNodes = append(newNodes, host.GetName())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// PatchNodeImportStatus is used to update new node's status.
|
||||
func PatchNodeImportStatus(runtime *common.KubeRuntime, status string) error {
|
||||
clientsetForCluster, err := getClusterClientSet(runtime)
|
||||
if err != nil {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
patchStr := fmt.Sprintf(`{"metadata": {"labels": {"kubekey.kubesphere.io/import-status": "%s"}}}`, status)
|
||||
nodeList, err := clientsetForCluster.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, node := range nodeList.Items {
|
||||
for k, v := range node.Labels {
|
||||
if k == "kubekey.kubesphere.io/import-status" && v != Success {
|
||||
_, err = clientsetForCluster.CoreV1().Nodes().Patch(context.TODO(), node.Name, types.StrategicMergePatchType, []byte(patchStr), metav1.PatchOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SaveKubeConfig is used to save the kubeconfig for the new cluster.
|
||||
func SaveKubeConfig(runtime *common.KubeRuntime) error {
|
||||
// creates the in-cluster config
|
||||
inClusterConfig, err := rest.InClusterConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// creates the clientset
|
||||
clientset, err := kube.NewForConfig(inClusterConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cmClientset := clientset.CoreV1().ConfigMaps(runtime.Arg.Namespace)
|
||||
|
||||
if _, err := cmClientset.Get(context.TODO(), fmt.Sprintf("%s-kubeconfig", runtime.ClusterName), metav1.GetOptions{}); err != nil {
|
||||
if kubeErr.IsNotFound(err) {
|
||||
_, err = cmClientset.Create(context.TODO(), configMapForKubeconfig(runtime), metav1.CreateOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
kubeconfigStr := fmt.Sprintf(`{"kubeconfig": "%s"}`, runtime.Kubeconfig)
|
||||
_, err = cmClientset.Patch(context.TODO(), runtime.ClusterName, types.ApplyPatchType, []byte(kubeconfigStr), metav1.PatchOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// clientset.CoreV1().ConfigMaps("kubekey-system").Create(context.TODO(), kubeconfigConfigMap, metav1.CreateOptions{}
|
||||
return nil
|
||||
}
|
||||
|
||||
// configMapForKubeconfig is used to generate configmap scheme for cluster's kubeconfig.
|
||||
func configMapForKubeconfig(runtime *common.KubeRuntime) *corev1.ConfigMap {
|
||||
cm := &corev1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: fmt.Sprintf("%s-kubeconfig", runtime.ClusterName),
|
||||
},
|
||||
Data: map[string]string{
|
||||
"kubeconfig": runtime.Kubeconfig,
|
||||
},
|
||||
}
|
||||
|
||||
return cm
|
||||
}
|
||||
|
||||
func ClearConditions(runtime *common.KubeRuntime) error {
|
||||
cluster, err := getCluster(runtime.ClusterName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cluster.Status.Conditions = make([]kubekeyapiv1alpha2.Condition, 0)
|
||||
|
||||
if _, err := runtime.ClientSet.KubekeyV1alpha2().Clusters().UpdateStatus(context.TODO(), cluster, metav1.UpdateOptions{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
116
cli/go.mod
Executable file → Normal file
116
cli/go.mod
Executable file → Normal file
@@ -5,61 +5,61 @@ go 1.24.0
|
||||
toolchain go1.24.3
|
||||
|
||||
replace (
|
||||
bytetrade.io/web3os/app-service => github.com/beclab/app-service v0.2.33
|
||||
bytetrade.io/web3os/backups-sdk => github.com/Above-Os/backups-sdk v0.1.17
|
||||
github.com/containers/image/v5 => github.com/containers/image/v5 v5.21.1
|
||||
github.com/containers/ocicrypt => github.com/containers/ocicrypt v1.1.10
|
||||
github.com/containers/storage => github.com/containers/storage v1.40.0
|
||||
github.com/estesp/manifest-tool/v2 => github.com/estesp/manifest-tool/v2 v2.0.3
|
||||
github.com/opencontainers/image-spec => github.com/opencontainers/image-spec v1.1.0
|
||||
)
|
||||
|
||||
require (
|
||||
bytetrade.io/web3os/app-service v0.0.0-00010101000000-000000000000
|
||||
bytetrade.io/web3os/backups-sdk v0.0.0-00010101000000-000000000000
|
||||
github.com/Masterminds/semver/v3 v3.3.0
|
||||
github.com/Masterminds/semver/v3 v3.4.0
|
||||
github.com/PaesslerAG/jsonpath v0.1.1
|
||||
github.com/alecthomas/assert/v2 v2.11.0
|
||||
github.com/beclab/api v0.0.0-20250805111305-08be8f53edf0
|
||||
github.com/cavaliergopher/grab/v3 v3.0.1
|
||||
github.com/containerd/containerd v1.7.27
|
||||
github.com/containerd/containerd v1.7.28
|
||||
github.com/decentralized-identity/web5-go v0.25.0
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
|
||||
github.com/distribution/reference v0.6.0
|
||||
github.com/dominodatalab/os-release v0.0.0-20190522011736-bcdb4a3e3c2f
|
||||
github.com/go-playground/validator/v10 v10.22.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/jmoiron/sqlx v1.4.0
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/libp2p/go-netroute v0.2.2
|
||||
github.com/lithammer/dedent v1.1.0
|
||||
github.com/mattn/go-sqlite3 v1.14.22
|
||||
github.com/mitchellh/mapstructure v1.5.0
|
||||
github.com/mitchellh/mapstructure v1.4.1
|
||||
github.com/modood/table v0.0.0-20220527013332-8d47e76dad33
|
||||
github.com/mr-tron/base58 v1.2.0
|
||||
github.com/multiformats/go-varint v0.0.7
|
||||
github.com/pelletier/go-toml v1.9.5
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/pkg/sftp v1.13.6
|
||||
github.com/pkg/sftp v1.10.1
|
||||
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d
|
||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
|
||||
github.com/schollz/progressbar/v3 v3.17.1
|
||||
github.com/shirou/gopsutil/v4 v4.25.2
|
||||
github.com/schollz/progressbar/v3 v3.18.0
|
||||
github.com/shirou/gopsutil/v4 v4.25.7
|
||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c
|
||||
github.com/spf13/cobra v1.9.1
|
||||
github.com/spf13/pflag v1.0.7
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/syndtr/goleveldb v1.0.0
|
||||
go.uber.org/zap v1.27.0
|
||||
golang.org/x/crypto v0.37.0
|
||||
golang.org/x/term v0.31.0
|
||||
golang.org/x/text v0.24.0
|
||||
golang.org/x/crypto v0.40.0
|
||||
golang.org/x/sys v0.34.0
|
||||
golang.org/x/term v0.33.0
|
||||
golang.org/x/text v0.27.0
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
helm.sh/helm/v3 v3.18.1
|
||||
k8s.io/api v0.33.0
|
||||
k8s.io/apimachinery v0.33.0
|
||||
k8s.io/cli-runtime v0.33.0
|
||||
k8s.io/client-go v0.33.0
|
||||
k8s.io/kubectl v0.33.0
|
||||
helm.sh/helm/v3 v3.18.5
|
||||
k8s.io/api v0.33.3
|
||||
k8s.io/apimachinery v0.33.3
|
||||
k8s.io/client-go v0.33.3
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
|
||||
sigs.k8s.io/controller-runtime v0.21.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.19.0
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
sigs.k8s.io/kustomize/kyaml v0.20.1
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -79,7 +79,6 @@ require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/bshuster-repo/logrus-logstash-hook v1.0.2 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/chai2010/gettext-go v1.0.2 // indirect
|
||||
github.com/containerd/cgroups v1.1.0 // indirect
|
||||
@@ -93,25 +92,24 @@ require (
|
||||
github.com/containerd/typeurl/v2 v2.1.1 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||
github.com/ebitengine/purego v0.8.4 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
|
||||
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
|
||||
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
|
||||
github.com/fatih/camelcase v1.0.0 // indirect
|
||||
github.com/fatih/color v1.15.0 // indirect
|
||||
github.com/fatih/color v1.13.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
|
||||
github.com/go-errors/errors v1.4.2 // indirect
|
||||
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/go-resty/resty/v2 v2.16.5 // indirect
|
||||
github.com/gobwas/glob v0.2.3 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
@@ -129,25 +127,29 @@ require (
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hexops/gotextdiff v1.0.3 // indirect
|
||||
github.com/huandu/xstrings v1.5.0 // indirect
|
||||
github.com/jonboulle/clockwork v0.4.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jmoiron/sqlx v1.4.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/lib/pq v1.10.9 // indirect
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.30 // indirect
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/moby/locker v1.0.1 // indirect
|
||||
github.com/moby/spdystream v0.5.0 // indirect
|
||||
github.com/moby/sys/mountinfo v0.7.1 // indirect
|
||||
github.com/moby/sys/mountinfo v0.6.2 // indirect
|
||||
github.com/moby/sys/sequential v0.5.0 // indirect
|
||||
github.com/moby/sys/signal v0.7.0 // indirect
|
||||
github.com/moby/sys/user v0.3.0 // indirect
|
||||
@@ -173,16 +175,14 @@ require (
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/rubenv/sql-migrate v1.8.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
|
||||
github.com/shopspring/decimal v1.4.0 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/smartystreets/goconvey v1.8.1 // indirect
|
||||
github.com/spf13/cast v1.7.0 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.12 // indirect
|
||||
github.com/tklauser/numcpus v0.6.1 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.15 // indirect
|
||||
github.com/tklauser/numcpus v0.10.0 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||
github.com/xlab/treeprint v1.2.0 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
@@ -191,42 +191,32 @@ require (
|
||||
go.opentelemetry.io/otel v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.33.0 // indirect
|
||||
golang.org/x/net v0.38.0 // indirect
|
||||
golang.org/x/oauth2 v0.28.0 // indirect
|
||||
golang.org/x/sync v0.14.0 // indirect
|
||||
golang.org/x/time v0.9.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.3 // indirect
|
||||
golang.org/x/net v0.42.0 // indirect
|
||||
golang.org/x/oauth2 v0.30.0 // indirect
|
||||
golang.org/x/sync v0.16.0 // indirect
|
||||
golang.org/x/time v0.12.0 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
|
||||
google.golang.org/grpc v1.68.1 // indirect
|
||||
google.golang.org/protobuf v1.36.5 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.33.0 // indirect
|
||||
k8s.io/apiserver v0.33.0 // indirect
|
||||
k8s.io/component-base v0.33.0 // indirect
|
||||
k8s.io/component-helpers v0.33.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.33.3 // indirect
|
||||
k8s.io/apiserver v0.33.3 // indirect
|
||||
k8s.io/cli-runtime v0.33.3 // indirect
|
||||
k8s.io/component-base v0.33.3 // indirect
|
||||
k8s.io/cri-api v0.27.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
|
||||
oras.land/oras-go/v2 v2.5.0 // indirect
|
||||
k8s.io/kubectl v0.33.3 // indirect
|
||||
oras.land/oras-go/v2 v2.6.0 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
|
||||
sigs.k8s.io/kustomize/api v0.19.0 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/spf13/pflag v1.0.6
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/sys v0.33.0
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
sigs.k8s.io/yaml v1.5.0 // indirect
|
||||
)
|
||||
|
||||
238
cli/go.sum
Executable file → Normal file
238
cli/go.sum
Executable file → Normal file
@@ -20,8 +20,8 @@ github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ
|
||||
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
|
||||
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
|
||||
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
|
||||
github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
|
||||
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs=
|
||||
github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0=
|
||||
github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM=
|
||||
@@ -43,13 +43,16 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/beclab/api v0.0.0-20250805111305-08be8f53edf0 h1:U8AFy37epib5ya5By0gHAWVRT+BetExFkmGTjkhZCoY=
|
||||
github.com/beclab/api v0.0.0-20250805111305-08be8f53edf0/go.mod h1:1tq7ut9hrjgYWTh6UTth0xPRa7Ags0VJvUmbr4GuJuM=
|
||||
github.com/beclab/app-service v0.2.33 h1:fsv9sTL7guTdU8z8sO5KIxxd1N5K+Rp4zORRebs+wmI=
|
||||
github.com/beclab/app-service v0.2.33/go.mod h1:Gpp5e2XPU/nHufT7ZBsRMZrYxpFbI6R4AEiKine+RhI=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
|
||||
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
|
||||
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/bshuster-repo/logrus-logstash-hook v1.0.2 h1:JYRWo+QGnQdedgshosug9hxpPYTB9oJ1ZZD3fY31alU=
|
||||
github.com/bshuster-repo/logrus-logstash-hook v1.0.2/go.mod h1:HgYntJprnHSPaF9VPPPLP1L5S1vMWxRfa1J+vzDrDTw=
|
||||
github.com/cavaliergopher/grab/v3 v3.0.1 h1:4z7TkBfmPjmLAAmkkAZNX/6QJ1nNFdv3SdIHXju0Fr4=
|
||||
github.com/cavaliergopher/grab/v3 v3.0.1/go.mod h1:1U/KNnD+Ft6JJiYoYBAimKH2XrYptb8Kl3DFGmsjpq4=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
||||
@@ -65,8 +68,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
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.27 h1:yFyEyojddO3MIGVER2xJLWoCIn+Up4GaHFquP7hsFII=
|
||||
github.com/containerd/containerd v1.7.27/go.mod h1:xZmPnl75Vc+BLGt4MIfu6bp+fy03gdHAn9bz+FreFR0=
|
||||
github.com/containerd/containerd v1.7.28 h1:Nsgm1AtcmEh4AHAJ4gGlNSaKgXiNccU270Dnf81FQ3c=
|
||||
github.com/containerd/containerd v1.7.28/go.mod h1:azUkWcOvHrWvaiUjSQH0fjzuHIwSPg1WL5PshGP4Szs=
|
||||
github.com/containerd/containerd/api v1.8.0 h1:hVTNJKR8fMc/2Tiw60ZRijntNMd1U+JVMyTRdsD2bS0=
|
||||
github.com/containerd/containerd/api v1.8.0/go.mod h1:dFv4lt6S20wTu/hMcP4350RL87qPWLVa/OHOwmmdnYc=
|
||||
github.com/containerd/continuity v0.4.4 h1:/fNVfTJ7wIl/YPMHjf+5H32uFhl63JucB34PlCpMKII=
|
||||
@@ -86,6 +89,7 @@ github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3H
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||
github.com/creack/pty v1.1.9/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/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s=
|
||||
@@ -96,16 +100,18 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/decentralized-identity/web5-go v0.25.0 h1:7QcWuIXHybscmoQ6eoEcDGdbQSPqHIJ4WAo7FBbntIE=
|
||||
github.com/decentralized-identity/web5-go v0.25.0/go.mod h1:fzRcApHJZmekJXwjdbG8tYSFxdyZjyjUEmfh92mdhwY=
|
||||
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
|
||||
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
|
||||
github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8=
|
||||
github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc=
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM=
|
||||
github.com/distribution/distribution/v3 v3.0.0/go.mod h1:tRNuFoZsUdyRVegq8xGNeds4KLjwLCRin/tTo6i1DhU=
|
||||
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
|
||||
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
|
||||
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
|
||||
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8=
|
||||
@@ -128,10 +134,8 @@ github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjT
|
||||
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
|
||||
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2Wvf/TIe2xdyJxTlb6obmF18d8QdkxNDu4=
|
||||
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc=
|
||||
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
|
||||
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
|
||||
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
||||
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
||||
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/foxcpp/go-mockdns v1.1.0 h1:jI0rD8M0wuYAxL7r/ynTrCQQq0BVqfB99Vgk7DlmewI=
|
||||
@@ -143,8 +147,6 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
|
||||
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
|
||||
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
|
||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
||||
github.com/go-gorp/gorp/v3 v3.1.0 h1:ItKF/Vbuj31dmV4jxA1qblpSwkl9g1typ24xoe70IGs=
|
||||
@@ -158,20 +160,14 @@ github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
|
||||
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
|
||||
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
|
||||
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
|
||||
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
|
||||
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
|
||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
|
||||
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
|
||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
|
||||
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||
github.com/go-resty/resty/v2 v2.16.5 h1:hBKqmWrr7uRc3euHVqmh1HTHcKn99Smr7o5spptdhTM=
|
||||
github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
|
||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||
@@ -254,7 +250,6 @@ github.com/hashicorp/golang-lru/v2 v2.0.5 h1:wW7h1TG88eUIJ2i69gaE3uNVtEPIagzhGvH
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.5/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
|
||||
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
|
||||
github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
@@ -264,8 +259,6 @@ github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
|
||||
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
|
||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
|
||||
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
|
||||
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/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
@@ -278,8 +271,11 @@ github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zt
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
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=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
@@ -288,8 +284,6 @@ github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o=
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk=
|
||||
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw=
|
||||
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/libp2p/go-netroute v0.2.2 h1:Dejd8cQ47Qx2kRABg6lPwknU7+nBnFRpko45/fFPuZ8=
|
||||
@@ -302,16 +296,20 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
||||
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.30 h1:bVreufq3EAIG1Quvws73du3/QgdeZ3myglJlrzSYYCY=
|
||||
github.com/mattn/go-sqlite3 v1.14.30/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/miekg/dns v1.1.57 h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM=
|
||||
github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk=
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
|
||||
@@ -320,16 +318,16 @@ github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa1
|
||||
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
|
||||
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag=
|
||||
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
|
||||
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
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/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=
|
||||
github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
|
||||
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
|
||||
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
|
||||
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/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
|
||||
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
|
||||
github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI=
|
||||
@@ -357,16 +355,19 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
||||
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
|
||||
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
|
||||
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
|
||||
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
|
||||
github.com/onsi/gomega v1.38.0 h1:c/WX+w8SLAinvuKKQFh77WEucCnPk4j2OTUr7lt7BeY=
|
||||
github.com/onsi/gomega v1.38.0/go.mod h1:OcXcwId0b9QsE7Y49u+BTrL4IdKOBOKnD6VQNTJEB6o=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
|
||||
@@ -381,10 +382,11 @@ github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+v
|
||||
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/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo=
|
||||
github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
|
||||
github.com/pkg/sftp v1.10.1 h1:VasscCm72135zRysgrJDKsntdmPN+OuU3+nnHYA9wyc=
|
||||
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
@@ -420,17 +422,18 @@ github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7
|
||||
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
|
||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
|
||||
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
|
||||
github.com/schollz/progressbar/v3 v3.17.1 h1:bI1MTaoQO+v5kzklBjYNRQLoVpe0zbyRZNK6DFkVC5U=
|
||||
github.com/schollz/progressbar/v3 v3.17.1/go.mod h1:RzqpnsPQNjUyIgdglUjRLgD7sVnxN1wpmBMV+UiEbL4=
|
||||
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ=
|
||||
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
|
||||
github.com/schollz/progressbar/v3 v3.18.0 h1:uXdoHABRFmNIjUfte/Ex7WtuyVslrw2wVPQmCN62HpA=
|
||||
github.com/schollz/progressbar/v3 v3.18.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec=
|
||||
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
|
||||
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
|
||||
github.com/shirou/gopsutil/v4 v4.25.2 h1:NMscG3l2CqtWFS86kj3vP7soOczqrQYIEhO/pMvvQkk=
|
||||
github.com/shirou/gopsutil/v4 v4.25.2/go.mod h1:34gBYJzyqCDT11b6bMHP0XCvWeU3J61XRT7a2EmCRTA=
|
||||
github.com/shirou/gopsutil/v4 v4.25.7 h1:bNb2JuqKuAu3tRlPv5piSmBZyMfecwQ+t/ILq+1JqVM=
|
||||
github.com/shirou/gopsutil/v4 v4.25.7/go.mod h1:XV/egmwJtd3ZQjBpJVY5kndsiOO4IRqy9TQnmm6VP7U=
|
||||
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
|
||||
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
|
||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c h1:aqg5Vm5dwtvL+YgDpBcK1ITf3o96N/K7/wsRXQnUTEs=
|
||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c/go.mod h1:owqhoLW1qZoYLZzLnBw+QkPP9WZnjlSWihhxAJC1+/M=
|
||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY=
|
||||
@@ -441,8 +444,9 @@ github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w=
|
||||
github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
|
||||
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
|
||||
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
|
||||
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
|
||||
github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
@@ -450,6 +454,7 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
@@ -459,24 +464,16 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE=
|
||||
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
|
||||
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
|
||||
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
|
||||
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
|
||||
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
|
||||
github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4=
|
||||
github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4=
|
||||
github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso=
|
||||
github.com/tklauser/numcpus v0.10.0/go.mod h1:BiTKazU708GQTYF4mB+cmlpT2Is1gLk7XVuEeem8LsQ=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
|
||||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
|
||||
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
||||
@@ -533,13 +530,16 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
|
||||
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
|
||||
go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE=
|
||||
go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
|
||||
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
|
||||
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
|
||||
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
@@ -548,9 +548,8 @@ golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPI
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
|
||||
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg=
|
||||
golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -561,57 +560,44 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
|
||||
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc=
|
||||
golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
|
||||
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
|
||||
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
|
||||
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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
||||
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
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-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
|
||||
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
|
||||
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg=
|
||||
golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
|
||||
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
|
||||
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
|
||||
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
|
||||
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
|
||||
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
|
||||
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
@@ -621,9 +607,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
|
||||
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
|
||||
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
|
||||
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
|
||||
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=
|
||||
@@ -659,69 +644,68 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
||||
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
helm.sh/helm/v3 v3.18.1 h1:qLhXmtqXOHQb0Xv9HJolOLlah8RWbgyzt50xrtTWAlg=
|
||||
helm.sh/helm/v3 v3.18.1/go.mod h1:43QHS1W97RcoFJRk36ZBhHdTfykqBlJdsWp3yhzdq8w=
|
||||
helm.sh/helm/v3 v3.18.5 h1:Cc3Z5vd6kDrZq9wO9KxKLNEickiTho6/H/dBNRVSos4=
|
||||
helm.sh/helm/v3 v3.18.5/go.mod h1:L/dXDR2r539oPlFP1PJqKAC1CUgqHJDLkxKpDGrWnyg=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
k8s.io/api v0.33.0 h1:yTgZVn1XEe6opVpP1FylmNrIFWuDqe2H0V8CT5gxfIU=
|
||||
k8s.io/api v0.33.0/go.mod h1:CTO61ECK/KU7haa3qq8sarQ0biLq2ju405IZAd9zsiM=
|
||||
k8s.io/apiextensions-apiserver v0.33.0 h1:d2qpYL7Mngbsc1taA4IjJPRJ9ilnsXIrndH+r9IimOs=
|
||||
k8s.io/apiextensions-apiserver v0.33.0/go.mod h1:VeJ8u9dEEN+tbETo+lFkwaaZPg6uFKLGj5vyNEwwSzc=
|
||||
k8s.io/apimachinery v0.33.0 h1:1a6kHrJxb2hs4t8EE5wuR/WxKDwGN1FKH3JvDtA0CIQ=
|
||||
k8s.io/apimachinery v0.33.0/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
|
||||
k8s.io/apiserver v0.33.0 h1:QqcM6c+qEEjkOODHppFXRiw/cE2zP85704YrQ9YaBbc=
|
||||
k8s.io/apiserver v0.33.0/go.mod h1:EixYOit0YTxt8zrO2kBU7ixAtxFce9gKGq367nFmqI8=
|
||||
k8s.io/cli-runtime v0.33.0 h1:Lbl/pq/1o8BaIuyn+aVLdEPHVN665tBAXUePs8wjX7c=
|
||||
k8s.io/cli-runtime v0.33.0/go.mod h1:QcA+r43HeUM9jXFJx7A+yiTPfCooau/iCcP1wQh4NFw=
|
||||
k8s.io/client-go v0.33.0 h1:UASR0sAYVUzs2kYuKn/ZakZlcs2bEHaizrrHUZg0G98=
|
||||
k8s.io/client-go v0.33.0/go.mod h1:kGkd+l/gNGg8GYWAPr0xF1rRKvVWvzh9vmZAMXtaKOg=
|
||||
k8s.io/component-base v0.33.0 h1:Ot4PyJI+0JAD9covDhwLp9UNkUja209OzsJ4FzScBNk=
|
||||
k8s.io/component-base v0.33.0/go.mod h1:aXYZLbw3kihdkOPMDhWbjGCO6sg+luw554KP51t8qCU=
|
||||
k8s.io/component-helpers v0.33.0 h1:0AdW0A0mIgljLgtG0hJDdJl52PPqTrtMgOgtm/9i/Ys=
|
||||
k8s.io/component-helpers v0.33.0/go.mod h1:9SRiXfLldPw9lEEuSsapMtvT8j/h1JyFFapbtybwKvU=
|
||||
k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8=
|
||||
k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE=
|
||||
k8s.io/apiextensions-apiserver v0.33.3 h1:qmOcAHN6DjfD0v9kxL5udB27SRP6SG/MTopmge3MwEs=
|
||||
k8s.io/apiextensions-apiserver v0.33.3/go.mod h1:oROuctgo27mUsyp9+Obahos6CWcMISSAPzQ77CAQGz8=
|
||||
k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA=
|
||||
k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
|
||||
k8s.io/apiserver v0.33.3 h1:Wv0hGc+QFdMJB4ZSiHrCgN3zL3QRatu56+rpccKC3J4=
|
||||
k8s.io/apiserver v0.33.3/go.mod h1:05632ifFEe6TxwjdAIrwINHWE2hLwyADFk5mBsQa15E=
|
||||
k8s.io/cli-runtime v0.33.3 h1:Dgy4vPjNIu8LMJBSvs8W0LcdV0PX/8aGG1DA1W8lklA=
|
||||
k8s.io/cli-runtime v0.33.3/go.mod h1:yklhLklD4vLS8HNGgC9wGiuHWze4g7x6XQZ+8edsKEo=
|
||||
k8s.io/client-go v0.33.3 h1:M5AfDnKfYmVJif92ngN532gFqakcGi6RvaOF16efrpA=
|
||||
k8s.io/client-go v0.33.3/go.mod h1:luqKBQggEf3shbxHY4uVENAxrDISLOarxpTKMiUuujg=
|
||||
k8s.io/component-base v0.33.3 h1:mlAuyJqyPlKZM7FyaoM/LcunZaaY353RXiOd2+B5tGA=
|
||||
k8s.io/component-base v0.33.3/go.mod h1:ktBVsBzkI3imDuxYXmVxZ2zxJnYTZ4HAsVj9iF09qp4=
|
||||
k8s.io/cri-api v0.27.1 h1:KWO+U8MfI9drXB/P4oU9VchaWYOlwDglJZVHWMpTT3Q=
|
||||
k8s.io/cri-api v0.27.1/go.mod h1:+Ts/AVYbIo04S86XbTD73UPp/DkTiYxtsFeOFEu32L0=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4=
|
||||
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8=
|
||||
k8s.io/kubectl v0.33.0 h1:HiRb1yqibBSCqic4pRZP+viiOBAnIdwYDpzUFejs07g=
|
||||
k8s.io/kubectl v0.33.0/go.mod h1:gAlGBuS1Jq1fYZ9AjGWbI/5Vk3M/VW2DK4g10Fpyn/0=
|
||||
k8s.io/kubectl v0.33.3 h1:r/phHvH1iU7gO/l7tTjQk2K01ER7/OAJi8uFHHyWSac=
|
||||
k8s.io/kubectl v0.33.3/go.mod h1:euj2bG56L6kUGOE/ckZbCoudPwuj4Kud7BR0GzyNiT0=
|
||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
|
||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c=
|
||||
oras.land/oras-go/v2 v2.5.0/go.mod h1:z4eisnLP530vwIOUOJeBIj0aGI0L1C3d53atvCBqZHg=
|
||||
oras.land/oras-go/v2 v2.6.0 h1:X4ELRsiGkrbeox69+9tzTu492FMUu7zJQW6eJU+I2oc=
|
||||
oras.land/oras-go/v2 v2.6.0/go.mod h1:magiQDfG6H1O9APp+rOsvCPcW1GD2MM7vgnKY0Y+u1o=
|
||||
sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8=
|
||||
sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM=
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
|
||||
sigs.k8s.io/kustomize/api v0.19.0 h1:F+2HB2mU1MSiR9Hp1NEgoU2q9ItNOaBJl0I4Dlus5SQ=
|
||||
sigs.k8s.io/kustomize/api v0.19.0/go.mod h1:/BbwnivGVcBh1r+8m3tH1VNxJmHSk1PzP5fkP6lbL1o=
|
||||
sigs.k8s.io/kustomize/kyaml v0.19.0 h1:RFge5qsO1uHhwJsu3ipV7RNolC7Uozc0jUBC/61XSlA=
|
||||
sigs.k8s.io/kustomize/kyaml v0.19.0/go.mod h1:FeKD5jEOH+FbZPpqUghBP8mrLjJ3+zD3/rf9NNu1cwY=
|
||||
sigs.k8s.io/kustomize/kyaml v0.20.1 h1:PCMnA2mrVbRP3NIB6v9kYCAc38uvFLVs8j/CD567A78=
|
||||
sigs.k8s.io/kustomize/kyaml v0.20.1/go.mod h1:0EmkQHRUsJxY8Ug9Niig1pUMSCGHxQ5RklbpV/Ri6po=
|
||||
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
||||
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
sigs.k8s.io/yaml v1.5.0 h1:M10b2U7aEUY6hRtU870n2VTPgR5RZiL/I6Lcc2F4NUQ=
|
||||
sigs.k8s.io/yaml v1.5.0/go.mod h1:wZs27Rbxoai4C0f8/9urLZtZtF3avA3gKvGyPdDqTO4=
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
Copyright 2021 The KubeSphere 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 addons
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
kubekeyapiv1alpha2 "github.com/beclab/Olares/cli/apis/kubekey/v1alpha2"
|
||||
"github.com/beclab/Olares/cli/pkg/common"
|
||||
"github.com/pkg/errors"
|
||||
"helm.sh/helm/v3/pkg/cli"
|
||||
"helm.sh/helm/v3/pkg/getter"
|
||||
)
|
||||
|
||||
func InstallAddons(kubeConf *common.KubeConf, addon *kubekeyapiv1alpha2.Addon, kubeConfig string) error {
|
||||
// install chart
|
||||
if addon.Sources.Chart.Name != "" {
|
||||
_ = os.Setenv("HELM_NAMESPACE", strings.TrimSpace(addon.Namespace))
|
||||
if err := InstallChart(kubeConf, addon, kubeConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// install yaml
|
||||
if len(addon.Sources.Yaml.Path) != 0 {
|
||||
var settings = cli.New()
|
||||
p := getter.All(settings)
|
||||
for _, yaml := range addon.Sources.Yaml.Path {
|
||||
u, _ := url.Parse(yaml)
|
||||
_, err := p.ByScheme(u.Scheme)
|
||||
if err != nil {
|
||||
fp, err := filepath.Abs(yaml)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to look up current directory")
|
||||
}
|
||||
yamlPaths := []string{fp}
|
||||
if err := InstallYaml(yamlPaths, addon.Namespace, kubeConfig, kubeConf.Cluster.Kubernetes.Version); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
yamlPaths := []string{yaml}
|
||||
if err := InstallYaml(yamlPaths, addon.Namespace, kubeConfig, kubeConf.Cluster.Kubernetes.Version); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user