Compare commits
408 Commits
feat/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 | ||
|
|
058cf31e44 | ||
|
|
72a5b2c6a2 | ||
|
|
f78890b01b | ||
|
|
13df294653 | ||
|
|
2af86e161a | ||
|
|
ee567c270c | ||
|
|
4246bcce06 | ||
|
|
fb73d62bd5 | ||
|
|
209f0d15e3 | ||
|
|
78911d44cf | ||
|
|
d964c33c2d | ||
|
|
2b54795e10 | ||
|
|
efb4be4fcf | ||
|
|
89575096ba | ||
|
|
5edba60295 | ||
|
|
1aecc3495a | ||
|
|
2d5c1fc484 | ||
|
|
81355f4a1c | ||
|
|
2c4e9fb835 | ||
|
|
4947538e68 | ||
|
|
21bb10b72b | ||
|
|
8064c591f2 | ||
|
|
1073575a1d | ||
|
|
4cf977f6df | ||
|
|
0dda3811c7 | ||
|
|
2632b45fc2 | ||
|
|
ae3f3d6a20 | ||
|
|
4f3b824f48 | ||
|
|
9efa6df969 | ||
|
|
045dfc11bc | ||
|
|
9913d29f81 | ||
|
|
0ccf091aff | ||
|
|
01f3b27b8c | ||
|
|
475faafec4 | ||
|
|
31ab286a4b | ||
|
|
c9b4a40a1c | ||
|
|
da19d00d08 | ||
|
|
49d233a55b | ||
|
|
300aaa0753 | ||
|
|
962b220440 | ||
|
|
4da25bca36 | ||
|
|
42eff16695 | ||
|
|
450aa19dfc | ||
|
|
c750f6f85b | ||
|
|
bf57da0fa4 | ||
|
|
5df379f286 | ||
|
|
cfb54fb974 | ||
|
|
9515c05bb6 | ||
|
|
bdcd924e50 | ||
|
|
e9eb218348 | ||
|
|
9746e2c110 | ||
|
|
27d9715292 | ||
|
|
10d6c2a6fa | ||
|
|
57d8a55d8d | ||
|
|
b9a227acd7 | ||
|
|
e6115794ce | ||
|
|
22739c90db | ||
|
|
6fac46130a | ||
|
|
e19e049e7d | ||
|
|
1d0c20d6ad | ||
|
|
397590d402 | ||
|
|
fc1a59b79b | ||
|
|
3dea149790 | ||
|
|
9d6834faa1 | ||
|
|
bef61309a3 | ||
|
|
cf52a59ef7 | ||
|
|
80023be159 | ||
|
|
ae3e4e6bb9 | ||
|
|
8c9e4d532b | ||
|
|
3c48afb5b5 | ||
|
|
3d22a01eef | ||
|
|
d6263bacca | ||
|
|
3b070ea095 | ||
|
|
82b715635b | ||
|
|
1d4494c8d7 | ||
|
|
56f5c07229 | ||
|
|
697ac440c7 | ||
|
|
f0edbc08a6 | ||
|
|
001607e840 | ||
|
|
e8f525daca | ||
|
|
6d6f7705c9 | ||
|
|
46b7fa0079 | ||
|
|
793a62396b | ||
|
|
7cb4975f5b | ||
|
|
bfaf647ad1 | ||
|
|
23d3dc58ed | ||
|
|
7bf07f36b7 | ||
|
|
7e7117fc3a | ||
|
|
ff159c7a29 | ||
|
|
92b84ab70b | ||
|
|
561d4ba93c | ||
|
|
2089e42c32 | ||
|
|
b50139af5d | ||
|
|
daacba2fa4 | ||
|
|
018b3ef3cc | ||
|
|
ddaa0daf14 | ||
|
|
13e924fcc7 | ||
|
|
6b3032f04d | ||
|
|
4f08f5f341 | ||
|
|
67e91df96b | ||
|
|
e915b70e4b | ||
|
|
e1ca1a97db | ||
|
|
688c4b4010 | ||
|
|
52f6dc7159 | ||
|
|
9f824292d1 | ||
|
|
1bef38380e | ||
|
|
b83729f6d8 | ||
|
|
d484e41bbd | ||
|
|
f9072c9312 | ||
|
|
fb78685c1e | ||
|
|
bb7eba1f92 | ||
|
|
3f778d63c1 | ||
|
|
161f84bc59 | ||
|
|
9168e3d358 | ||
|
|
085da97ca5 | ||
|
|
eed5632794 | ||
|
|
d7cd77f941 | ||
|
|
bb8fbb239d | ||
|
|
b09ef303d1 | ||
|
|
e532682558 | ||
|
|
1b3deedc47 | ||
|
|
8c68fcf89c | ||
|
|
3f8e046855 | ||
|
|
4de8756cac | ||
|
|
1e729ec2ee | ||
|
|
cffa3bb1cc | ||
|
|
4781090e29 | ||
|
|
e0cbc9d874 | ||
|
|
e0ba27f7d0 |
16
.github/workflows/check.yaml
vendored
16
.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:
|
||||
@@ -65,6 +69,7 @@ jobs:
|
||||
with:
|
||||
version: ${{ needs.test-version.outputs.version }}
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
upload-daemon:
|
||||
needs: test-version
|
||||
@@ -73,6 +78,7 @@ jobs:
|
||||
with:
|
||||
version: ${{ needs.test-version.outputs.version }}
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
|
||||
push-image:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -97,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:
|
||||
@@ -132,6 +144,7 @@ jobs:
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: "us-east-1"
|
||||
VERSION: ${{ needs.test-version.outputs.version }}
|
||||
REPO_PATH: '${{ secrets.REPO_PATH }}'
|
||||
run: |
|
||||
bash build/deps-manifest.sh && bash build/upload-deps.sh
|
||||
|
||||
@@ -156,6 +169,7 @@ jobs:
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: "us-east-1"
|
||||
VERSION: ${{ needs.test-version.outputs.version }}
|
||||
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
|
||||
|
||||
34
.github/workflows/push-deps-to-s3.yml
vendored
34
.github/workflows/push-deps-to-s3.yml
vendored
@@ -11,27 +11,13 @@ jobs:
|
||||
- name: "Checkout source code"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install coscmd
|
||||
run: pip install coscmd
|
||||
|
||||
- name: Configure coscmd
|
||||
env:
|
||||
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
|
||||
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}
|
||||
COS_BUCKET: ${{ secrets.COS_BUCKET }}
|
||||
COS_REGION: ${{ secrets.COS_REGION }}
|
||||
END_POINT: ${{ secrets.END_POINT }}
|
||||
run: |
|
||||
coscmd config -a $TENCENT_SECRET_ID \
|
||||
-s $TENCENT_SECRET_KEY \
|
||||
-b $COS_BUCKET \
|
||||
-r $COS_REGION
|
||||
|
||||
# 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"
|
||||
REPO_PATH: '${{ secrets.REPO_PATH }}'
|
||||
run: |
|
||||
bash build/deps-manifest.sh && bash build/upload-deps.sh
|
||||
|
||||
@@ -42,28 +28,12 @@ jobs:
|
||||
- name: "Checkout source code"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install coscmd
|
||||
run: pip install coscmd
|
||||
|
||||
- name: Configure coscmd
|
||||
env:
|
||||
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
|
||||
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}
|
||||
COS_BUCKET: ${{ secrets.COS_BUCKET }}
|
||||
COS_REGION: ${{ secrets.COS_REGION }}
|
||||
END_POINT: ${{ secrets.END_POINT }}
|
||||
run: |
|
||||
export PATH=$PATH:/usr/local/bin:/home/ubuntu/.local/bin
|
||||
coscmd config -m 10 -p 10 -a $TENCENT_SECRET_ID \
|
||||
-s $TENCENT_SECRET_KEY \
|
||||
-b $COS_BUCKET \
|
||||
-r $COS_REGION
|
||||
|
||||
# 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"
|
||||
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
|
||||
|
||||
33
.github/workflows/push-to-s3.yaml
vendored
33
.github/workflows/push-to-s3.yaml
vendored
@@ -11,22 +11,6 @@ jobs:
|
||||
- name: "Checkout source code"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install coscmd
|
||||
run: pip install coscmd
|
||||
|
||||
- name: Configure coscmd
|
||||
env:
|
||||
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
|
||||
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}
|
||||
COS_BUCKET: ${{ secrets.COS_BUCKET }}
|
||||
COS_REGION: ${{ secrets.COS_REGION }}
|
||||
END_POINT: ${{ secrets.END_POINT }}
|
||||
run: |
|
||||
coscmd config -a $TENCENT_SECRET_ID \
|
||||
-s $TENCENT_SECRET_KEY \
|
||||
-b $COS_BUCKET \
|
||||
-r $COS_REGION
|
||||
|
||||
# test
|
||||
- env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
@@ -42,23 +26,6 @@ jobs:
|
||||
- name: "Checkout source code"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install coscmd
|
||||
run: pip install coscmd
|
||||
|
||||
- name: Configure coscmd
|
||||
env:
|
||||
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
|
||||
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}
|
||||
COS_BUCKET: ${{ secrets.COS_BUCKET }}
|
||||
COS_REGION: ${{ secrets.COS_REGION }}
|
||||
END_POINT: ${{ secrets.END_POINT }}
|
||||
run: |
|
||||
export PATH=$PATH:/usr/local/bin:/home/ubuntu/.local/bin
|
||||
coscmd config -m 10 -p 10 -a $TENCENT_SECRET_ID \
|
||||
-s $TENCENT_SECRET_KEY \
|
||||
-b $COS_BUCKET \
|
||||
-r $COS_REGION
|
||||
|
||||
- env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
|
||||
21
.github/workflows/release-cli.yaml
vendored
21
.github/workflows/release-cli.yaml
vendored
@@ -8,7 +8,21 @@ on:
|
||||
required: true
|
||||
ref:
|
||||
type: string
|
||||
repository:
|
||||
type: string
|
||||
release-id:
|
||||
type: string
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
type: string
|
||||
required: true
|
||||
ref:
|
||||
type: string
|
||||
repository:
|
||||
type: string
|
||||
release-id:
|
||||
type: string
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -18,6 +32,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 1
|
||||
ref: ${{ inputs.ref }}
|
||||
repository: ${{ inputs.repository }}
|
||||
|
||||
- name: Add Local Git Tag For GoReleaser
|
||||
run: git tag ${{ inputs.version }}
|
||||
@@ -42,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
|
||||
@@ -50,7 +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
|
||||
aws s3 cp "$file" s3://terminus-os-install/$file --acl=public-read
|
||||
# coscmd upload $file /$file
|
||||
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
|
||||
|
||||
23
.github/workflows/release-daemon.yaml
vendored
23
.github/workflows/release-daemon.yaml
vendored
@@ -8,7 +8,21 @@ on:
|
||||
required: true
|
||||
ref:
|
||||
type: string
|
||||
repository:
|
||||
type: string
|
||||
release-id:
|
||||
type: string
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
type: string
|
||||
required: true
|
||||
ref:
|
||||
type: string
|
||||
repository:
|
||||
type: string
|
||||
release-id:
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
@@ -19,6 +33,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 1
|
||||
ref: ${{ inputs.ref }}
|
||||
repository: ${{ inputs.repository }}
|
||||
|
||||
- name: Add Local Git Tag For GoReleaser
|
||||
run: git tag ${{ inputs.version }}
|
||||
@@ -31,7 +46,7 @@ jobs:
|
||||
|
||||
- name: install udev-devel
|
||||
run: |
|
||||
sudo apt install -y libudev-dev
|
||||
sudo apt update && sudo apt install -y libudev-dev
|
||||
|
||||
- name: Install x86_64 cross-compiler
|
||||
run: sudo apt-get update && sudo apt-get install -y build-essential
|
||||
@@ -41,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'
|
||||
@@ -53,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
|
||||
aws s3 cp "$file" s3://terminus-os-install/$file --acl=public-read
|
||||
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
|
||||
|
||||
54
.github/workflows/release-daily.yaml
vendored
54
.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,11 +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:
|
||||
@@ -94,16 +110,16 @@ 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
|
||||
bash build/deps-manifest.sh linux/arm64 && bash build/upload-deps.sh linux/arm64
|
||||
|
||||
|
||||
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'
|
||||
@@ -111,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
|
||||
@@ -121,35 +137,31 @@ jobs:
|
||||
AWS_DEFAULT_REGION: 'us-east-1'
|
||||
run: |
|
||||
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/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/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 }}.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 && \
|
||||
|
||||
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: |
|
||||
cp .dist/install-wizard/install.sh build/base-package
|
||||
cp build/base-package/install.sh build/base-package/publicInstaller.sh
|
||||
cp .dist/install-wizard/install.ps1 build/base-package
|
||||
cp .dist/install-wizard/joincluster.sh build/base-package
|
||||
|
||||
- name: Release public files
|
||||
uses: softprops/action-gh-release@v1
|
||||
|
||||
80
.github/workflows/release.yaml
vendored
80
.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:
|
||||
@@ -80,12 +138,15 @@ jobs:
|
||||
AWS_DEFAULT_REGION: 'us-east-1'
|
||||
run: |
|
||||
md5sum install-wizard-v${{ github.event.inputs.tags }}.tar.gz > install-wizard-v${{ github.event.inputs.tags }}.md5sum.txt && \
|
||||
aws s3 cp install-wizard-v${{ github.event.inputs.tags }}.md5sum.txt s3://terminus-os-install/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/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 }}.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/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,15 +173,16 @@ 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
|
||||
|
||||
- name: Release public files
|
||||
uses: softprops/action-gh-release@v1
|
||||
@@ -135,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
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -31,3 +31,10 @@ olares-cli-*.tar.gz
|
||||
.DS_Store
|
||||
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/>.
|
||||
27
README.md
27
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?**
|
||||
>
|
||||
@@ -108,20 +108,15 @@ Olares has been tested and verified on the following Linux platforms:
|
||||
To get started with Olares on your own device, follow the [Getting Started Guide](https://docs.olares.com/manual/get-started/) for step-by-step instructions.
|
||||
|
||||
## Project navigation
|
||||
|
||||
> [!NOTE]
|
||||
> We are currently consolidating Olares subproject code into this repository. This process may take a few months. Once finished, you will get a comprehensive view of the entire Olares system here.
|
||||
|
||||
|
||||
This section lists the main directories in the Olares repository:
|
||||
|
||||
* **`apps`**: Contains the code for system applications, primarily for `larepass`.
|
||||
* **`cli`**: Contains the code for `olares-cli`, the command-line interface tool for Olares.
|
||||
* **`daemon`**: Contains the code for `olaresd`, the system daemon process.
|
||||
* **`docs`**: Contains documentation for the project.
|
||||
* **`framework`**: Contains the Olares system services.
|
||||
* **`infrastructure`**: Contains code related to infrastructure components such as computing, storage, networking, and GPUs.
|
||||
* **`platform`**: Contains code for cloud-native components like databases and message queues.
|
||||
* **[`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`](./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.
|
||||
* **`vendor`**: Contains code from third-party hardware vendors.
|
||||
|
||||
## Contributing to Olares
|
||||
@@ -139,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
|
||||
|
||||
|
||||
26
README_CN.md
26
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 有什么不同?**
|
||||
>
|
||||
@@ -110,19 +110,15 @@ Olares 已在以下 Linux 平台完成测试与验证:
|
||||
参考[快速上手指南](https://docs.olares.cn/zh/manual/get-started/)安装并激活 Olares。
|
||||
|
||||
## 项目目录
|
||||
|
||||
> [!NOTE]
|
||||
> 我们正将 Olares 子项目的代码移动到当前仓库。此过程可能会持续数月。届时您就可以通过本仓库了解 Olares 系统的全貌。
|
||||
|
||||
Olares 代码库中的主要目录如下:
|
||||
|
||||
* **`apps`**: 用于存放系统应用,主要是 `larepass` 的代码。
|
||||
* **`cli`**: 用于存放 `olares-cli`(Olares 的命令行界面工具)的代码。
|
||||
* **`daemon`**: 用于存放 `olaresd`(系统守护进程)的代码。
|
||||
* **`docs`**: 用于存放 Olares 项目的文档。
|
||||
* **`framework`**: 用来存放 Olares 系统服务代码。
|
||||
* **`infrastructure`**: 用于存放计算,存储,网络,GPU 等基础设施的代码。
|
||||
* **`platform`**: 用于存放数据库、消息队列等云原生组件的代码。
|
||||
* **[`apps`](./apps)**: 用于存放系统应用,主要是 `larepass` 的代码。
|
||||
* **[`cli`](./cli)**: 用于存放 `olares-cli`(Olares 的命令行界面工具)的代码。
|
||||
* **[`daemon`](./daemon)**: 用于存放 `olaresd`(系统守护进程)的代码。
|
||||
* **[`docs`**](./docs)**: 用于存放 Olares 项目的文档。
|
||||
* **[`framework`](./framework)**: 用来存放 Olares 系统服务代码。
|
||||
* **[`infrastructure`](./infrastructure)**: 用于存放计算,存储,网络,GPU 等基础设施的代码。
|
||||
* **[`platform`](./platform)**: 用于存放数据库、消息队列等云原生组件的代码。
|
||||
* **`vendor`**: 用于存放来自第三方硬件供应商的代码。
|
||||
|
||||
## 社区贡献
|
||||
@@ -140,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 相关的任何主题。
|
||||
|
||||
## 特别感谢
|
||||
|
||||
|
||||
28
README_JP.md
28
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,20 +108,16 @@ Olaresは以下のLinuxプラットフォームで動作検証を完了してい
|
||||
自分のデバイスでOlaresを始めるには、[はじめにガイド](https://docs.olares.com/manual/get-started/)に従ってステップバイステップの手順を確認してください。
|
||||
|
||||
|
||||
## プロジェクトナビゲーション
|
||||
|
||||
> [!NOTE]
|
||||
> 現在、Olaresのサブプロジェクトのコードを当リポジトリへ移行する作業を進めています。この作業が完了するまでには数ヶ月を要する見込みです。完了後には、当リポジトリを通じてOlaresシステムの全貌をご覧いただけるようになります。
|
||||
|
||||
## プロジェクトナビゲーションx
|
||||
このセクションでは、Olares リポジトリ内の主要なディレクトリをリストアップしています:
|
||||
|
||||
* **`apps`**: システムアプリケーションのコードが含まれており、主に `larepass` 用です。
|
||||
* **`cli`**: Olares のコマンドラインインターフェースツールである `olares-cli` のコードが含まれています。
|
||||
* **`daemon`**: システムデーモンプロセスである `olaresd` のコードが含まれています。
|
||||
* **`docs`**: プロジェクトのドキュメントが含まれています。
|
||||
* **`framework`**: Olares システムサービスが含まれています。
|
||||
* **`infrastructure`**: コンピューティング、ストレージ、ネットワーキング、GPU などのインフラストラクチャコンポーネントに関連するコードが含まれています。
|
||||
* **`platform`**: データベースやメッセージキューなどのクラウドネイティブコンポーネントのコードが含まれています。
|
||||
* **[`apps`](./apps)**: システムアプリケーションのコードが含まれており、主に `larepass` 用です。
|
||||
* **[`cli`](./cli)**: Olares のコマンドラインインターフェースツールである `olares-cli` のコードが含まれています。
|
||||
* **[`daemon`](./daemon)**: システムデーモンプロセスである `olaresd` のコードが含まれています。
|
||||
* **[`docs`](./docs)**: プロジェクトのドキュメントが含まれています。
|
||||
* **[`framework`](./framework)**: Olares システムサービスが含まれています。
|
||||
* **[`infrastructure`](./infrastructure)**: コンピューティング、ストレージ、ネットワーキング、GPU などのインフラストラクチャコンポーネントに関連するコードが含まれています。
|
||||
* **[`platform`](./platform)**: データベースやメッセージキューなどのクラウドネイティブコンポーネントのコードが含まれています。
|
||||
* **`vendor`**: サードパーティのハードウェアベンダーからのコードが含まれています。
|
||||
|
||||
## Olaresへの貢献
|
||||
@@ -139,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,26 +0,0 @@
|
||||
apiVersion: v2
|
||||
name: appstore
|
||||
description: A Helm chart for Kubernetes
|
||||
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.0.1
|
||||
|
||||
# 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: "1.16.0"
|
||||
@@ -1,62 +0,0 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "appstore.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "appstore.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "appstore.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "appstore.labels" -}}
|
||||
helm.sh/chart: {{ include "appstore.chart" . }}
|
||||
{{ include "appstore.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "appstore.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "appstore.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "appstore.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "appstore.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -1,353 +0,0 @@
|
||||
{{- $market_secret := (lookup "v1" "Secret" .Release.Namespace "market-secrets") -}}
|
||||
|
||||
{{- $redis_password := "" -}}
|
||||
{{ if $market_secret -}}
|
||||
{{ $redis_password = (index $market_secret "data" "redis-passwords") }}
|
||||
{{ else -}}
|
||||
{{ $redis_password = randAlphaNum 16 | b64enc }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $market_backend_nats_secret := (lookup "v1" "Secret" .Release.Namespace "market-backend-nats-secret") -}}
|
||||
{{- $nats_password := "" -}}
|
||||
{{ if $market_backend_nats_secret -}}
|
||||
{{ $nats_password = (index $market_backend_nats_secret "data" "nats_password") }}
|
||||
{{ else -}}
|
||||
{{ $nats_password = randAlphaNum 16 | b64enc }}
|
||||
{{- end -}}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: market-backend-nats-secret
|
||||
namespace: {{ .Release.Namespace }}
|
||||
type: Opaque
|
||||
data:
|
||||
nats_password: {{ $nats_password }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: market-secrets
|
||||
namespace: {{ .Release.Namespace }}
|
||||
type: Opaque
|
||||
data:
|
||||
redis-passwords: {{ $redis_password }}
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: market-deployment
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: appstore
|
||||
applications.app.bytetrade.io/author: bytetrade.io
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: appstore
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: appstore
|
||||
io.bytetrade.app: "true"
|
||||
annotations:
|
||||
instrumentation.opentelemetry.io/inject-go: "olares-instrumentation"
|
||||
instrumentation.opentelemetry.io/go-container-names: "appstore-backend"
|
||||
instrumentation.opentelemetry.io/otel-go-auto-target-exe: "/opt/app/market"
|
||||
spec:
|
||||
priorityClassName: "system-cluster-critical"
|
||||
initContainers:
|
||||
- args:
|
||||
- -it
|
||||
- authelia-backend.os-system:9091
|
||||
image: owncloudci/wait-for:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: check-auth
|
||||
- name: terminus-sidecar-init
|
||||
image: openservicemesh/init:v1.2.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
privileged: true
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
runAsNonRoot: false
|
||||
runAsUser: 0
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
iptables-restore --noflush <<EOF
|
||||
# sidecar interception rules
|
||||
*nat
|
||||
:PROXY_IN_REDIRECT - [0:0]
|
||||
:PROXY_INBOUND - [0:0]
|
||||
-A PROXY_IN_REDIRECT -p tcp -j REDIRECT --to-port 15003
|
||||
-A PROXY_INBOUND -p tcp --dport 15000 -j RETURN
|
||||
-A PROXY_INBOUND -p tcp -j PROXY_IN_REDIRECT
|
||||
-A PREROUTING -p tcp -j PROXY_INBOUND
|
||||
COMMIT
|
||||
EOF
|
||||
|
||||
env:
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: status.podIP
|
||||
containers:
|
||||
- name: appstore-backend
|
||||
image: beclab/market-backend:v0.3.12
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 81
|
||||
env:
|
||||
- name: OS_SYSTEM_SERVER
|
||||
value: system-server.user-system-{{ .Values.bfl.username }}
|
||||
- name: OS_APP_SECRET
|
||||
value: '{{ .Values.os.appstore.appSecret }}'
|
||||
- name: OS_APP_KEY
|
||||
value: {{ .Values.os.appstore.appKey }}
|
||||
- name: APP_SOTRE_SERVICE_SERVICE_HOST
|
||||
value: appstore-server-prod.bttcdn.com
|
||||
- name: MARKET_PROVIDER
|
||||
value: '{{ .Values.os.appstore.marketProvider }}'
|
||||
- name: APP_SOTRE_SERVICE_SERVICE_PORT
|
||||
value: '443'
|
||||
- name: APP_SERVICE_SERVICE_HOST
|
||||
value: app-service.os-system
|
||||
- name: APP_SERVICE_SERVICE_PORT
|
||||
value: '6755'
|
||||
- name: REPO_URL_PORT
|
||||
value: "82"
|
||||
- name: REDIS_ADDRESS
|
||||
value: 'redis-cluster-proxy.user-system-{{ .Values.bfl.username }}:6379'
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: market-secrets
|
||||
key: redis-passwords
|
||||
- name: REDIS_DB_NUMBER
|
||||
value: '0'
|
||||
- name: REPO_URL_HOST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: NATS_HOST
|
||||
value: nats.user-system-{{ .Values.bfl.username }}
|
||||
- name: NATS_PORT
|
||||
value: '4222'
|
||||
- name: NATS_USERNAME
|
||||
value: market-backend-{{ .Values.bfl.username}}
|
||||
- name: NATS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: market-backend-nats-secret
|
||||
key: nats_password
|
||||
- name: NATS_SUBJECT_USER_APPLICATION
|
||||
value: terminus.user.application.{{ .Values.bfl.username}}
|
||||
volumeMounts:
|
||||
- name: opt-data
|
||||
mountPath: /opt/app/data
|
||||
- name: terminus-envoy-sidecar
|
||||
image: bytetrade/envoy:v1.25.11
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
runAsUser: 1000
|
||||
ports:
|
||||
- name: proxy-admin
|
||||
containerPort: 15000
|
||||
- name: proxy-inbound
|
||||
containerPort: 15003
|
||||
volumeMounts:
|
||||
- name: terminus-sidecar-config
|
||||
readOnly: true
|
||||
mountPath: /etc/envoy/envoy.yaml
|
||||
subPath: envoy.yaml
|
||||
command:
|
||||
- /usr/local/bin/envoy
|
||||
- --log-level
|
||||
- debug
|
||||
- -c
|
||||
- /etc/envoy/envoy.yaml
|
||||
env:
|
||||
- name: POD_UID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.uid
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: terminus-ws-sidecar
|
||||
image: 'beclab/ws-gateway:v1.0.5'
|
||||
command:
|
||||
- /ws-gateway
|
||||
env:
|
||||
- name: WS_PORT
|
||||
value: '81'
|
||||
- name: WS_URL
|
||||
value: /app-store/v1/websocket/message
|
||||
resources: { }
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
imagePullPolicy: IfNotPresent
|
||||
volumes:
|
||||
- name: terminus-sidecar-config
|
||||
configMap:
|
||||
name: sidecar-ws-configs
|
||||
items:
|
||||
- key: envoy.yaml
|
||||
path: envoy.yaml
|
||||
- name: opt-data
|
||||
hostPath:
|
||||
path: '{{ .Values.userspace.appData}}/appstore/data'
|
||||
type: DirectoryOrCreate
|
||||
- name: app
|
||||
emptyDir: {}
|
||||
- name: nginx-confd
|
||||
emptyDir: {}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: appstore-service
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: appstore
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- protocol: TCP
|
||||
name: appstore-backend
|
||||
port: 81
|
||||
targetPort: 81
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ApplicationPermission
|
||||
metadata:
|
||||
name: appstore
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
app: appstore
|
||||
appid: appstore
|
||||
key: {{ .Values.os.appstore.appKey }}
|
||||
secret: {{ .Values.os.appstore.appSecret }}
|
||||
permissions:
|
||||
- dataType: event
|
||||
group: message-disptahcer.system-server
|
||||
ops:
|
||||
- Create
|
||||
version: v1
|
||||
- dataType: app
|
||||
group: service.bfl
|
||||
ops:
|
||||
- UserApps
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
|
||||
---
|
||||
apiVersion: sys.bytetrade.io/v1alpha1
|
||||
kind: ProviderRegistry
|
||||
metadata:
|
||||
name: appstore-backend-provider
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
dataType: app
|
||||
deployment: market
|
||||
description: app store provider
|
||||
endpoint: appstore-service.{{ .Release.Namespace }}
|
||||
group: service.appstore
|
||||
kind: provider
|
||||
namespace: {{ .Release.Namespace }}
|
||||
opApis:
|
||||
- name: InstallDevApp
|
||||
uri: /app-store/v1/applications/provider/installdev
|
||||
- name: UninstallDevApp
|
||||
uri: /app-store/v1/applications/provider/uninstalldev
|
||||
version: v1
|
||||
status:
|
||||
state: active
|
||||
---
|
||||
apiVersion: apr.bytetrade.io/v1alpha1
|
||||
kind: MiddlewareRequest
|
||||
metadata:
|
||||
name: market-redis
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
app: market
|
||||
appNamespace: {{ .Release.Namespace }}
|
||||
middleware: redis
|
||||
redis:
|
||||
password:
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: redis-passwords
|
||||
name: market-secrets
|
||||
namespace: market
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: appstore-svc
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: appstore
|
||||
ports:
|
||||
- name: "appstore-backend"
|
||||
protocol: TCP
|
||||
port: 81
|
||||
targetPort: 81
|
||||
- name: "appstore-websocket"
|
||||
protocol: TCP
|
||||
port: 40010
|
||||
targetPort: 40010
|
||||
---
|
||||
apiVersion: apr.bytetrade.io/v1alpha1
|
||||
kind: MiddlewareRequest
|
||||
metadata:
|
||||
name: market-backend-nats
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
app: market-backend
|
||||
appNamespace: user
|
||||
middleware: nats
|
||||
nats:
|
||||
password:
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: nats_password
|
||||
name: market-backend-nats-secret
|
||||
refs:
|
||||
- appName: user-service
|
||||
appNamespace: user
|
||||
subjects:
|
||||
- name: "application.*"
|
||||
perm:
|
||||
- pub
|
||||
- sub
|
||||
- appName: user-service
|
||||
appNamespace: user
|
||||
subjects:
|
||||
- name: "market.*"
|
||||
perm:
|
||||
- pub
|
||||
- sub
|
||||
user: market-backend-{{ .Values.bfl.username}}
|
||||
@@ -1,44 +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
|
||||
search2:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
appstore:
|
||||
marketProvider: ''
|
||||
kubesphere:
|
||||
redis_password: ""
|
||||
@@ -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,549 +0,0 @@
|
||||
{{- $namespace := printf "%s%s" "user-system-" .Values.bfl.username -}}
|
||||
{{- $studio_secret := (lookup "v1" "Secret" $namespace "studio-secrets") -}}
|
||||
|
||||
{{- $pg_password := "" -}}
|
||||
{{ if $studio_secret -}}
|
||||
{{ $pg_password = (index $studio_secret "data" "pg_password") }}
|
||||
{{ else -}}
|
||||
{{ $pg_password = randAlphaNum 16 | b64enc }}
|
||||
{{- end -}}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: studio-secrets
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
type: Opaque
|
||||
data:
|
||||
pg_password: {{ $pg_password }}
|
||||
|
||||
---
|
||||
apiVersion: apr.bytetrade.io/v1alpha1
|
||||
kind: MiddlewareRequest
|
||||
metadata:
|
||||
name: studio-pg
|
||||
namespace: user-system-{{ .Values.bfl.username }}
|
||||
spec:
|
||||
app: studio
|
||||
appNamespace: {{ .Release.Namespace }}
|
||||
middleware: postgres
|
||||
postgreSQL:
|
||||
user: studio_{{ .Values.bfl.username }}
|
||||
password:
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: pg_password
|
||||
name: studio-secrets
|
||||
databases:
|
||||
- name: studio
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: studio-server
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: studio-server
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8080
|
||||
targetPort: 8088
|
||||
name: http
|
||||
- protocol: TCP
|
||||
port: 8083
|
||||
targetPort: 8083
|
||||
name: https
|
||||
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: chartmuseum-studio
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
protocol: TCP
|
||||
port: 8080
|
||||
targetPort: 8888
|
||||
selector:
|
||||
app: studio-server
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: studio-san-cnf
|
||||
namespace: {{ .Release.Namespace }}
|
||||
data:
|
||||
san.cnf: |
|
||||
[req]
|
||||
distinguished_name = req_distinguished_name
|
||||
req_extensions = v3_req
|
||||
prompt = no
|
||||
|
||||
[req_distinguished_name]
|
||||
countryName = CN
|
||||
stateOrProvinceName = Beijing
|
||||
localityName = Beijing
|
||||
0.organizationName = bytetrade
|
||||
commonName = studio-server.{{ .Release.Namespace }}.svc
|
||||
|
||||
[v3_req]
|
||||
basicConstraints = CA:FALSE
|
||||
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
||||
subjectAltName = @bytetrade
|
||||
|
||||
[bytetrade]
|
||||
DNS.1 = studio-server.{{ .Release.Namespace }}.svc
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: studio-server
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: studio-server
|
||||
applications.app.bytetrade.io/author: bytetrade.io
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: studio-server
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: studio-server
|
||||
spec:
|
||||
serviceAccountName: bytetrade-controller
|
||||
volumes:
|
||||
- name: chart
|
||||
hostPath:
|
||||
type: DirectoryOrCreate
|
||||
path: '{{ .Values.userspace.appData}}/studio/Chart'
|
||||
- name: data
|
||||
hostPath:
|
||||
type: DirectoryOrCreate
|
||||
path: '{{ .Values.userspace.appData }}/studio/Data'
|
||||
- name: storage-volume
|
||||
hostPath:
|
||||
path: '{{ .Values.userspace.appData }}/studio/helm-repo-dev'
|
||||
type: DirectoryOrCreate
|
||||
- name: config-san
|
||||
configMap:
|
||||
name: studio-san-cnf
|
||||
items:
|
||||
- key: san.cnf
|
||||
path: san.cnf
|
||||
- name: sidecar-configs-studio
|
||||
configMap:
|
||||
name: sidecar-configs-studio
|
||||
items:
|
||||
- key: envoy.yaml
|
||||
path: envoy.yaml
|
||||
- name: certs
|
||||
emptyDir: {}
|
||||
initContainers:
|
||||
- name: init-chmod-data
|
||||
image: busybox:1.28
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- sh
|
||||
- '-c'
|
||||
- |
|
||||
chown -R 1000:1000 /home/coder
|
||||
chown -R 65532:65532 /charts
|
||||
chown -R 65532:65532 /data
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
resources: { }
|
||||
volumeMounts:
|
||||
- name: storage-volume
|
||||
mountPath: /home/coder
|
||||
- name: chart
|
||||
mountPath: /charts
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: terminus-sidecar-init
|
||||
image: aboveos/openservicemesh-init:v1.2.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
iptables-restore --noflush <<EOF
|
||||
# sidecar interception rules
|
||||
*nat
|
||||
:PROXY_IN_REDIRECT - [0:0]
|
||||
:PROXY_INBOUND - [0:0]
|
||||
:PROXY_OUTBOUND - [0:0]
|
||||
:PROXY_OUT_REDIRECT - [0:0]
|
||||
|
||||
-A PREROUTING -p tcp -j PROXY_INBOUND
|
||||
-A OUTPUT -p tcp -j PROXY_OUTBOUND
|
||||
-A PROXY_INBOUND -p tcp --dport 15000 -j RETURN
|
||||
-A PROXY_INBOUND -p tcp --dport 8083 -j RETURN
|
||||
-A PROXY_INBOUND -p tcp -j PROXY_IN_REDIRECT
|
||||
-A PROXY_IN_REDIRECT -p tcp -j REDIRECT --to-port 15003
|
||||
|
||||
|
||||
-A PROXY_OUTBOUND -p tcp --dport 5432 -j RETURN
|
||||
-A PROXY_OUTBOUND -p tcp --dport 6379 -j RETURN
|
||||
-A PROXY_OUTBOUND -p tcp --dport 27017 -j RETURN
|
||||
-A PROXY_OUTBOUND -p tcp --dport 443 -j RETURN
|
||||
-A PROXY_OUTBOUND -p tcp --dport 8080 -j RETURN
|
||||
|
||||
-A PROXY_OUTBOUND -d ${POD_IP}/32 -j RETURN
|
||||
|
||||
-A PROXY_OUTBOUND -o lo ! -d 127.0.0.1/32 -m owner --uid-owner 1555 -j PROXY_IN_REDIRECT
|
||||
-A PROXY_OUTBOUND -o lo -m owner ! --uid-owner 1555 -j RETURN
|
||||
-A PROXY_OUTBOUND -m owner --uid-owner 1555 -j RETURN
|
||||
-A PROXY_OUTBOUND -d 127.0.0.1/32 -j RETURN
|
||||
|
||||
-A PROXY_OUTBOUND -j PROXY_OUT_REDIRECT
|
||||
-A PROXY_OUT_REDIRECT -p tcp -j REDIRECT --to-port 15001
|
||||
|
||||
COMMIT
|
||||
EOF
|
||||
env:
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: status.podIP
|
||||
securityContext:
|
||||
privileged: true
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
runAsNonRoot: false
|
||||
runAsUser: 0
|
||||
|
||||
- name: generate-certs
|
||||
image: beclab/openssl:v3
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: [ "/bin/sh", "-c" ]
|
||||
args:
|
||||
- |
|
||||
openssl genrsa -out /etc/certs/ca.key 2048
|
||||
openssl req -new -x509 -days 3650 -key /etc/certs/ca.key -out /etc/certs/ca.crt \
|
||||
-subj "/CN=bytetrade CA/O=bytetrade/C=CN"
|
||||
openssl req -new -newkey rsa:2048 -nodes \
|
||||
-keyout /etc/certs/server.key -out /etc/certs/server.csr \
|
||||
-config /etc/san/san.cnf
|
||||
openssl x509 -req -days 3650 -in /etc/certs/server.csr \
|
||||
-CA /etc/certs/ca.crt -CAkey /etc/certs/ca.key \
|
||||
-CAcreateserial -out /etc/certs/server.crt \
|
||||
-extensions v3_req -extfile /etc/san/san.cnf
|
||||
chown -R 65532 /etc/certs/*
|
||||
volumeMounts:
|
||||
- name: config-san
|
||||
mountPath: /etc/san
|
||||
- name: certs
|
||||
mountPath: /etc/certs
|
||||
|
||||
containers:
|
||||
- name: studio
|
||||
image: beclab/studio-server:v0.1.50
|
||||
imagePullPolicy: IfNotPresent
|
||||
args:
|
||||
- server
|
||||
ports:
|
||||
- name: port
|
||||
containerPort: 8088
|
||||
protocol: TCP
|
||||
- name: ssl-port
|
||||
containerPort: 8083
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: chart
|
||||
mountPath: /charts
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- mountPath: /etc/certs
|
||||
name: certs
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command:
|
||||
- "/studio"
|
||||
- "clean"
|
||||
env:
|
||||
- name: BASE_DIR
|
||||
value: /charts
|
||||
- name: OS_API_KEY
|
||||
value: {{ .Values.os.studio.appKey }}
|
||||
- name: OS_API_SECRET
|
||||
value: {{ .Values.os.studio.appSecret }}
|
||||
- name: OS_SYSTEM_SERVER
|
||||
value: system-server.user-system-{{ .Values.bfl.username }}
|
||||
- name: NAME_SPACE
|
||||
value: {{ .Release.Namespace }}
|
||||
- name: OWNER
|
||||
value: '{{ .Values.bfl.username }}'
|
||||
- name: DB_HOST
|
||||
value: citus-master-svc.user-system-{{ .Values.bfl.username }}
|
||||
- name: DB_USERNAME
|
||||
value: studio_{{ .Values.bfl.username }}
|
||||
- name: DB_PASSWORD
|
||||
value: "{{ $pg_password | b64dec }}"
|
||||
- name: DB_NAME
|
||||
value: user_space_{{ .Values.bfl.username }}_studio
|
||||
- name: DB_PORT
|
||||
value: "5432"
|
||||
resources:
|
||||
requests:
|
||||
cpu: "50m"
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: "0.5"
|
||||
memory: 1000Mi
|
||||
- name: terminus-envoy-sidecar
|
||||
image: bytetrade/envoy:v1.25.11.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
runAsUser: 1555
|
||||
ports:
|
||||
- name: proxy-admin
|
||||
containerPort: 15000
|
||||
- name: proxy-inbound
|
||||
containerPort: 15003
|
||||
- name: proxy-outbound
|
||||
containerPort: 15001
|
||||
resources:
|
||||
requests:
|
||||
cpu: "50m"
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: "0.5"
|
||||
memory: 200Mi
|
||||
volumeMounts:
|
||||
- name: sidecar-configs-studio
|
||||
readOnly: true
|
||||
mountPath: /etc/envoy/envoy.yaml
|
||||
subPath: envoy.yaml
|
||||
command:
|
||||
- /usr/local/bin/envoy
|
||||
- --log-level
|
||||
- debug
|
||||
- -c
|
||||
- /etc/envoy/envoy.yaml
|
||||
env:
|
||||
- name: POD_UID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.uid
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: APP_KEY
|
||||
value: {{ .Values.os.studio.appKey }}
|
||||
- name: APP_SECRET
|
||||
value: {{ .Values.os.studio.appSecret }}
|
||||
- name: chartmuseum
|
||||
image: aboveos/helm-chartmuseum:v0.15.0
|
||||
args:
|
||||
- '--port=8888'
|
||||
- '--storage-local-rootdir=/storage'
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8888
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: CHART_POST_FORM_FIELD_NAME
|
||||
value: chart
|
||||
- name: DISABLE_API
|
||||
value: 'false'
|
||||
- name: LOG_JSON
|
||||
value: 'true'
|
||||
- name: PROV_POST_FORM_FIELD_NAME
|
||||
value: prov
|
||||
- name: STORAGE
|
||||
value: local
|
||||
resources:
|
||||
requests:
|
||||
cpu: "50m"
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- name: storage-volume
|
||||
mountPath: /storage
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 1
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 1
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
envoy.yaml: |
|
||||
admin:
|
||||
access_log_path: "/dev/stdout"
|
||||
address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 15000
|
||||
static_resources:
|
||||
listeners:
|
||||
- name: listener_0
|
||||
address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 15003
|
||||
listener_filters:
|
||||
- name: envoy.filters.listener.original_dst
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.http_connection_manager
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
|
||||
stat_prefix: desktop_http
|
||||
upgrade_configs:
|
||||
- upgrade_type: websocket
|
||||
- upgrade_type: tailscale-control-protocol
|
||||
skip_xff_append: false
|
||||
codec_type: AUTO
|
||||
route_config:
|
||||
name: local_route
|
||||
virtual_hosts:
|
||||
- name: service
|
||||
domains: ["*"]
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/"
|
||||
route:
|
||||
cluster: original_dst
|
||||
timeout: 1800s
|
||||
http_protocol_options:
|
||||
accept_http_10: true
|
||||
http_filters:
|
||||
- name: envoy.filters.http.router
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
|
||||
- name: listener_1
|
||||
address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 15001
|
||||
listener_filters:
|
||||
- name: envoy.filters.listener.original_dst
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.http_connection_manager
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
|
||||
stat_prefix: studio_out_http
|
||||
skip_xff_append: false
|
||||
codec_type: AUTO
|
||||
route_config:
|
||||
name: local_route
|
||||
virtual_hosts:
|
||||
- name: service
|
||||
domains: ["*"]
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/server/intent/send"
|
||||
request_headers_to_add:
|
||||
- header:
|
||||
key: X-App-Key
|
||||
value: {{ .Values.os.studio.appKey }}
|
||||
route:
|
||||
cluster: system-server
|
||||
prefix_rewrite: /system-server/v2/legacy_api/api.intent/v2/server/intent/send
|
||||
- match:
|
||||
prefix: "/"
|
||||
route:
|
||||
cluster: original_dst
|
||||
timeout: 1800s
|
||||
typed_per_filter_config:
|
||||
envoy.filters.http.lua:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute
|
||||
disabled: true
|
||||
|
||||
http_protocol_options:
|
||||
accept_http_10: true
|
||||
http_filters:
|
||||
- name: envoy.filters.http.lua
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
|
||||
inline_code:
|
||||
local sha = require("lib.sha2")
|
||||
function envoy_on_request(request_handle)
|
||||
local app_key = os.getenv("APP_KEY")
|
||||
local app_secret = os.getenv("APP_SECRET")
|
||||
local current_time = os.time()
|
||||
local minute_level_time = current_time - (current_time % 60)
|
||||
local time_string = tostring(minute_level_time)
|
||||
local s = app_key .. app_secret .. time_string
|
||||
request_handle:logInfo("originstring:" .. s)
|
||||
local hash = sha.sha256(s)
|
||||
request_handle:logInfo("Hello World.")
|
||||
request_handle:logInfo(hash)
|
||||
request_handle:headers():add("X-Auth-Signature",hash)
|
||||
end
|
||||
- name: envoy.filters.http.router
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
|
||||
|
||||
|
||||
clusters:
|
||||
- name: original_dst
|
||||
connect_timeout: 5000s
|
||||
type: ORIGINAL_DST
|
||||
lb_policy: CLUSTER_PROVIDED
|
||||
- name: system-server
|
||||
connect_timeout: 2s
|
||||
type: LOGICAL_DNS
|
||||
dns_lookup_family: V4_ONLY
|
||||
dns_refresh_rate: 600s
|
||||
lb_policy: ROUND_ROBIN
|
||||
load_assignment:
|
||||
cluster_name: system-server
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: system-server.user-system-{{ .Values.bfl.username }}
|
||||
port_value: 80
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: sidecar-configs-studio
|
||||
namespace: {{ .Release.Namespace }}
|
||||
@@ -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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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 }}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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: ""
|
||||
|
||||
@@ -22,123 +22,25 @@ spec:
|
||||
initContainers:
|
||||
- args:
|
||||
- -it
|
||||
- authelia-backend.os-system:9091
|
||||
- authelia-backend.os-framework:9091
|
||||
image: owncloudci/wait-for:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: check-auth
|
||||
# - name: terminus-sidecar-init
|
||||
# image: openservicemesh/init:v1.2.3
|
||||
# imagePullPolicy: IfNotPresent
|
||||
# securityContext:
|
||||
# privileged: true
|
||||
# capabilities:
|
||||
# add:
|
||||
# - NET_ADMIN
|
||||
# runAsNonRoot: false
|
||||
# runAsUser: 0
|
||||
# command:
|
||||
# - /bin/sh
|
||||
# - -c
|
||||
# - |
|
||||
# iptables-restore --noflush <<EOF
|
||||
# # sidecar interception rules
|
||||
# *nat
|
||||
# :PROXY_IN_REDIRECT - [0:0]
|
||||
# :PROXY_INBOUND - [0:0]
|
||||
# -A PROXY_IN_REDIRECT -p tcp -j REDIRECT --to-port 15003
|
||||
# -A PROXY_INBOUND -p tcp --dport 15000 -j RETURN
|
||||
# -A PROXY_INBOUND -p tcp -j PROXY_IN_REDIRECT
|
||||
# -A PREROUTING -p tcp -j PROXY_INBOUND
|
||||
# COMMIT
|
||||
# EOF
|
||||
|
||||
# env:
|
||||
# - name: POD_IP
|
||||
# valueFrom:
|
||||
# fieldRef:
|
||||
# apiVersion: v1
|
||||
# fieldPath: status.podIP
|
||||
|
||||
containers:
|
||||
- name: wizard
|
||||
image: beclab/wizard:v1.3.57
|
||||
image: beclab/wizard:v1.4.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 80
|
||||
env:
|
||||
- name: apiServerURL
|
||||
value: http://bfl.{{ .Release.Namespace }}:8080
|
||||
|
||||
# - name: wizard-server
|
||||
# image: aboveos/wizard-server:v0.4.2
|
||||
# imagePullPolicy: IfNotPresent
|
||||
# volumeMounts:
|
||||
# - name: userspace-dir
|
||||
# mountPath: /Home
|
||||
# ports:
|
||||
# - containerPort: 3000
|
||||
# env:
|
||||
# - name: OS_SYSTEM_SERVER
|
||||
# value: system-server.user-system-{{ .Values.bfl.username }}
|
||||
# - name: OS_APP_SECRET
|
||||
# value: '{{ .Values.os.desktop.appSecret }}'
|
||||
# - name: OS_APP_KEY
|
||||
# value: {{ .Values.os.desktop.appKey }}
|
||||
# - name: APP_SERVICE_SERVICE_HOST
|
||||
# value: app-service.os-system
|
||||
# - name: APP_SERVICE_SERVICE_PORT
|
||||
# value: '6755'
|
||||
|
||||
# - name: terminus-envoy-sidecar
|
||||
# image: bytetrade/envoy:v1.25.11
|
||||
# imagePullPolicy: IfNotPresent
|
||||
# securityContext:
|
||||
# allowPrivilegeEscalation: false
|
||||
# runAsUser: 1000
|
||||
# ports:
|
||||
# - name: proxy-admin
|
||||
# containerPort: 15000
|
||||
# - name: proxy-inbound
|
||||
# containerPort: 15003
|
||||
# volumeMounts:
|
||||
# - name: terminus-sidecar-config
|
||||
# readOnly: true
|
||||
# mountPath: /etc/envoy/envoy.yaml
|
||||
# subPath: envoy.yaml
|
||||
# command:
|
||||
# - /usr/local/bin/envoy
|
||||
# - --log-level
|
||||
# - debug
|
||||
# - -c
|
||||
# - /etc/envoy/envoy.yaml
|
||||
# env:
|
||||
# - name: POD_UID
|
||||
# valueFrom:
|
||||
# fieldRef:
|
||||
# fieldPath: metadata.uid
|
||||
# - name: POD_NAME
|
||||
# valueFrom:
|
||||
# fieldRef:
|
||||
# fieldPath: metadata.name
|
||||
# - name: POD_NAMESPACE
|
||||
# valueFrom:
|
||||
# fieldRef:
|
||||
# fieldPath: metadata.namespace
|
||||
# - name: POD_IP
|
||||
# valueFrom:
|
||||
# fieldRef:
|
||||
# fieldPath: status.podIP
|
||||
volumes:
|
||||
- name: userspace-dir
|
||||
hostPath:
|
||||
type: Directory
|
||||
path: "{{ .Values.userspace.userData }}"
|
||||
# - name: terminus-sidecar-config
|
||||
# configMap:
|
||||
# name: sidecar-configs
|
||||
# items:
|
||||
# - key: envoy.yaml
|
||||
# path: envoy.yaml
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
|
||||
@@ -34,5 +34,3 @@ os:
|
||||
appstore:
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: test
|
||||
kubesphere:
|
||||
redis_password: ""
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Olares Apps
|
||||
|
||||
## Overview
|
||||
|
||||
This directory contains the code for system applications, primarily for LarePass. The following are the pre-installed system applications that offer tools for managing files, knowledge, passwords, and the system itself.
|
||||
|
||||
## System Applications Overview
|
||||
|
||||
| Application | Description |
|
||||
| --- | --- |
|
||||
| Files | A file management app that manages and synchronizes files across devices and sources, enabling seamless sharing and access. |
|
||||
| Wise | A local-first and AI-native modern reader that helps to collect, read, and manage information from various platforms. Users can run self-hosted recommendation algorithms to filter and sort online content. |
|
||||
| Vault | A secure password manager for storing and managing sensitive information across devices. |
|
||||
| Market | A decentralized and permissionless app store for installing, uninstalling, and updating applications and recommendation algorithms. |
|
||||
| Desktop | A hub for managing and interacting with installed applications. File and application searching are also supported. |
|
||||
| Profile | An app to customize the user's profile page. |
|
||||
| Settings | A system configuration application. |
|
||||
| Dashboard | An app for monitoring system resource usage. |
|
||||
| Control Hub | The console for Olares, providing precise and autonomous control over the system and its environment. |
|
||||
| DevBox | A development tool for building and deploying Olares applications. |
|
||||
@@ -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
|
||||
|
||||
@@ -1003,7 +1003,7 @@ _get_sts_bfl() {
|
||||
|
||||
_get_deployment_backup_server() {
|
||||
local res
|
||||
res=$($sh_c "${KUBECTL} -n os-system get deployment backup-server 2>/dev/null")
|
||||
res=$($sh_c "${KUBECTL} -n os-framework get deployment backup 2>/dev/null")
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo 0
|
||||
fi
|
||||
|
||||
@@ -30,7 +30,7 @@ repaire_crd_terminus() {
|
||||
|
||||
if [ ! -z "${AWS_SESSION_TOKEN_SETUP}" ]; then
|
||||
patch='[{"op":"add","path":"/metadata/annotations/bytetrade.io~1s3-sts","value":"'"$AWS_SESSION_TOKEN_SETUP"'"},{"op":"add","path":"/metadata/annotations/bytetrade.io~1s3-ak","value":"'"$AWS_ACCESS_KEY_ID_SETUP"'"},{"op":"add","path":"/metadata/annotations/bytetrade.io~1s3-sk","value":"'"$AWS_SECRET_ACCESS_KEY_SETUP"'"},{"op":"add","path":"/metadata/annotations/bytetrade.io~1cluster-id","value":"'"$CLUSTER_ID"'"}]'
|
||||
$sh_c "${KUBECTL} patch terminus.sys.bytetrade.io terminus -n os-system --type='json' -p='$patch'"
|
||||
$sh_c "${KUBECTL} patch terminus.sys.bytetrade.io terminus --type='json' -p='$patch'"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -1,616 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
|
||||
|
||||
# Upgrading will be executed in app-service container based on kubesphere/kubectl:v1.22.9
|
||||
# By default, the tool packages will be installed via apt during the docker build
|
||||
|
||||
# env:
|
||||
# BASE_DIR
|
||||
|
||||
|
||||
function command_exists() {
|
||||
command -v "$@" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
function get_shell_exec(){
|
||||
user="$(id -un 2>/dev/null || true)"
|
||||
|
||||
sh_c='sh -c'
|
||||
if [ "$user" != 'root' ]; then
|
||||
if command_exists sudo && command_exists su; then
|
||||
sh_c='sudo su -c'
|
||||
else
|
||||
cat >&2 <<-'EOF'
|
||||
Error: this installer needs the ability to run commands as root.
|
||||
We are unable to find either "sudo" or "su" available to make this happen.
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function get_bfl_api_port(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get svc bfl -n user-space-${username} -o jsonpath='{.spec.ports[0].nodePort}'"
|
||||
}
|
||||
|
||||
# function get_docs_port(){
|
||||
# local username=$1
|
||||
# $sh_c "${KUBECTL} get svc swagger-ui -n user-space-${username} -o jsonpath='{.spec.ports[0].nodePort}'"
|
||||
# }
|
||||
|
||||
function get_desktop_port(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get svc edge-desktop -n user-space-${username} -o jsonpath='{.spec.ports[0].nodePort}'"
|
||||
}
|
||||
|
||||
function get_user_password(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get user ${username} -o jsonpath='{.spec.password}'"
|
||||
}
|
||||
|
||||
function get_user_email(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get user ${username} -o jsonpath='{.spec.email}'"
|
||||
}
|
||||
|
||||
|
||||
function ensure_success() {
|
||||
"$@"
|
||||
local ret=$?
|
||||
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "Fatal error, command: '$@'"
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
function validate_user(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get ns user-space-${username} > /dev/null"
|
||||
local ret=$?
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "no"
|
||||
else
|
||||
echo "yes"
|
||||
fi
|
||||
}
|
||||
|
||||
function get_bfl_node(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get pod -n user-space-${username} -l 'tier=bfl' -o jsonpath='{.items[*].spec.nodeName}'"
|
||||
}
|
||||
|
||||
function get_bfl_url() {
|
||||
local username=$1
|
||||
local user_bfl_port=$(get_bfl_api_port ${username})
|
||||
|
||||
bfl_ip=$(curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+")
|
||||
echo "http://$bfl_ip:${user_bfl_port}/bfl/apidocs.json"
|
||||
}
|
||||
|
||||
function get_userspace_dir(){
|
||||
local username=$1
|
||||
local space_dir=$2
|
||||
$sh_c "${KUBECTL} get pod -n user-space-${username} -l 'tier=bfl' -o \
|
||||
jsonpath='{range .items[0].spec.volumes[*]}{.name}{\" \"}{.persistentVolumeClaim.claimName}{\"\\n\"}{end}'" | \
|
||||
while read pvc; do
|
||||
local pvc_data=($pvc)
|
||||
if [ ${#pvc_data[@]} -gt 1 ]; then
|
||||
if [ "x${pvc_data[0]}" == "x${space_dir}" ]; then
|
||||
local USERSPACE_PVC="${pvc_data[1]}"
|
||||
local pv=$($sh_c "${KUBECTL} get pvc -n user-space-${username} ${pvc_data[1]} -o jsonpath='{.spec.volumeName}'")
|
||||
local pv_path=$($sh_c "${KUBECTL} get pv ${pv} -o jsonpath='{.spec.hostPath.path}'")
|
||||
local USERSPACE_PV_PATH="${pv_path}"
|
||||
|
||||
echo "${USERSPACE_PVC} ${USERSPACE_PV_PATH} ${pv}"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function get_bfl_rand16(){
|
||||
local username=$1
|
||||
local prefix=$2
|
||||
|
||||
$sh_c "${KUBECTL} get sts -n user-space-${username} bfl -o jsonpath='{.metadata.annotations.${prefix}_rand16}'"
|
||||
}
|
||||
|
||||
function gen_app_key_secret(){
|
||||
local app=$1
|
||||
local key="bytetrade_${app}_${RANDOM}"
|
||||
local t=$(date +%s)
|
||||
local secret=$(echo -n "${key}|${t}"|md5sum|cut -d" " -f1)
|
||||
|
||||
echo "${key} ${secret:0:16}"
|
||||
}
|
||||
|
||||
function get_app_key_secret(){
|
||||
local username=$1
|
||||
local app=$2
|
||||
|
||||
local ks=$($sh_c "${KUBECTL} get appperm ${app} -n user-system-${username} -o jsonpath='{.spec.key} {.spec.secret}'")
|
||||
|
||||
if [ "x${ks}" == "x" ]; then
|
||||
ks=$(gen_app_key_secret "${app}")
|
||||
fi
|
||||
|
||||
echo "${ks}"
|
||||
}
|
||||
|
||||
|
||||
function get_app_settings(){
|
||||
local username=$1
|
||||
local apps=("vault" "desktop" "message" "wise" "search" "appstore" "notification" "dashboard" "settings" "studio" "profile" "agent" "files")
|
||||
for a in ${apps[@]};do
|
||||
ks=($(get_app_key_secret "$username" "$a"))
|
||||
echo '
|
||||
'${a}':
|
||||
appKey: '${ks[0]}'
|
||||
appSecret: "'${ks[1]}'"
|
||||
'
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
function gen_bfl_values(){
|
||||
local username=$1
|
||||
local user_bfl_port=$(get_bfl_api_port ${username})
|
||||
|
||||
echo "Try to find the current bfl pv ..."
|
||||
local pvc_path=($(get_userspace_dir ${username} "userspace-dir"))
|
||||
local appcache_pvc_path=($(get_userspace_dir ${username} "appcache-dir"))
|
||||
local dbdata_pvc_path=($(get_userspace_dir ${username} "dbdata-dir"))
|
||||
|
||||
local userspace_rand16=$(get_userspace_dir ${username} "userspace")
|
||||
local appcache_rand16=$(get_userspace_dir ${username} "Cache")
|
||||
local dbdata_rand16=$(get_userspace_dir ${username} "dbdata")
|
||||
|
||||
echo '
|
||||
bfl:
|
||||
nodeport: '${user_bfl_port}'
|
||||
username: '${username}'
|
||||
|
||||
userspace_rand16: '${userspace_rand16}'
|
||||
userspace_pv: '${pvc_path[2]}'
|
||||
userspace_pvc: '${pvc_path[0]}'
|
||||
|
||||
appcache_rand16: '${appcache_rand16}'
|
||||
appcache_pv: '${appcache_pvc_path[2]}'
|
||||
appcache_pvc: '${appcache_pvc_path[0]}'
|
||||
|
||||
dbdata_rand16: '${dbdata_rand16}'
|
||||
dbdata_pv: '${dbdata_pvc_path[2]}'
|
||||
dbdata_pvc: '${dbdata_pvc_path[0]}'
|
||||
' > ${BASE_DIR}/wizard/config/launcher/values.yaml
|
||||
}
|
||||
|
||||
|
||||
function gen_settings_values(){
|
||||
local username=$1
|
||||
# local userpwd="$(get_user_password ${username})"
|
||||
# local useremail="$(get_user_email ${username})"
|
||||
|
||||
echo '
|
||||
namespace:
|
||||
name: user-space-'${username}'
|
||||
role: admin
|
||||
|
||||
user:
|
||||
name: '${username}'
|
||||
' > ${BASE_DIR}/wizard/config/settings/values.yaml
|
||||
}
|
||||
|
||||
function gen_app_values(){
|
||||
local username=$1
|
||||
|
||||
local bfl_node=$(get_bfl_node ${username})
|
||||
local bfl_doc_url=$(get_bfl_url ${username})
|
||||
local desktop_ports=$(get_desktop_port ${username})
|
||||
# local docs_ports=$(get_docs_port ${username})
|
||||
|
||||
echo "Try to find pv ..."
|
||||
local pvc_path=($(get_userspace_dir ${username} "userspace-dir"))
|
||||
local appcache_pvc_path=($(get_userspace_dir ${username} "appcache-dir"))
|
||||
local dbdata_pvc_path=($(get_userspace_dir ${username} "dbdata-dir"))
|
||||
|
||||
local app_perm_settings=$(get_app_settings ${username})
|
||||
cat ${BASE_DIR}/wizard/config/launcher/values.yaml > ${BASE_DIR}/wizard/config/apps/values.yaml
|
||||
cat << EOF >> ${BASE_DIR}/wizard/config/apps/values.yaml
|
||||
url: '${bfl_doc_url}'
|
||||
nodeName: ${bfl_node}
|
||||
pvc:
|
||||
userspace: ${pvc_path[0]}
|
||||
userspace:
|
||||
appCache: ${appcache_pvc_path[1]}
|
||||
dbdata: ${dbdata_pvc_path[1]}
|
||||
userData: ${pvc_path[1]}/Home
|
||||
appData: ${pvc_path[1]}/Data
|
||||
|
||||
desktop:
|
||||
nodeport: ${desktop_ports}
|
||||
os:
|
||||
${app_perm_settings}
|
||||
EOF
|
||||
}
|
||||
|
||||
function close_apps(){
|
||||
local username=$1
|
||||
local app_list=(
|
||||
"vault-deployment"
|
||||
)
|
||||
|
||||
|
||||
for app in ${app_list[@]} ; do
|
||||
$sh_c "${KUBECTL} scale deployment ${app} -n user-space-${username} --replicas=0"
|
||||
done
|
||||
}
|
||||
|
||||
repeat(){
|
||||
for i in $(seq 1 $1); do
|
||||
echo -n $2
|
||||
done
|
||||
}
|
||||
|
||||
function get_appservice_pod(){
|
||||
$sh_c "${KUBECTL} get pod -n os-system -l 'tier=app-service' -o jsonpath='{.items[*].metadata.name}'"
|
||||
}
|
||||
|
||||
function get_appservice_status(){
|
||||
$sh_c "${KUBECTL} get pod -n os-system -l 'tier=app-service' -o jsonpath='{.items[*].status.phase}'"
|
||||
}
|
||||
|
||||
function get_desktop_status(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get pod -n user-space-${username} -l 'app=edge-desktop' -o jsonpath='{.items[*].status.phase}'"
|
||||
}
|
||||
|
||||
function get_vault_status(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get pod -n user-space-${username} -l 'app=vault' -o jsonpath='{.items[*].status.phase}'"
|
||||
}
|
||||
|
||||
|
||||
function get_bfl_status(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get pod -n user-space-${username} -l 'tier=bfl' -o jsonpath='{.items[*].status.phase}'"
|
||||
}
|
||||
|
||||
function get_fileserver_status(){
|
||||
$sh_c "${KUBECTL} get pod -n os-system -l 'app=files' -o jsonpath='{.items[*].status.phase}'"
|
||||
}
|
||||
|
||||
function get_filefe_status(){
|
||||
local username=$1
|
||||
$sh_c "${KUBECTL} get pod -n user-space-${username} -l 'app=files' -o jsonpath='{.items[*].status.phase}'"
|
||||
}
|
||||
|
||||
function check_fileserver(){
|
||||
local status=$(get_fileserver_status)
|
||||
local n=0
|
||||
while [ "x${status}" != "xRunning" ]; do
|
||||
n=$(expr $n + 1)
|
||||
local dotn=$(($n % 10))
|
||||
local dot=$(repeat $dotn '>')
|
||||
|
||||
echo -ne "\rWaiting for file-server starting ${dot}"
|
||||
sleep 0.5
|
||||
|
||||
status=$(get_fileserver_status)
|
||||
echo -ne "\rWaiting for file-server starting "
|
||||
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
function check_appservice(){
|
||||
local status=$(get_appservice_status)
|
||||
local n=0
|
||||
while [ "x${status}" != "xRunning" ]; do
|
||||
n=$(expr $n + 1)
|
||||
local dotn=$(($n % 10))
|
||||
local dot=$(repeat $dotn '>')
|
||||
|
||||
echo -ne "\rWaiting for app-service starting ${dot}"
|
||||
sleep 0.5
|
||||
|
||||
status=$(get_appservice_status)
|
||||
echo -ne "\rWaiting for app-service starting "
|
||||
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
function check_filesfe(){
|
||||
local username=$1
|
||||
local status=$(get_filefe_status ${username})
|
||||
local n=0
|
||||
while [ "x${status}" != "xRunning" ]; do
|
||||
n=$(expr $n + 1)
|
||||
local dotn=$(($n % 10))
|
||||
local dot=$(repeat $dotn '>')
|
||||
|
||||
echo -ne "\rPlease waiting ${dot}"
|
||||
sleep 0.5
|
||||
|
||||
status=$(get_filefe_status ${username})
|
||||
echo -ne "\rPlease waiting "
|
||||
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
function check_bfl(){
|
||||
local username=$1
|
||||
local status=$(get_bfl_status ${username})
|
||||
local n=0
|
||||
while [ "x${status}" != "xRunning" ]; do
|
||||
n=$(expr $n + 1)
|
||||
local dotn=$(($n % 10))
|
||||
local dot=$(repeat $dotn '>')
|
||||
|
||||
echo -ne "\rPlease waiting ${dot}"
|
||||
sleep 0.5
|
||||
|
||||
status=$(get_bfl_status ${username})
|
||||
echo -ne "\rPlease waiting "
|
||||
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
function check_desktop(){
|
||||
local username=$1
|
||||
local status=$(get_desktop_status ${username})
|
||||
local n=0
|
||||
while [ "x${status}" != "xRunning" ]; do
|
||||
n=$(expr $n + 1)
|
||||
local dotn=$(($n % 10))
|
||||
local dot=$(repeat $dotn '>')
|
||||
|
||||
echo -ne "\rPlease waiting ${dot}"
|
||||
sleep 0.5
|
||||
|
||||
status=$(get_desktop_status ${username})
|
||||
echo -ne "\rPlease waiting "
|
||||
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
function check_vault(){
|
||||
local username=$1
|
||||
local status=$(get_vault_status ${username})
|
||||
local n=0
|
||||
while [ "x${status}" != "xRunning" ]; do
|
||||
n=$(expr $n + 1)
|
||||
local dotn=$(($n % 10))
|
||||
local dot=$(repeat $dotn '>')
|
||||
|
||||
echo -ne "\rPlease waiting ${dot}"
|
||||
sleep 0.5
|
||||
|
||||
status=$(get_vault_status ${username})
|
||||
echo -ne "\rPlease waiting "
|
||||
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
function check_all(){
|
||||
local pods=$@
|
||||
for p in ${pods[@]}; do
|
||||
local n=$(echo "${p}"|awk -F"@" '{print $1}')
|
||||
local ns=$(echo "${p}"|awk -F"@" '{print $2}')
|
||||
local s=$($sh_c "${KUBECTL} get pod -n ${ns} -l 'app=${n}' -o jsonpath='{.items[*].status.phase}'")
|
||||
echo -ne "\rPlease wait: ${p}"
|
||||
while [ "x${s}" != "xRunning" ];do
|
||||
echo -ne "\rPlease wait: ${p}"
|
||||
|
||||
s=$($sh_c "${KUBECTL} get pod -n ${ns} -l 'app=${n}' -o jsonpath='{.items[*].status.phase}'")
|
||||
done
|
||||
echo
|
||||
done
|
||||
}
|
||||
|
||||
function upgrade_ksapi(){
|
||||
local users=$@
|
||||
local current_version="beclab/ks-apiserver:v3.3.0-ext-3"
|
||||
local image=$($sh_c "${KUBECTL} get deploy ks-apiserver -n kubesphere-system -o jsonpath='{.spec.template.spec.containers[0].image}'")
|
||||
if [ "x${image}" != "x${current_version}" ]; then
|
||||
echo "upgrade ks-apiserver and restore token ..."
|
||||
|
||||
secret=$(echo -n "ks_redis_${RANDOM}"|md5sum|cut -d" " -f1)
|
||||
$sh_c "${KUBECTL} -n kubesphere-system create secret generic redis-secret --from-literal=auth=${secret:0:12}"
|
||||
|
||||
local old_jwt=$($sh_c "${KUBECTL} get configmap kubesphere-config -n kubesphere-system -o jsonpath='{.data.kubesphere\.yaml}'|grep jwtSecret|awk -F':' '{print \$2}'")
|
||||
sed -i -e "s/__jwtkey__/${old_jwt}/" ${BASE_DIR}/deploy/cm-kubesphere-config.yaml
|
||||
|
||||
$sh_c "${KUBECTL} apply -f ${BASE_DIR}/deploy/redis-deploy.yaml"
|
||||
$sh_c "${KUBECTL} apply -f ${BASE_DIR}/deploy/cm-kubesphere-config.yaml"
|
||||
check_all "redis@kubesphere-system"
|
||||
|
||||
$sh_c "${KUBECTL} -n kubesphere-system set image deployment/ks-apiserver ks-apiserver=beclab/ks-apiserver:v3.3.0-ext-3"
|
||||
$sh_c "${KUBECTL} patch deploy ks-apiserver -n kubesphere-system --patch-file=${BASE_DIR}/deploy/ks-apiserver-patch.yaml"
|
||||
|
||||
check_all "ks-apiserver@kubesphere-system"
|
||||
|
||||
for username in ${users[@]}; do
|
||||
$sh_c "${KUBECTL} rollout restart deploy authelia-backend -n user-system-${username}"
|
||||
|
||||
check_all "authelia-backend@user-system-${username}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
function upgrade_jfs(){
|
||||
local users=$@
|
||||
local JFS_VERSION="11.1.1"
|
||||
local current_jfs_version=$(/usr/local/bin/juicefs --version|awk '{print $3}'|awk -F'+' '{print $1}')
|
||||
|
||||
if [ "x${JFS_VERSION}" != "x${current_jfs_version}" ]; then
|
||||
echo "upgrade JuiceFS ..."
|
||||
local juicefs_bin="/usr/local/bin/juicefs"
|
||||
ensure_success $sh_c "curl ${CURL_TRY} -kLO https://github.com/beclab/juicefs-ext/releases/download/v${JFS_VERSION}/juicefs-v${JFS_VERSION}-linux-amd64.tar.gz"
|
||||
ensure_success $sh_c "tar -zxf juicefs-v${JFS_VERSION}-linux-amd64.tar.gz"
|
||||
ensure_success $sh_c "chmod +x juicefs"
|
||||
|
||||
ensure_success $sh_c "systemctl stop juicefs"
|
||||
ensure_success $sh_c "mv juicefs ${juicefs_bin}"
|
||||
ensure_success $sh_c "rm -f /tmp/JuiceFS-IPC.sock"
|
||||
ensure_success $sh_c "systemctl start juicefs"
|
||||
|
||||
echo "restart pods ... "
|
||||
|
||||
ensure_success $sh_c "${KUBECTL} rollout restart sts app-service -n os-system"
|
||||
|
||||
local tf=$(mktemp)
|
||||
ensure_success $sh_c "${KUBECTL} get deployment -A -o jsonpath='{range .items[*]}{.metadata.name} {.metadata.namespace} {.spec.template.spec.volumes}{\"\n\"}{end}' | grep '/olares/rootfs'" > $tf
|
||||
while read dep; do
|
||||
local depinfo=($dep)
|
||||
ensure_success $sh_c "${KUBECTL} rollout restart deployment ${depinfo[0]} -n ${depinfo[1]}"
|
||||
done < $tf
|
||||
|
||||
for user in ${users[@]}; do
|
||||
ensure_success $sh_c "${KUBECTL} rollout restart sts bfl -n user-space-${user}"
|
||||
done
|
||||
|
||||
sleep 10 # waiting for restarting to begin
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function upgrade_terminus(){
|
||||
HELM=$(command -v helm)
|
||||
KUBECTL=$(command -v kubectl)
|
||||
|
||||
# find sudo
|
||||
get_shell_exec
|
||||
|
||||
# fetch user list
|
||||
local users=()
|
||||
local admin_user=""
|
||||
local tf=$(mktemp)
|
||||
ensure_success $sh_c "${KUBECTL} get user -o jsonpath='{range .items[*]}{.metadata.name} {.metadata.annotations.bytetrade\.io\/owner-role}{\"\n\"}{end}'" > $tf
|
||||
while read userdata; do
|
||||
local userinfo=($userdata)
|
||||
local valid=$(validate_user "${userinfo[0]}")
|
||||
if [ "x-${valid}" == "x-yes" ]; then
|
||||
if [ "x-${userinfo[1]}" == "x-platform-admin" ]; then
|
||||
admin_user="${userinfo[0]}"
|
||||
fi
|
||||
|
||||
i=${#users[@]}
|
||||
users[$i]=${userinfo[0]}
|
||||
fi
|
||||
done < $tf
|
||||
|
||||
if [ "x${admin_user}" == "x" ]; then
|
||||
echo "Admin user not found. Upgrading failed." >&2
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# upgrade_jfs ${users[@]}
|
||||
local selfhosted=$($sh_c "${KUBECTL} get terminus terminus -o jsonpath='{.spec.settings.selfhosted}'")
|
||||
local domainname=$($sh_c "${KUBECTL} get terminus terminus -o jsonpath='{.spec.settings.domainName}'")
|
||||
sed -i "s/#__DOMAIN_NAME__/${domainname}/" ${BASE_DIR}/wizard/config/settings/templates/terminus_cr.yaml
|
||||
sed -i "s/#__SELFHOSTED__/${selfhosted}/" ${BASE_DIR}/wizard/config/settings/templates/terminus_cr.yaml
|
||||
|
||||
echo "Upgrading olares system components ... "
|
||||
gen_settings_values ${admin_user}
|
||||
ensure_success $sh_c "${HELM} upgrade -i settings ${BASE_DIR}/wizard/config/settings -n default --reuse-values"
|
||||
|
||||
# patch
|
||||
ensure_success $sh_c "${KUBECTL} apply -f ${BASE_DIR}/deploy/patch-globalrole-workspace-manager.yaml"
|
||||
# ensure_success $sh_c "$KUBECTL apply -f ${BASE_DIR}/deploy/patch-notification-manager.yaml"
|
||||
|
||||
# clear apps values.yaml
|
||||
cat /dev/null > ${BASE_DIR}/wizard/config/apps/values.yaml
|
||||
cat /dev/null > ${BASE_DIR}/wizard/config/launcher/values.yaml
|
||||
local appservice_pod=$(get_appservice_pod)
|
||||
local copy_charts=("launcher" "apps")
|
||||
for cc in ${copy_charts[@]}; do
|
||||
ensure_success $sh_c "${KUBECTL} cp ${BASE_DIR}/wizard/config/${cc} os-system/${appservice_pod}:/userapps"
|
||||
done
|
||||
|
||||
local ks_redis_pwd=$($sh_c "${KUBECTL} get secret -n kubesphere-system redis-secret -o jsonpath='{.data.auth}' |base64 -d")
|
||||
for user in ${users[@]}; do
|
||||
echo "Upgrading user ${user} ... "
|
||||
gen_bfl_values ${user}
|
||||
|
||||
# gen bfl app key and secret
|
||||
bfl_ks=($(get_app_key_secret ${user} "bfl"))
|
||||
|
||||
# install launcher , and init pv
|
||||
ensure_success $sh_c "${HELM} upgrade -i launcher-${user} ${BASE_DIR}/wizard/config/launcher -n user-space-${user} --set bfl.appKey=${bfl_ks[0]} --set bfl.appSecret=${bfl_ks[1]} -f ${BASE_DIR}/wizard/config/launcher/values.yaml --reuse-values"
|
||||
|
||||
gen_app_values ${user}
|
||||
close_apps ${user}
|
||||
|
||||
for appdir in "${BASE_DIR}/wizard/config/apps"/*/; do
|
||||
if [ -d "$appdir" ]; then
|
||||
releasename=$(basename "$appdir")
|
||||
|
||||
# ignore wizard
|
||||
# FIXME: unintitialized user's wizard should be upgrade
|
||||
if [ x"${releasename}" == x"wizard" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$user" != "$admin_user" ];then
|
||||
releasename=${releasename}-${user}
|
||||
fi
|
||||
ensure_success $sh_c "${HELM} upgrade -i ${releasename} ${appdir} -n user-space-${user} --reuse-values --set kubesphere.redis_password=${ks_redis_pwd} -f ${BASE_DIR}/wizard/config/apps/values.yaml"
|
||||
fi
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
# upgrade app service in the last. keep app service online longer
|
||||
local terminus_is_cloud_version=$($sh_c "${KUBECTL} get cm -n os-system backup-config -o jsonpath='{.data.terminus-is-cloud-version}'")
|
||||
local backup_cluster_bucket=$($sh_c "${KUBECTL} get cm -n os-system backup-config -o jsonpath='{.data.backup-cluster-bucket}'")
|
||||
local backup_key_prefix=$($sh_c "${KUBECTL} get cm -n os-system backup-config -o jsonpath='{.data.backup-key-prefix}'")
|
||||
local backup_secret=$($sh_c "${KUBECTL} get cm -n os-system backup-config -o jsonpath='{.data.backup-secret}'")
|
||||
local backup_server_data=$($sh_c "${KUBECTL} get cm -n os-system backup-config -o jsonpath='{.data.backup-server-data}'")
|
||||
|
||||
ensure_success $sh_c "${HELM} upgrade -i system ${BASE_DIR}/wizard/config/system -n os-system --reuse-values \
|
||||
--set kubesphere.redis_password=${ks_redis_pwd} --set backup.bucket=\"${backup_cluster_bucket}\" \
|
||||
--set backup.key_prefix=\"${backup_key_prefix}\" --set backup.is_cloud_version=\"${terminus_is_cloud_version}\" \
|
||||
--set backup.sync_secret=\"${backup_secret}\""
|
||||
|
||||
echo 'Waiting for App-Service ...'
|
||||
sleep 2 # wait for controller reconiling
|
||||
check_appservice
|
||||
echo
|
||||
|
||||
echo 'Waiting for Vault ...'
|
||||
check_vault ${admin_user}
|
||||
echo
|
||||
|
||||
echo 'Starting BFL ...'
|
||||
check_bfl ${admin_user}
|
||||
echo
|
||||
|
||||
echo 'Starting files ...'
|
||||
check_fileserver
|
||||
check_filesfe ${admin_user}
|
||||
echo
|
||||
|
||||
echo 'Starting Desktop ...'
|
||||
check_desktop ${admin_user}
|
||||
echo
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "Start to upgrade olares ... "
|
||||
|
||||
upgrade_terminus
|
||||
|
||||
echo -e "\e[91m Success to upgrade olares.\e[0m Open your new desktop in the browser and have fun !"
|
||||
@@ -1,2 +1,2 @@
|
||||
upgrade:
|
||||
minVersion: 1.12.0-1
|
||||
minVersion: 1.12.0-0
|
||||
|
||||
@@ -6,7 +6,7 @@ metadata:
|
||||
annotations:
|
||||
iam.kubesphere.io/uninitialized: "true"
|
||||
helm.sh/resource-policy: keep
|
||||
bytetrade.io/owner-role: platform-admin
|
||||
bytetrade.io/owner-role: owner
|
||||
bytetrade.io/terminus-name: "{{.Values.user.terminus_name}}"
|
||||
bytetrade.io/launcher-auth-policy: two_factor
|
||||
bytetrade.io/launcher-access-level: "1"
|
||||
@@ -23,4 +23,4 @@ spec:
|
||||
groups:
|
||||
- lldap_admin
|
||||
status:
|
||||
state: Active
|
||||
state: Created
|
||||
|
||||
@@ -5,7 +5,7 @@ metadata:
|
||||
spec:
|
||||
lldap:
|
||||
name: ldap
|
||||
url: "http://lldap-service.os-system:17170"
|
||||
url: "http://lldap-service.os-platform:17170"
|
||||
userBlacklist:
|
||||
- admin
|
||||
- terminus
|
||||
@@ -15,4 +15,4 @@ spec:
|
||||
credentialsSecret:
|
||||
kind: Secret
|
||||
name: lldap-credentials
|
||||
namespace: os-system
|
||||
namespace: os-platform
|
||||
|
||||
@@ -60,3 +60,29 @@ Create the name of the service account to use
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "opentelemetry-operator.fullname" -}}
|
||||
{{- "otel-opentelemetry-operator" }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "opentelemetry-operator.WebhookCert" -}}
|
||||
{{- $caCertEnc := "" }}
|
||||
{{- $certCrtEnc := "" }}
|
||||
{{- $certKeyEnc := "" }}
|
||||
{{- $prevSecret := (lookup "v1" "Secret" .Release.Namespace (printf "%s-controller-manager-service-cert" (include "opentelemetry-operator.fullname" .) )) }}
|
||||
{{- if $prevSecret }}
|
||||
{{- $certCrtEnc = index $prevSecret "data" "tls.crt" }}
|
||||
{{- $certKeyEnc = index $prevSecret "data" "tls.key" }}
|
||||
{{- $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 := 36500 }}
|
||||
{{- $ca := genCA "opentelemetry-operator-operator-ca" $tmpperioddays }}
|
||||
{{- $cert := genSignedCert (include "opentelemetry-operator.fullname" .) nil $altNames $tmpperioddays $ca }}
|
||||
{{- $certCrtEnc = b64enc $cert.Cert }}
|
||||
{{- $certKeyEnc = b64enc $cert.Key }}
|
||||
{{- $caCertEnc = b64enc $ca.Cert }}
|
||||
{{- end }}
|
||||
{{- $result := dict "crt" $certCrtEnc "key" $certKeyEnc "ca" $caCertEnc }}
|
||||
{{- $result | toYaml }}
|
||||
{{- end }}
|
||||
@@ -1,5 +1,3 @@
|
||||
kubesphere:
|
||||
redis_password: ""
|
||||
backup:
|
||||
bucket: "${BACKUP_CLUSTER_BUCKET}"
|
||||
key_prefix: "${BACKUP_KEY_PREFIX}"
|
||||
@@ -4,17 +4,31 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
namespace: os-system
|
||||
namespace: os-platform
|
||||
name: os-internal
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
namespace: os-framework
|
||||
name: os-internal
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
namespace: os-network
|
||||
name: os-network-internal
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: os-internal-rb
|
||||
name: os-platform:os-internal-rb
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
namespace: os-system
|
||||
namespace: os-platform
|
||||
name: os-internal
|
||||
roleRef:
|
||||
# kind: Role
|
||||
@@ -22,6 +36,36 @@ roleRef:
|
||||
name: cluster-admin
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: os-framework:os-internal-rb
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
namespace: os-framework
|
||||
name: os-internal
|
||||
roleRef:
|
||||
# kind: Role
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: os-network:os-network-rb
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
namespace: os-network
|
||||
name: os-network-internal
|
||||
roleRef:
|
||||
# kind: Role
|
||||
kind: ClusterRole
|
||||
name: l4-proxy-role
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
@@ -56,6 +100,20 @@ rules:
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- '*'
|
||||
resources:
|
||||
- 'clusterroles'
|
||||
- 'clusterrolebindings'
|
||||
- 'services'
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- '*'
|
||||
resources:
|
||||
@@ -63,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
|
||||
@@ -194,4 +269,30 @@ rules:
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- deletecollection
|
||||
- deletecollection
|
||||
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: l4-proxy-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- '*'
|
||||
resources:
|
||||
- users
|
||||
- applications
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: nonresourceurl-admin
|
||||
rules:
|
||||
- nonResourceURLs: ["*"]
|
||||
verbs: ["*"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
@@ -7,4 +7,26 @@ metadata:
|
||||
kubesphere.io/creator: '{{ .Values.user.name }}'
|
||||
labels:
|
||||
kubesphere.io/workspace: system-workspace
|
||||
name: os-system
|
||||
name: os-network
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
annotations:
|
||||
kubesphere.io/creator: '{{ .Values.user.name }}'
|
||||
labels:
|
||||
kubesphere.io/workspace: system-workspace
|
||||
name: os-platform
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
annotations:
|
||||
kubesphere.io/creator: '{{ .Values.user.name }}'
|
||||
labels:
|
||||
kubesphere.io/workspace: system-workspace
|
||||
name: os-framework
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -24,6 +24,7 @@ cp ${BASE_DIR}/.dependencies/components ${BASE_DIR}/.manifest/.
|
||||
cp ${BASE_DIR}/.dependencies/components ${BASE_DIR}/.manifest/.
|
||||
pushd ${BASE_DIR}.manifest
|
||||
bash ${BASE_DIR}/build-manifest.sh ${BASE_DIR}/../.manifest/installation.manifest
|
||||
python3 ${BASE_DIR}/build-manifest.py ${BASE_DIR}/../.manifest/installation.manifest
|
||||
popd
|
||||
|
||||
|
||||
|
||||
191
build/build-manifest.py
Normal file
191
build/build-manifest.py
Normal file
@@ -0,0 +1,191 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import os
|
||||
import requests
|
||||
import sys
|
||||
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"
|
||||
try:
|
||||
response = requests.get(url)
|
||||
response.raise_for_status()
|
||||
return response.text.split()[0]
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error getting checksum for {name} from {url}: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
def get_image_manifest(name):
|
||||
"""Downloads the image manifest for a given name."""
|
||||
url = f"{CDN_URL}/{name}.manifest.json"
|
||||
try:
|
||||
response = requests.get(url)
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error getting manifest for {name} from {url}: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
def main():
|
||||
"""Main function."""
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("manifest_file", help="The manifest file to write to.")
|
||||
args = parser.parse_args()
|
||||
|
||||
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 = {}
|
||||
|
||||
# Process components
|
||||
try:
|
||||
with open("components", "r") as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
|
||||
# Replace version
|
||||
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)
|
||||
|
||||
fields = line.split(",")
|
||||
if len(fields) < 5:
|
||||
print(f"Format error in components file: {line}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
filename, path, deps, _, fileid = fields[:5]
|
||||
print(f"Downloading file checksum for {filename}")
|
||||
|
||||
name = hashlib.md5(filename.encode()).hexdigest()
|
||||
url_amd64 = name
|
||||
url_arm64 = f"arm64/{name}"
|
||||
|
||||
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,
|
||||
"size": file_size_amd64,
|
||||
}
|
||||
|
||||
|
||||
manifest_arm64_data[filename] = {
|
||||
"type": "component",
|
||||
"path": path,
|
||||
"deps": deps,
|
||||
"url_arm64": url_arm64,
|
||||
"checksum_arm64": checksum_arm64,
|
||||
"fileid": fileid,
|
||||
"size": file_size_arm64,
|
||||
}
|
||||
|
||||
except FileNotFoundError:
|
||||
print("Error: 'components' file not found.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
# Process images
|
||||
path = "images"
|
||||
for deps_file in ["images.mf"]:
|
||||
try:
|
||||
with open(deps_file, "r") as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
|
||||
print(f"Downloading file checksum for {line}")
|
||||
name = hashlib.md5(line.encode()).hexdigest()
|
||||
url_amd64 = f"{name}.tar.gz"
|
||||
url_arm64 = f"arm64/{name}.tar.gz"
|
||||
|
||||
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}")
|
||||
|
||||
filename = f"{name}.tar.gz"
|
||||
manifest_amd64_data[filename] = {
|
||||
"type": "image",
|
||||
"path": path,
|
||||
"deps": deps_file,
|
||||
"url_amd64": url_amd64,
|
||||
"checksum_amd64": checksum_amd64,
|
||||
"fileid": line,
|
||||
"size": file_size_amd64,
|
||||
"manifest": image_manifest_amd64
|
||||
}
|
||||
|
||||
manifest_arm64_data[filename] = {
|
||||
"type": "image",
|
||||
"path": path,
|
||||
"deps": deps_file,
|
||||
"url_arm64": url_arm64,
|
||||
"checksum_arm64": checksum_arm64,
|
||||
"fileid": line,
|
||||
"size": file_size_arm64,
|
||||
"manifest": image_manifest_arm64
|
||||
}
|
||||
|
||||
|
||||
except FileNotFoundError:
|
||||
print(f"Warning: '{deps_file}' not found, skipping.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# Write the manifest file
|
||||
amd64_manifest_file = f"{manifest_file}.amd64"
|
||||
with open(amd64_manifest_file, "w") as mf:
|
||||
json.dump(manifest_amd64_data, mf, indent=2)
|
||||
|
||||
arm64_manifest_file = f"{manifest_file}.arm64"
|
||||
with open(arm64_manifest_file, "w") as mf:
|
||||
json.dump(manifest_arm64_data, mf, indent=2)
|
||||
|
||||
|
||||
# TODO: compress the manifest files
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -46,6 +46,16 @@ 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
|
||||
|
||||
path="images"
|
||||
for deps in "images.mf"; do
|
||||
while read line; do
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -16,6 +33,7 @@ rm -rf ${BASE_DIR}/../.dependencies
|
||||
set -e
|
||||
pushd ${BASE_DIR}/../.manifest
|
||||
bash ${BASE_DIR}/build-manifest.sh ${BASE_DIR}/../.manifest/installation.manifest
|
||||
python3 ${BASE_DIR}/build-manifest.py ${BASE_DIR}/../.manifest/installation.manifest
|
||||
popd
|
||||
|
||||
pushd $DIST_PATH
|
||||
@@ -42,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,3 +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}
|
||||
|
||||
200
build/get-manifest.py
Normal file
200
build/get-manifest.py
Normal file
@@ -0,0 +1,200 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import requests
|
||||
import json
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
import platform
|
||||
|
||||
def parse_image_name(image_name):
|
||||
"""
|
||||
Parses a full image name into registry, repository, and reference (tag/digest).
|
||||
Handles defaults for Docker Hub.
|
||||
"""
|
||||
# Default to 'latest' tag if no tag or digest is specified
|
||||
if ":" not in image_name and "@" not in image_name:
|
||||
image_name += ":latest"
|
||||
|
||||
# Split repository from reference (tag or digest)
|
||||
if "@" in image_name:
|
||||
repo_part, reference = image_name.rsplit("@", 1)
|
||||
else:
|
||||
repo_part, reference = image_name.rsplit(":", 1)
|
||||
|
||||
# Determine registry and repository
|
||||
if "/" not in repo_part:
|
||||
# This is an official Docker Hub image, e.g., "ubuntu"
|
||||
registry = "registry-1.docker.io"
|
||||
repository = f"library/{repo_part}"
|
||||
else:
|
||||
parts = repo_part.split("/")
|
||||
# If the first part looks like a domain name, it's the registry
|
||||
if "." in parts[0] or ":" in parts[0]:
|
||||
registry = parts[0]
|
||||
repository = "/".join(parts[1:])
|
||||
else:
|
||||
# A scoped Docker Hub image, e.g., "bitnami/nginx"
|
||||
registry = "registry-1.docker.io"
|
||||
repository = repo_part
|
||||
|
||||
return registry, repository, reference
|
||||
|
||||
def get_auth_token(registry, repository):
|
||||
"""
|
||||
Gets an authentication token from the registry's auth service.
|
||||
"""
|
||||
# First, probe the registry to get the auth challenge
|
||||
try:
|
||||
probe_url = f"https://{registry}/v2/"
|
||||
response = requests.get(probe_url, timeout=10)
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error: Could not connect to registry at {probe_url}. Details: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if response.status_code != 401:
|
||||
# Either public or something is wrong, we can try without a token
|
||||
return None
|
||||
|
||||
auth_header = response.headers.get("Www-Authenticate")
|
||||
if not auth_header:
|
||||
print(f"Error: Registry {registry} returned 401 but did not provide Www-Authenticate header.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
# Parse the Www-Authenticate header to find realm, service, and scope
|
||||
try:
|
||||
realm = re.search('realm="([^"]+)"', auth_header).group(1)
|
||||
service = re.search('service="([^"]+)"', auth_header).group(1)
|
||||
# Scope for the specific repository is needed
|
||||
scope = f"repository:{repository}:pull"
|
||||
except AttributeError:
|
||||
print(f"Error: Could not parse Www-Authenticate header: {auth_header}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
# Request the actual token from the auth realm
|
||||
auth_params = {
|
||||
"service": service,
|
||||
"scope": scope
|
||||
}
|
||||
|
||||
try:
|
||||
auth_response = requests.get(realm, params=auth_params, timeout=10)
|
||||
auth_response.raise_for_status()
|
||||
return auth_response.json().get("token")
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error: Failed to get auth token from {realm}. Details: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
except json.JSONDecodeError:
|
||||
print(f"Error: Failed to decode JSON response from auth server: {auth_response.text}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def get_manifest(registry, repository, reference, token):
|
||||
"""
|
||||
Fetches the image manifest from the registry.
|
||||
"""
|
||||
manifest_url = f"https://{registry}/v2/{repository}/manifests/{reference}"
|
||||
|
||||
headers = {
|
||||
# Request multiple manifest types, the registry will return the correct one
|
||||
"Accept": "application/vnd.oci.image.index.v1+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json"
|
||||
}
|
||||
|
||||
if token:
|
||||
headers["Authorization"] = f"Bearer {token}"
|
||||
|
||||
try:
|
||||
response = requests.get(manifest_url, headers=headers, timeout=10)
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
except requests.exceptions.HTTPError as e:
|
||||
if e.response.status_code == 401 and not token:
|
||||
print("Error: Received 401 Unauthorized. Attempting to get a token...", file=sys.stderr)
|
||||
# The initial probe might have passed, but manifest access requires auth.
|
||||
# We re-run the token acquisition logic.
|
||||
new_token = get_auth_token(registry, repository)
|
||||
if new_token:
|
||||
return get_manifest(registry, repository, reference, new_token)
|
||||
print(f"Error: Failed to fetch manifest from {manifest_url}. Status: {e.response.status_code}", file=sys.stderr)
|
||||
print(f"Response: {e.response.text}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error: A network error occurred. Details: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Fetch an OCI/Docker image manifest from a container registry.",
|
||||
epilog="""Examples:
|
||||
python get_manifest.py ubuntu:22.04
|
||||
python get_manifest.py quay.io/brancz/kube-rbac-proxy:v0.18.1 -o manifest.json
|
||||
python get_manifest.py gcr.io/google-containers/pause:3.9""",
|
||||
formatter_class=argparse.RawTextHelpFormatter
|
||||
)
|
||||
parser.add_argument("image_name", help="Full name of the container image (e.g., 'ubuntu:latest' or 'quay.io/prometheus/node-exporter:v1.7.0')")
|
||||
parser.add_argument("-o", "--output-file", help="Optional. Path to write the final manifest JSON to. If not provided, prints to stdout.")
|
||||
args = parser.parse_args()
|
||||
|
||||
registry, repository, reference = parse_image_name(args.image_name)
|
||||
|
||||
# Suppress informational prints if writing to a file
|
||||
verbose_print = print if not args.output_file else lambda *a, **k: None
|
||||
|
||||
verbose_print(f"Registry: {registry}")
|
||||
verbose_print(f"Repository: {repository}")
|
||||
verbose_print(f"Reference: {reference}", end='\n\n', flush=True)
|
||||
|
||||
token = get_auth_token(registry, repository)
|
||||
|
||||
if not token and not args.output_file:
|
||||
print("No authentication token needed or could be retrieved. Proceeding without token...", file=sys.stderr)
|
||||
|
||||
manifest = get_manifest(registry, repository, reference, token)
|
||||
final_manifest = None
|
||||
|
||||
media_type = manifest.get("mediaType", "")
|
||||
if "manifest.list" in media_type or "image.index" in media_type:
|
||||
verbose_print("Detected a multi-platform image index. Finding manifest for current architecture...")
|
||||
|
||||
system_arch = platform.machine()
|
||||
arch_map = {"x86_64": "amd64", "aarch64": "arm64"}
|
||||
target_arch = arch_map.get(system_arch, system_arch)
|
||||
|
||||
verbose_print(f"System architecture: {system_arch} -> Target: linux/{target_arch}")
|
||||
|
||||
target_digest = None
|
||||
for m in manifest.get("manifests", []):
|
||||
plat = m.get("platform", {})
|
||||
if plat.get("os") == "linux" and plat.get("architecture") == target_arch:
|
||||
target_digest = m.get("digest")
|
||||
break
|
||||
|
||||
if target_digest:
|
||||
verbose_print(f"Found manifest for linux/{target_arch} with digest: {target_digest}\n")
|
||||
final_manifest = get_manifest(registry, repository, target_digest, token)
|
||||
else:
|
||||
print(f"Error: Could not find a manifest for 'linux/{target_arch}' in the index.", file=sys.stderr)
|
||||
if not args.output_file:
|
||||
print("Available platforms:", file=sys.stderr)
|
||||
for m in manifest.get("manifests", []):
|
||||
print(f" - {m.get('platform', {}).get('os')}/{m.get('platform', {}).get('architecture')}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
else:
|
||||
final_manifest = manifest
|
||||
|
||||
if final_manifest:
|
||||
if args.output_file:
|
||||
try:
|
||||
with open(args.output_file, 'w') as f:
|
||||
json.dump(final_manifest, f, indent=2)
|
||||
print(f"Successfully wrote manifest to {args.output_file}")
|
||||
except IOError as e:
|
||||
print(f"Error: Could not write to file {args.output_file}. Details: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print(json.dumps(final_manifest, indent=2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -21,19 +21,26 @@ if [ ! -d ${DIST} ]; then
|
||||
mkdir -p ${DIST}
|
||||
cp -rf ${BUILD_TEMPLATE}/* ${DIST}/.
|
||||
cp -rf ${BUILD_TEMPLATE}/.env ${DIST}/.
|
||||
cp -rf ${BUILD_TEMPLATE}/wizard/config/os-chart-template ${DIST}/wizard/config/os-framework
|
||||
cp -rf ${BUILD_TEMPLATE}/wizard/config/os-chart-template ${DIST}/wizard/config/os-platform
|
||||
rm -rf ${DIST}/wizard/config/os-chart-template
|
||||
fi
|
||||
|
||||
APP_DIST=${DIST}/wizard/config/apps
|
||||
SYSTEM_DIST=${DIST}/wizard/config/system/templates
|
||||
SETTINGS_DIST=${DIST}/wizard/config/settings/templates
|
||||
CRD_DIST=${SETTINGS_DIST}/crds
|
||||
DEPLOY_DIST=${SYSTEM_DIST}/deploy
|
||||
mkdir -p ${APP_DIST}
|
||||
mkdir -p ${CRD_DIST}
|
||||
mkdir -p ${DEPLOY_DIST}
|
||||
|
||||
for mod in "${PACKAGE_MODULE[@]}";do
|
||||
echo "packaging ${mod} ..."
|
||||
SYSTEM_DIST=${DIST}/wizard/config/os-framework/templates
|
||||
if [ ${mod} == "platform" ]; then
|
||||
SYSTEM_DIST=${DIST}/wizard/config/os-platform/templates
|
||||
fi
|
||||
DEPLOY_DIST=${SYSTEM_DIST}/deploy
|
||||
mkdir -p ${DEPLOY_DIST}
|
||||
|
||||
find ${mod} -type d -name .olares | while read app; do
|
||||
|
||||
# package user app charts to install wizard
|
||||
@@ -67,6 +74,6 @@ echo "packaging launcher ..."
|
||||
run_cmd "cp -rf framework/bfl/.olares/config/launcher ${DIST}/wizard/config/"
|
||||
|
||||
echo "packaging gpu ..."
|
||||
run_cmd "cp -rf framework/gpu/.olares/config/gpu ${DIST}/wizard/config/"
|
||||
run_cmd "cp -rf infrastructure/gpu/.olares/config/gpu ${DIST}/wizard/config/"
|
||||
|
||||
echo "packaging completed"
|
||||
@@ -23,26 +23,28 @@ while read line; do
|
||||
continue
|
||||
fi
|
||||
|
||||
bash ${BASE_DIR}/download-deps.sh $PLATFORM $line
|
||||
if [ $? -ne 0 ]; then
|
||||
exit -1
|
||||
fi
|
||||
|
||||
filename=$(echo "$line"|awk -F"," '{print $1}')
|
||||
echo "if exists $filename ... "
|
||||
name=$(echo -n "$filename"|md5sum|awk '{print $1}')
|
||||
checksum="$name.checksum.txt"
|
||||
md5sum $name > $checksum
|
||||
backup_file=$(awk '{print $1}' $checksum)
|
||||
if [ x"$backup_file" == x"" ]; then
|
||||
echo "invalid checksum"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "if exists $filename ... "
|
||||
curl -fsSLI https://dc3p1870nn3cj.cloudfront.net/$path$name > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://dc3p1870nn3cj.cloudfront.net/$path$name.tar.gz)
|
||||
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://dc3p1870nn3cj.cloudfront.net/$path$name)
|
||||
if [ $code -eq 403 ]; then
|
||||
|
||||
bash ${BASE_DIR}/download-deps.sh $PLATFORM $line
|
||||
if [ $? -ne 0 ]; then
|
||||
exit -1
|
||||
fi
|
||||
|
||||
md5sum $name > $checksum
|
||||
backup_file=$(awk '{print $1}' $checksum)
|
||||
if [ x"$backup_file" == x"" ]; then
|
||||
echo "invalid checksum"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -ex
|
||||
aws s3 cp $name s3://terminus-os-install/$path$name --acl=public-read
|
||||
aws s3 cp $name s3://terminus-os-install/backup/$path$backup_file --acl=public-read
|
||||
|
||||
@@ -10,14 +10,14 @@ cat $1|while read image; do
|
||||
echo "if exists $image ... "
|
||||
name=$(echo -n "$image"|md5sum|awk '{print $1}')
|
||||
checksum="$name.checksum.txt"
|
||||
manifest="$name.manifest.json"
|
||||
|
||||
curl -fsSLI https://dc3p1870nn3cj.cloudfront.net/$path$name.tar.gz > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
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
|
||||
@@ -50,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
|
||||
@@ -68,48 +67,29 @@ cat $1|while read image; do
|
||||
set +ex
|
||||
else
|
||||
if [ $code -ne 200 ]; then
|
||||
echo "failed to check image"
|
||||
echo "failed to check image checksum"
|
||||
exit -1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# upload to tencent cloud cos
|
||||
|
||||
# curl -fsSLI https://cdn.joinolares.cn/$path$name.tar.gz > /dev/null
|
||||
# if [ $? -ne 0 ]; then
|
||||
# set -e
|
||||
# docker pull $image
|
||||
# docker save $image -o $name.tar
|
||||
# gzip $name.tar
|
||||
|
||||
# md5sum $name.tar.gz > $checksum
|
||||
|
||||
# coscmd upload ./$name.tar.gz /$path$name.tar.gz
|
||||
# coscmd upload ./$checksum /$path$checksum
|
||||
# echo "upload $name to cos completed"
|
||||
|
||||
# set +e
|
||||
# fi
|
||||
|
||||
|
||||
|
||||
# # re-upload checksum.txt
|
||||
# curl -fsSLI https://cdn.joinolares.cn/$path$checksum > /dev/null
|
||||
# if [ $? -ne 0 ]; then
|
||||
# set -e
|
||||
# docker pull $image
|
||||
# docker save $image -o $name.tar
|
||||
# gzip $name.tar
|
||||
|
||||
# md5sum $name.tar.gz > $checksum
|
||||
|
||||
# coscmd upload ./$name.tar.gz /$path$name.tar.gz
|
||||
# coscmd upload ./$checksum /$path$checksum
|
||||
# echo "upload $name to cos completed"
|
||||
|
||||
# set +e
|
||||
# fi
|
||||
|
||||
# upload manifest.json
|
||||
curl -fsSLI https://dc3p1870nn3cj.cloudfront.net/$path$manifest > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://dc3p1870nn3cj.cloudfront.net/$path$manifest)
|
||||
if [ $code -eq 403 ]; then
|
||||
set -ex
|
||||
BASE_DIR=$(dirname $(realpath -s $0))
|
||||
python3 $BASE_DIR/get-manifest.py $image -o $manifest
|
||||
|
||||
aws s3 cp $manifest s3://terminus-os-install/$path$manifest --acl=public-read
|
||||
echo "upload $name manifest completed"
|
||||
set +ex
|
||||
else
|
||||
if [ $code -ne 200 ]; then
|
||||
echo "failed to check image manifest"
|
||||
exit -1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -15,24 +15,37 @@ builds:
|
||||
goarm:
|
||||
- 7
|
||||
ignore:
|
||||
- goos: linux
|
||||
goarch: arm64
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
- goos: darwin
|
||||
goarch: amd64
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
ldflags:
|
||||
- -s
|
||||
- -w
|
||||
- -X bytetrade.io/web3os/installer/version.VERSION={{ .Version }}
|
||||
- -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 }}"
|
||||
replacements:
|
||||
linux: linux
|
||||
amd64: amd64
|
||||
arm: arm64
|
||||
- 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 +1,92 @@
|
||||
# installer
|
||||
# Olares CLI
|
||||
|
||||
This directory contains the code for **olares-cli**, the official command-line interface for administering an **Olares** cluster. It provides a modular, pipeline-based architecture for orchestrating complex system operations. See the full [Olares CLI Documentation](https://docs.olares.com/developer/install/cli-1.12/olares-cli.html) for command reference and tutorials.
|
||||
|
||||
Key responsibilities include:
|
||||
- **Cluster management**: Installing, upgrading, restarting, and maintaining an Olares cluster.
|
||||
- **Node management**: Adding to or removing nodes from an Olares cluster.
|
||||
|
||||
|
||||
## Execution Model
|
||||
|
||||
For most of the commands, `olares-cli` is executed through a four-tier hierarchy:
|
||||
|
||||
```
|
||||
Pipeline ➜ Module ➜ Task ➜ Action
|
||||
````
|
||||
|
||||
### Example: `install-olares` Pipeline
|
||||
|
||||
```text
|
||||
Pipeline: Install Olares
|
||||
├── ...other modules
|
||||
└── Module: Bootstrap OS
|
||||
├── ...other tasks
|
||||
├── Task: Check Prerequisites
|
||||
│ └── Action: run-precheck.sh
|
||||
└── Task: Configure System
|
||||
└── Action: apply-sysctl
|
||||
````
|
||||
|
||||
|
||||
## Repository layout
|
||||
|
||||
```text
|
||||
cli/
|
||||
├── cmd/ # Cobra command definitions
|
||||
│ ├── main.go # CLI entry point
|
||||
│ └── ctl/
|
||||
│ ├── root.go
|
||||
│ ├── os/ # OS-level maintenance commands
|
||||
│ ├── node/ # Cluster node operations
|
||||
│ └── gpu/ # GPU management
|
||||
└── pkg/
|
||||
├── core/
|
||||
│ ├── action/ # Re-usable action primitives
|
||||
│ ├── module/ # Module abstractions
|
||||
│ ├── pipeline/ # Pipeline abstractions
|
||||
│ └── task/ # Task abstractions
|
||||
└── pipelines/ # Pre-built pipelines
|
||||
│ ├── ... # actual modules and tasks for various commands and components
|
||||
```
|
||||
|
||||
|
||||
## Build from source
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* **Go 1.24+**
|
||||
* **GoReleaser** (optional, for cross-compiling and packaging)
|
||||
|
||||
### Sample commands
|
||||
|
||||
```bash
|
||||
# Clone the repo and enter the CLI folder
|
||||
cd cli
|
||||
|
||||
# 1) Build for the host OS/ARCH
|
||||
go build -o olares-cli ./cmd/main.go
|
||||
|
||||
# 2) Cross-compile for Linux amd64 (from macOS, for example)
|
||||
GOOS=linux GOARCH=amd64 go build -o olares-cli ./cmd/main.go
|
||||
|
||||
# 3) Produce multi-platform artifacts (tar.gz, checksums, etc.)
|
||||
goreleaser release --snapshot --clean
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Development workflow
|
||||
|
||||
### Add a new command
|
||||
|
||||
1. Create the command file in `cmd/ctl/<category>/`.
|
||||
2. Define a pipeline in `pkg/pipelines/`.
|
||||
3. Implement modules & tasks inside the relevant `pkg/` sub-packages.
|
||||
|
||||
|
||||
### Test your build
|
||||
|
||||
1. Upload the self-built `olares-cli` binary to a machine that's running Olares.
|
||||
2. Replace the existing `olares-cli` binary on the machine using `sudo cp -f olares-cli /usr/local/bin`.
|
||||
3. Execute arbitrary commands using `olares-cli`
|
||||
|
||||
@@ -22,8 +22,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"bytetrade.io/web3os/installer/pkg/core/logger"
|
||||
"bytetrade.io/web3os/installer/pkg/core/util"
|
||||
"github.com/beclab/Olares/cli/pkg/core/logger"
|
||||
"github.com/beclab/Olares/cli/pkg/core/util"
|
||||
"github.com/pkg/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"bytetrade.io/web3os/installer/pkg/core/util"
|
||||
"github.com/beclab/Olares/cli/pkg/core/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -22,9 +22,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"bytetrade.io/web3os/installer/pkg/core/connector"
|
||||
"bytetrade.io/web3os/installer/pkg/core/logger"
|
||||
"bytetrade.io/web3os/installer/pkg/core/util"
|
||||
"github.com/beclab/Olares/cli/pkg/core/connector"
|
||||
"github.com/beclab/Olares/cli/pkg/core/logger"
|
||||
"github.com/beclab/Olares/cli/pkg/core/util"
|
||||
"github.com/pkg/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"bytetrade.io/web3os/installer/pkg/core/util"
|
||||
"github.com/beclab/Olares/cli/pkg/core/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -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 "bytetrade.io/web3os/installer/clients/clientset/versioned/typed/kubekey/v1alpha1"
|
||||
kubekeyv1alpha2 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/clients/clientset/versioned"
|
||||
kubekeyv1alpha1 "bytetrade.io/web3os/installer/clients/clientset/versioned/typed/kubekey/v1alpha1"
|
||||
fakekubekeyv1alpha1 "bytetrade.io/web3os/installer/clients/clientset/versioned/typed/kubekey/v1alpha1/fake"
|
||||
kubekeyv1alpha2 "bytetrade.io/web3os/installer/clients/clientset/versioned/typed/kubekey/v1alpha2"
|
||||
fakekubekeyv1alpha2 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha1"
|
||||
kubekeyv1alpha2 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha1"
|
||||
kubekeyv1alpha2 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha1"
|
||||
scheme "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha1"
|
||||
"bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha2"
|
||||
scheme "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha2"
|
||||
"bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/clients/clientset/versioned"
|
||||
internalinterfaces "bytetrade.io/web3os/installer/clients/informers/externalversions/internalinterfaces"
|
||||
kubekey "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha1"
|
||||
v1alpha2 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/clients/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "bytetrade.io/web3os/installer/clients/informers/externalversions/kubekey/v1alpha1"
|
||||
v1alpha2 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha1"
|
||||
versioned "bytetrade.io/web3os/installer/clients/clientset/versioned"
|
||||
internalinterfaces "bytetrade.io/web3os/installer/clients/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/apis/kubekey/v1alpha2"
|
||||
versioned "bytetrade.io/web3os/installer/clients/clientset/versioned"
|
||||
internalinterfaces "bytetrade.io/web3os/installer/clients/informers/externalversions/internalinterfaces"
|
||||
v1alpha2 "bytetrade.io/web3os/installer/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 "bytetrade.io/web3os/installer/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}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user