Compare commits
229
Commits
v1.19.0-rc2
...
v1.22.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82e1ff76a5 | ||
|
|
e7cfb06afa | ||
|
|
d9d9d226d3 | ||
|
|
bcd1872ffa | ||
|
|
0bd3a5957b | ||
|
|
a450dfebc7 | ||
|
|
5f90095470 | ||
|
|
eb865e137f | ||
|
|
b7819fda76 | ||
|
|
0e2883d0c6 | ||
|
|
a8322b5ed2 | ||
|
|
43dc34ee8f | ||
|
|
0300051e7c | ||
|
|
b8cb98510f | ||
|
|
20e0f6af45 | ||
|
|
50b061527e | ||
|
|
22b30cf92f | ||
|
|
e0c7a80fe0 | ||
|
|
87cfb2fb20 | ||
|
|
ebdce4c0ed | ||
|
|
4ebdb077b5 | ||
|
|
2eb14db055 | ||
|
|
776dec14b7 | ||
|
|
320b1dd5a9 | ||
|
|
a6ecd0496f | ||
|
|
7f3a003200 | ||
|
|
8b1f0ba0b9 | ||
|
|
84631f03c5 | ||
|
|
e506ba2326 | ||
|
|
c5171cf014 | ||
|
|
757b84f952 | ||
|
|
0e89f8af41 | ||
|
|
7403598df9 | ||
|
|
322d3a21b0 | ||
|
|
aa9a2142b8 | ||
|
|
ed64644d10 | ||
|
|
45d6132ffd | ||
|
|
b26e28e733 | ||
|
|
2b13af0a5e | ||
|
|
6cc6498844 | ||
|
|
313ceef1ed | ||
|
|
9e275e7ced | ||
|
|
3ee30cf4f1 | ||
|
|
0ea24b399d | ||
|
|
aea8e0a470 | ||
|
|
ba13d1fd79 | ||
|
|
8ec6f313a4 | ||
|
|
0b4b78ff21 | ||
|
|
52f0b47273 | ||
|
|
df4a121d77 | ||
|
|
f839142530 | ||
|
|
b58525263e | ||
|
|
46c99e382f | ||
|
|
268fee7f94 | ||
|
|
caffed92f4 | ||
|
|
2fd44174ce | ||
|
|
7119380716 | ||
|
|
5eed09a8fc | ||
|
|
3e253c2ee4 | ||
|
|
8d70da4d8e | ||
|
|
2853498a98 | ||
|
|
b6bd921ac1 | ||
|
|
5d97ea7762 | ||
|
|
fb60a14ecc | ||
|
|
38ec6528e3 | ||
|
|
7d7f532c46 | ||
|
|
14e829f6a4 | ||
|
|
703613a475 | ||
|
|
0bbb5c5f38 | ||
|
|
d8aa5b7374 | ||
|
|
f44983f02a | ||
|
|
9f0bb6d11f | ||
|
|
a8157e94a9 | ||
|
|
cd23fc6f63 | ||
|
|
40678800e6 | ||
|
|
6acb59f979 | ||
|
|
4bce904c96 | ||
|
|
54b67b5171 | ||
|
|
96b07bf9a8 | ||
|
|
b156625997 | ||
|
|
6cf15f6cec | ||
|
|
3f0e4f5e81 | ||
|
|
1358aa2a81 | ||
|
|
f0aaef203e | ||
|
|
77d24fc544 | ||
|
|
a083ba3de5 | ||
|
|
6a50eac9eb | ||
|
|
b954eedff7 | ||
|
|
0247627494 | ||
|
|
158c40a7af | ||
|
|
699011e18e | ||
|
|
e7dc87843a | ||
|
|
e67c3b7945 | ||
|
|
36ed2e44aa | ||
|
|
38779b9318 | ||
|
|
7058130c3b | ||
|
|
9644477d08 | ||
|
|
87cac28cad | ||
|
|
238cfd854b | ||
|
|
f7cc0ac32d | ||
|
|
d8108c6742 | ||
|
|
d5eafded1a | ||
|
|
48e8acedfb | ||
|
|
11a2fdbdab | ||
|
|
0aa1a12cdc | ||
|
|
f37c5ee102 | ||
|
|
59267e3a6b | ||
|
|
82c0fbaeda | ||
|
|
2d70c9d65f | ||
|
|
c43f6fe9c0 | ||
|
|
36f318186b | ||
|
|
fe7f1b07c9 | ||
|
|
352090d092 | ||
|
|
db2b0ad4a0 | ||
|
|
4b76ec9057 | ||
|
|
15857b02d9 | ||
|
|
9bdac9a334 | ||
|
|
2f8ad16639 | ||
|
|
687a84a2d6 | ||
|
|
2db9db0b38 | ||
|
|
2bf00025ed | ||
|
|
b8f746cb98 | ||
|
|
93869d3bc8 | ||
|
|
5d580e01aa | ||
|
|
1f41de9991 | ||
|
|
5cdecefc49 | ||
|
|
21bccdaecf | ||
|
|
cf55fbecea | ||
|
|
b80437b78c | ||
|
|
11baffc92c | ||
|
|
ce49eb3e18 | ||
|
|
bf19e2fae2 | ||
|
|
26f964886e | ||
|
|
cb3a765495 | ||
|
|
7203cbf846 | ||
|
|
0b9d4c6f5a | ||
|
|
c6beb29f5a | ||
|
|
13abb2e905 | ||
|
|
54db275dc2 | ||
|
|
0159802497 | ||
|
|
90d781ca2d | ||
|
|
1732d9f4b0 | ||
|
|
8de5a5b0f3 | ||
|
|
35276a503b | ||
|
|
c6c811ea76 | ||
|
|
f2baa17131 | ||
|
|
a34840b0a7 | ||
|
|
06b52e3631 | ||
|
|
19858521fd | ||
|
|
4c4b574d07 | ||
|
|
9b978cf2fd | ||
|
|
ef05e242e4 | ||
|
|
156c1ac2e6 | ||
|
|
ade2daa013 | ||
|
|
6a84cee1d8 | ||
|
|
b95e317a20 | ||
|
|
0cfe08df55 | ||
|
|
4e0643eed7 | ||
|
|
103c7d57e4 | ||
|
|
c6d01827b0 | ||
|
|
d8fe37e736 | ||
|
|
c126298db4 | ||
|
|
f7e9e71ee1 | ||
|
|
3e43c07e5a | ||
|
|
932be4eb38 | ||
|
|
8bfe2d0ed1 | ||
|
|
9cea0d2b32 | ||
|
|
5337dbfd0b | ||
|
|
08c662bc11 | ||
|
|
241983d2f7 | ||
|
|
63864a91f2 | ||
|
|
579d46cc1b | ||
|
|
dcecb10e6c | ||
|
|
6144c58a44 | ||
|
|
7e8d5dd7ef | ||
|
|
796c7a48e8 | ||
|
|
b0e4440328 | ||
|
|
b801c77432 | ||
|
|
82b2848eb7 | ||
|
|
0c1b03b862 | ||
|
|
0c8573467b | ||
|
|
12f8017d9b | ||
|
|
29b0cf24ac | ||
|
|
d4aba532f3 | ||
|
|
9b57f1f2e7 | ||
|
|
1fe13624f2 | ||
|
|
fdecc98775 | ||
|
|
10852c90a5 | ||
|
|
62f729727a | ||
|
|
95faf60959 | ||
|
|
17fbe42fcc | ||
|
|
f44174debc | ||
|
|
efeb6951dc | ||
|
|
b85ba9e419 | ||
|
|
d23ed572f9 | ||
|
|
e7d6381876 | ||
|
|
57b537f09e | ||
|
|
2e4825def0 | ||
|
|
3fabf64b3c | ||
|
|
2a40b4538c | ||
|
|
27132975c4 | ||
|
|
b099db38d7 | ||
|
|
88039cad63 | ||
|
|
267f7faf18 | ||
|
|
2223081c80 | ||
|
|
2eb2eba88c | ||
|
|
8a17d391c5 | ||
|
|
15e16fcc82 | ||
|
|
7137b39a14 | ||
|
|
fc97b7609b | ||
|
|
c6329ee3db | ||
|
|
7b21fbc199 | ||
|
|
703d757c29 | ||
|
|
c09319ceb3 | ||
|
|
3762ff80f2 | ||
|
|
b43b31884a | ||
|
|
56b49dcee8 | ||
|
|
657aee7cc2 | ||
|
|
44922bce6c | ||
|
|
3bcda55aa8 | ||
|
|
997493351a | ||
|
|
3d77077bc5 | ||
|
|
f955d1182a | ||
|
|
1cbc0ba9ff | ||
|
|
0936c6a2d7 | ||
|
|
f0ec328d24 | ||
|
|
2b1ac28300 | ||
|
|
0fb2096788 | ||
|
|
6e375629e7 |
+3
-5
@@ -1,11 +1,9 @@
|
|||||||
ignore:
|
ignore:
|
||||||
- "charts"
|
- "charts"
|
||||||
- "demos"
|
- "test/"
|
||||||
- "Documentation"
|
|
||||||
- "examples"
|
|
||||||
- "test"
|
|
||||||
- "tools"
|
- "tools"
|
||||||
- "pkg/apis/genclient"
|
- "pkg/generated" # generated code
|
||||||
|
- "pkg/apis/*/*/zz_generated*" # generated code
|
||||||
coverage:
|
coverage:
|
||||||
status:
|
status:
|
||||||
project:
|
project:
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
groups:
|
||||||
|
github-actions:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directories:
|
||||||
|
- /cmd/builder
|
||||||
|
- /cmd/fetcher
|
||||||
|
- /cmd/fission-bundle
|
||||||
|
- /cmd/preupgradechecks
|
||||||
|
- /cmd/reporter
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
exclude-paths:
|
||||||
|
- "test/**"
|
||||||
|
groups:
|
||||||
|
docker-images:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
- package-ecosystem: gomod
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
exclude-paths:
|
||||||
|
- "test/**"
|
||||||
|
groups:
|
||||||
|
go-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
- package-ecosystem: helm
|
||||||
|
directory: /charts/fission-all
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
groups:
|
||||||
|
helm-charts:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
exclude-paths:
|
||||||
|
- "test/**"
|
||||||
|
groups:
|
||||||
|
npm-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
@@ -4,39 +4,47 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
- '!dependabot/**'
|
||||||
- '**.go'
|
|
||||||
- go.mod
|
|
||||||
- go.sum
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
|
||||||
- '**.go'
|
|
||||||
- go.mod
|
|
||||||
- go.sum
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * 0"
|
- cron: "0 0 * * 0"
|
||||||
workflow_dispatch:
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-codeql-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
CodeQL-Build:
|
CodeQL-Build:
|
||||||
runs-on: ubuntu-latest
|
permissions:
|
||||||
|
actions: read # for github/codeql-action/init to get workflow details
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
security-events: write # for github/codeql-action/analyze to upload SARIF results
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: setup go
|
- name: setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
|
||||||
with:
|
with:
|
||||||
languages: go
|
languages: go
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Dependency Review Action
|
||||||
|
#
|
||||||
|
# This Action will scan dependency manifest files that change as part of a Pull Request,
|
||||||
|
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
|
||||||
|
# Once installed, if the workflow run is marked as required,
|
||||||
|
# PRs introducing known-vulnerable packages will be blocked from merging.
|
||||||
|
#
|
||||||
|
# Source repository: https://github.com/actions/dependency-review-action
|
||||||
|
name: 'Dependency Review'
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-dependency-review-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dependency-review:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
|
- name: 'Checkout Repository'
|
||||||
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
- name: 'Dependency Review'
|
||||||
|
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
|
||||||
@@ -11,25 +11,27 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'charts/fission-all/dashboards/**.json'
|
- 'charts/fission-all/dashboards/**.json'
|
||||||
workflow_dispatch:
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-dashboards:
|
lint-dashboards:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
|
|
||||||
- name: Install dashboard linter
|
|
||||||
run: |
|
|
||||||
go get github.com/grafana/dashboard-linter
|
|
||||||
go install github.com/grafana/dashboard-linter
|
|
||||||
|
|
||||||
- name: Run dashboard linter
|
- name: Run dashboard linter
|
||||||
run: ./hack/lint-dashboards.sh
|
run: ./hack/lint-dashboards.sh
|
||||||
|
|||||||
@@ -15,22 +15,36 @@ on:
|
|||||||
- "**.go"
|
- "**.go"
|
||||||
- go.mod
|
- go.mod
|
||||||
- go.sum
|
- go.sum
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GOLANGCI_LINT_VERSION: v1.51.1
|
GOLANGCI_LINT_VERSION: v2.6.2
|
||||||
GOLANGCI_LINT_TIMEOUT: 5m
|
GOLANGCI_LINT_TIMEOUT: 5m
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-lint-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
permissions:
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
contents: read # for actions/checkout to fetch code
|
||||||
|
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
@@ -41,8 +55,9 @@ jobs:
|
|||||||
go mod download
|
go mod download
|
||||||
|
|
||||||
- name: Run golangci-lint
|
- name: Run golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
|
||||||
with:
|
with:
|
||||||
|
skip-cache: true
|
||||||
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
||||||
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}
|
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}
|
||||||
|
|
||||||
@@ -61,8 +76,8 @@ jobs:
|
|||||||
run: ./hack/runtests.sh
|
run: ./hack/runtests.sh
|
||||||
|
|
||||||
- name: Upload Coverage report to CodeCov
|
- name: Upload Coverage report to CodeCov
|
||||||
uses: codecov/codecov-action@v2
|
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
||||||
with:
|
with:
|
||||||
token: ${{secrets.CODECOV_TOKEN}}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
flags: unittests
|
flags: unittests
|
||||||
file: ./coverage.txt
|
file: ./coverage.txt
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- '!dependabot/**'
|
||||||
paths:
|
paths:
|
||||||
- "**.go"
|
- "**.go"
|
||||||
- "charts/**"
|
- "charts/**"
|
||||||
@@ -19,11 +20,19 @@ on:
|
|||||||
- "test/**"
|
- "test/**"
|
||||||
- go.mod
|
- go.mod
|
||||||
- go.sum
|
- go.sum
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
HELM_VERSION: v3.10.1
|
HELM_VERSION: v4.0.1
|
||||||
KIND_VERSION: v0.17.0
|
KIND_VERSION: v0.30.0
|
||||||
|
KIND_CLUSTER_NAME: kind
|
||||||
|
SKAFFOLD_VERSION: v2.17.0
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-ci-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Job to run change detection
|
# Job to run change detection
|
||||||
@@ -33,42 +42,48 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
kindversion: ["v1.19.16", "v1.20.15", "v1.21.14"]
|
kindversion: ["v1.28.15", "v1.32.8", "v1.34.0"]
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-24.04]
|
||||||
steps:
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: setup go
|
- name: setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
repository: fission/examples
|
repository: fission/examples
|
||||||
path: examples
|
path: examples
|
||||||
|
|
||||||
- name: Helm installation
|
- name: Helm installation
|
||||||
uses: Azure/setup-helm@v3
|
uses: Azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
|
||||||
with:
|
with:
|
||||||
version: ${{ env.HELM_VERSION }}
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
- name: Kind Cluster
|
- name: Kind Cluster
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
|
||||||
with:
|
with:
|
||||||
image: kindest/node:${{ matrix.kindversion }}
|
node_image: kindest/node:${{ matrix.kindversion }}
|
||||||
version: ${{ env.KIND_VERSION }}
|
version: ${{ env.KIND_VERSION }}
|
||||||
|
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
||||||
config: kind.yaml
|
config: kind.yaml
|
||||||
|
|
||||||
- name: Configuring and testing the Installation
|
- name: Configuring and testing the Installation
|
||||||
run: |
|
run: |
|
||||||
kubectl cluster-info --context kind-kind
|
kubectl cluster-info --context kind-${{ env.KIND_CLUSTER_NAME }}
|
||||||
kubectl get nodes
|
kubectl get nodes
|
||||||
sudo apt-get install -y apache2-utils
|
sudo apt-get install -y apache2-utils
|
||||||
kubectl config use-context kind-kind
|
kubectl config use-context kind-${{ env.KIND_CLUSTER_NAME }}
|
||||||
kubectl config view
|
kubectl config view
|
||||||
|
|
||||||
- name: Helm chart lint
|
- name: Helm chart lint
|
||||||
@@ -77,14 +92,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Skaffold
|
- name: Install Skaffold
|
||||||
run: |
|
run: |
|
||||||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.0.3/skaffold-linux-amd64
|
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/${{ env.SKAFFOLD_VERSION }}/skaffold-linux-amd64
|
||||||
sudo install skaffold /usr/local/bin/
|
sudo install skaffold /usr/local/bin/
|
||||||
skaffold version
|
skaffold version
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
|
version: "~> v2"
|
||||||
|
|
||||||
- name: Setup Prometheus Stack
|
- name: Setup Prometheus Stack
|
||||||
run: |
|
run: |
|
||||||
@@ -92,7 +108,7 @@ jobs:
|
|||||||
helm repo update
|
helm repo update
|
||||||
kubectl create ns monitoring
|
kubectl create ns monitoring
|
||||||
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring \
|
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring \
|
||||||
--set grafana.enabled=false --set alertmanager.enabled=false
|
--version 45.28.0 --set grafana.enabled=false --set alertmanager.enabled=false
|
||||||
|
|
||||||
- name: Build and Install Fission CLI
|
- name: Build and Install Fission CLI
|
||||||
run: |
|
run: |
|
||||||
@@ -111,7 +127,6 @@ jobs:
|
|||||||
- name: Port-forward fission components
|
- name: Port-forward fission components
|
||||||
run: |
|
run: |
|
||||||
kubectl port-forward svc/router 8888:80 -nfission &
|
kubectl port-forward svc/router 8888:80 -nfission &
|
||||||
kubectl port-forward svc/controller 8889:80 -nfission &
|
|
||||||
|
|
||||||
- name: Get fission version
|
- name: Get fission version
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -132,7 +147,7 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
kind export logs --name kind kind-logs
|
kind export logs --name ${{ env.KIND_CLUSTER_NAME }} kind-logs
|
||||||
|
|
||||||
- name: Backup prometheus data
|
- name: Backup prometheus data
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -143,7 +158,7 @@ jobs:
|
|||||||
- name: Archive fission dump
|
- name: Archive fission dump
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ failure() || cancelled() }}
|
if: ${{ failure() || cancelled() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: fission-dump/*.zip
|
path: fission-dump/*.zip
|
||||||
@@ -152,7 +167,7 @@ jobs:
|
|||||||
- name: Archive prometheus dump
|
- name: Archive prometheus dump
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: /tmp/prometheus/*
|
path: /tmp/prometheus/*
|
||||||
@@ -161,7 +176,7 @@ jobs:
|
|||||||
- name: Archive kind logs
|
- name: Archive kind logs
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: kind-logs/*
|
path: kind-logs/*
|
||||||
@@ -175,42 +190,48 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
kindversion: ["v1.19.16"]
|
kindversion: ["v1.31.12"]
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-24.04]
|
||||||
steps:
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: setup go
|
- name: setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
repository: fission/examples
|
repository: fission/examples
|
||||||
path: examples
|
path: examples
|
||||||
|
|
||||||
- name: Helm installation
|
- name: Helm installation
|
||||||
uses: Azure/setup-helm@v3
|
uses: Azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
|
||||||
with:
|
with:
|
||||||
version: ${{ env.HELM_VERSION }}
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
- name: Kind Cluster
|
- name: Kind Cluster
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
|
||||||
with:
|
with:
|
||||||
image: kindest/node:${{ matrix.kindversion }}
|
node_image: kindest/node:${{ matrix.kindversion }}
|
||||||
version: ${{ env.KIND_VERSION }}
|
version: ${{ env.KIND_VERSION }}
|
||||||
|
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
||||||
config: kind.yaml
|
config: kind.yaml
|
||||||
|
|
||||||
- name: Configuring and testing the Installation
|
- name: Configuring and testing the Installation
|
||||||
run: |
|
run: |
|
||||||
kubectl cluster-info --context kind-kind
|
kubectl cluster-info --context kind-${{ env.KIND_CLUSTER_NAME }}
|
||||||
kubectl get nodes
|
kubectl get nodes
|
||||||
sudo apt-get install -y apache2-utils
|
sudo apt-get install -y apache2-utils
|
||||||
kubectl config use-context kind-kind
|
kubectl config use-context kind-${{ env.KIND_CLUSTER_NAME }}
|
||||||
kubectl config view
|
kubectl config view
|
||||||
|
|
||||||
- name: Helm chart lint
|
- name: Helm chart lint
|
||||||
@@ -219,14 +240,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Skaffold
|
- name: Install Skaffold
|
||||||
run: |
|
run: |
|
||||||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.0.3/skaffold-linux-amd64
|
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/${{ env.SKAFFOLD_VERSION }}/skaffold-linux-amd64
|
||||||
sudo install skaffold /usr/local/bin/
|
sudo install skaffold /usr/local/bin/
|
||||||
skaffold version
|
skaffold version
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
|
version: "~> v2"
|
||||||
|
|
||||||
- name: Setup Prometheus Stack
|
- name: Setup Prometheus Stack
|
||||||
run: |
|
run: |
|
||||||
@@ -234,7 +256,7 @@ jobs:
|
|||||||
helm repo update
|
helm repo update
|
||||||
kubectl create ns monitoring
|
kubectl create ns monitoring
|
||||||
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring \
|
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring \
|
||||||
--set grafana.enabled=false --set alertmanager.enabled=false
|
--version 45.28.0 --set grafana.enabled=false --set alertmanager.enabled=false
|
||||||
|
|
||||||
- name: Build and Install Fission CLI
|
- name: Build and Install Fission CLI
|
||||||
run: |
|
run: |
|
||||||
@@ -253,7 +275,6 @@ jobs:
|
|||||||
- name: Port-forward fission components
|
- name: Port-forward fission components
|
||||||
run: |
|
run: |
|
||||||
kubectl port-forward svc/router 8888:80 -nfission &
|
kubectl port-forward svc/router 8888:80 -nfission &
|
||||||
kubectl port-forward svc/controller 8889:80 -nfission &
|
|
||||||
|
|
||||||
- name: Get fission version
|
- name: Get fission version
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
@@ -288,26 +309,26 @@ jobs:
|
|||||||
- name: Archive fission dump
|
- name: Archive fission dump
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ failure() || cancelled() }}
|
if: ${{ failure() || cancelled() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: fission-dump-${{ github.run_id }}-${{ github.job_id }}-${{ matrix.kindversion }}
|
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: fission-dump/*.zip
|
path: fission-dump/*.zip
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
- name: Archive prometheus dump
|
- name: Archive prometheus dump
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: prom-dump-${{ github.run_id }}-${{ github.job_id }}-${{ matrix.kindversion }}
|
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: /tmp/prometheus/*
|
path: /tmp/prometheus/*
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
- name: Archive kind logs
|
- name: Archive kind logs
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: kind-logs-${{ github.run_id }}-${{ github.job_id }}-${{ matrix.kindversion }}
|
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: kind-logs/*
|
path: kind-logs/*
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
+142
-29
@@ -6,68 +6,80 @@ on:
|
|||||||
- v2.**
|
- v2.**
|
||||||
|
|
||||||
env:
|
env:
|
||||||
KIND_VERSION: v0.17.0
|
KIND_VERSION: v0.30.0
|
||||||
KIND_NODE_IMAGE_TAG: v1.19.16
|
KIND_NODE_IMAGE_TAG: v1.28.15
|
||||||
|
KIND_CLUSTER_NAME: kind
|
||||||
|
COSIGN_VERSION: v3.0.3
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-draft-release:
|
create-draft-release:
|
||||||
runs-on: ubuntu-latest
|
name: Create Draft Release with Goreleaser
|
||||||
|
outputs:
|
||||||
|
ghcr_images: ${{ steps.image.outputs.ghcr_images }}
|
||||||
|
version: ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
permissions:
|
||||||
|
contents: write # for goreleaser/goreleaser-action to create a GitHub release
|
||||||
|
packages: write # for goreleaser/goreleaser-action to upload artifacts to GitHub Packages
|
||||||
|
id-token: write # for cosign to sign the image and binary
|
||||||
|
attestations: write # for goreleaser/goreleaser-action to upload attestations
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Get the version
|
- name: Get the version
|
||||||
id: get_version
|
id: get_version
|
||||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
|
version: "~> v2"
|
||||||
|
|
||||||
- name: Kind Clutser
|
- name: Kind Cluster
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
|
||||||
with:
|
with:
|
||||||
image: kindest/node:${{ env.KIND_NODE_IMAGE_TAG }}
|
node_image: kindest/node:${{ env.KIND_NODE_IMAGE_TAG }}
|
||||||
version: ${{ env.KIND_VERSION }}
|
version: ${{ env.KIND_VERSION }}
|
||||||
config: kind.yaml
|
config: kind.yaml
|
||||||
|
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||||
|
|
||||||
- name: Login to ghcr.io
|
- name: Login to ghcr.io
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to docker.io
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Install Cosign
|
- name: Install Cosign
|
||||||
uses: sigstore/cosign-installer@main
|
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
|
||||||
with:
|
with:
|
||||||
cosign-release: 'v1.12.0'
|
cosign-release: ${{ env.COSIGN_VERSION }}
|
||||||
|
|
||||||
- name: Check cosign install!
|
- name: Check cosign install!
|
||||||
run: cosign version
|
run: cosign version
|
||||||
|
|
||||||
- name: Write cosign signing key to disk
|
- uses: anchore/sbom-action/download-syft@43a17d6e7add2b5535efe4dcae9952337c479a93 #v0.20.11
|
||||||
run: 'echo "$KEY" > cosign.key'
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
|
|
||||||
|
|
||||||
- name: Generate yaml for manifest, Minikube and Openshift installation
|
- name: Generate yaml for manifest, Minikube and Openshift installation
|
||||||
run: ${GITHUB_WORKSPACE}/hack/build-yaml.sh $VERSION
|
run: ${GITHUB_WORKSPACE}/hack/build-yaml.sh $VERSION
|
||||||
@@ -76,14 +88,115 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
id: goreleaser
|
||||||
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: "~> v2"
|
||||||
args: release
|
args: release
|
||||||
env:
|
env:
|
||||||
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
|
|
||||||
GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.VERSION }}
|
GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.VERSION }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||||
|
|
||||||
#ToDo - Verify and upload releases
|
# Attest binary artifacts
|
||||||
|
# https://goreleaser.com/customization/attestations/
|
||||||
|
- name: Attest binary artifacts
|
||||||
|
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
|
||||||
|
with:
|
||||||
|
subject-checksums: ./dist/checksums.txt
|
||||||
|
|
||||||
|
- name: Image digest
|
||||||
|
id: image
|
||||||
|
env:
|
||||||
|
ARTIFACTS: "${{ steps.goreleaser.outputs.artifacts }}"
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
image_and_digest=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Docker Image") | {name, "digest": (.extra.Digest // .extra.Checksum)} | select(.digest) | {name} + {digest} | join("@") | sub("^sha256:";"")' | grep -v latest)
|
||||||
|
ghcr_images=$(echo "${image_and_digest}" | grep ghcr.io | jq -R -s -c '
|
||||||
|
split("\n")
|
||||||
|
| map(select(. != ""))
|
||||||
|
| map(
|
||||||
|
split("@")
|
||||||
|
| {
|
||||||
|
"image": .[0] | split(":")[0],
|
||||||
|
"checksum": .[1]
|
||||||
|
}
|
||||||
|
)')
|
||||||
|
echo "ghcr_images=$ghcr_images" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
image-sbom-provenance-ghcr:
|
||||||
|
name: Create SBOM & Provenance for container images
|
||||||
|
# Goreleaser does not support generating SBOM for container images.
|
||||||
|
needs: [create-draft-release]
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include: ${{ fromJson(needs.create-draft-release.outputs.ghcr_images) }}
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
|
id-token: write
|
||||||
|
packages: write
|
||||||
|
attestations: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Run Trivy in fs mode to generate SBOM
|
||||||
|
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # v0.33.1
|
||||||
|
with:
|
||||||
|
scan-type: "fs"
|
||||||
|
format: "spdx-json"
|
||||||
|
output: "sbom.spdx.json"
|
||||||
|
- name: Attest SBOM for image
|
||||||
|
uses: actions/attest-sbom@4651f806c01d8637787e274ac3bdf724ef169f34 # v3.0.0
|
||||||
|
with:
|
||||||
|
sbom-path: sbom.spdx.json
|
||||||
|
subject-name: ${{ fromJson(toJson(matrix)).image }}
|
||||||
|
subject-digest: ${{ fromJson(toJson(matrix)).checksum }}
|
||||||
|
push-to-registry: true
|
||||||
|
- name: Attest provenance for image
|
||||||
|
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
|
||||||
|
with:
|
||||||
|
subject-name: ${{ fromJson(toJson(matrix)).image }}
|
||||||
|
subject-digest: ${{ fromJson(toJson(matrix)).checksum }}
|
||||||
|
push-to-registry: true
|
||||||
|
|
||||||
|
image-provenance-verification-with-cosign:
|
||||||
|
name: Verify Image Provenance
|
||||||
|
needs: [create-draft-release, image-sbom-provenance-ghcr]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include: ${{ fromJson(needs.create-draft-release.outputs.ghcr_images) }}
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
permissions: read-all
|
||||||
|
steps:
|
||||||
|
- name: Login
|
||||||
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Install Cosign
|
||||||
|
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
|
||||||
|
with:
|
||||||
|
cosign-release: ${{ env.COSIGN_VERSION }}
|
||||||
|
|
||||||
|
- name: Verify image
|
||||||
|
env:
|
||||||
|
IMAGE: ${{ fromJson(toJson(matrix)).image }}
|
||||||
|
DIGEST: ${{ fromJson(toJson(matrix)).checksum }}
|
||||||
|
run: |
|
||||||
|
echo "Verifying $IMAGE@$DIGEST"
|
||||||
|
cosign verify-attestation \
|
||||||
|
--type https://slsa.dev/provenance/v1 \
|
||||||
|
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
||||||
|
--certificate-identity-regexp '^https://github.com/fission/fission/.github/workflows/release.yaml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$' \
|
||||||
|
$IMAGE@$DIGEST
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
# This workflow uses actions that are not certified by GitHub. They are provided
|
||||||
|
# by a third-party and are governed by separate terms of service, privacy
|
||||||
|
# policy, and support documentation.
|
||||||
|
|
||||||
|
name: Scorecard supply-chain security
|
||||||
|
on:
|
||||||
|
# For Branch-Protection check. Only the default branch is supported. See
|
||||||
|
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
||||||
|
branch_protection_rule:
|
||||||
|
# To guarantee Maintained check is occasionally updated. See
|
||||||
|
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
||||||
|
schedule:
|
||||||
|
- cron: '41 18 * * 0'
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
# Declare default permissions as read only.
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analysis:
|
||||||
|
name: Scorecard analysis
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
permissions:
|
||||||
|
# Needed to upload the results to code-scanning dashboard.
|
||||||
|
security-events: write
|
||||||
|
# Needed to publish results and get a badge (see publish_results below).
|
||||||
|
id-token: write
|
||||||
|
# Uncomment the permissions below if installing in a private repository.
|
||||||
|
# contents: read
|
||||||
|
# actions: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
|
- name: "Checkout code"
|
||||||
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: "Run analysis"
|
||||||
|
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||||
|
with:
|
||||||
|
results_file: results.sarif
|
||||||
|
results_format: sarif
|
||||||
|
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
|
||||||
|
# - you want to enable the Branch-Protection check on a *public* repository, or
|
||||||
|
# - you are installing Scorecard on a *private* repository
|
||||||
|
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
|
||||||
|
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
|
||||||
|
|
||||||
|
# Public repositories:
|
||||||
|
# - Publish results to OpenSSF REST API for easy access by consumers
|
||||||
|
# - Allows the repository to include the Scorecard badge.
|
||||||
|
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
||||||
|
# For private repositories:
|
||||||
|
# - `publish_results` will always be set to `false`, regardless
|
||||||
|
# of the value entered here.
|
||||||
|
publish_results: true
|
||||||
|
|
||||||
|
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||||
|
# format to the repository Actions tab.
|
||||||
|
- name: "Upload artifact"
|
||||||
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v3.pre.node20
|
||||||
|
with:
|
||||||
|
name: SARIF file
|
||||||
|
path: results.sarif
|
||||||
|
retention-days: 5
|
||||||
|
|
||||||
|
# Upload the results to GitHub's code scanning dashboard (optional).
|
||||||
|
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
||||||
|
- name: "Upload to code-scanning"
|
||||||
|
uses: github/codeql-action/upload-sarif@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
|
||||||
|
with:
|
||||||
|
sarif_file: results.sarif
|
||||||
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- '!dependabot/**'
|
||||||
paths:
|
paths:
|
||||||
- "**.go"
|
- "**.go"
|
||||||
- "charts/**"
|
- "charts/**"
|
||||||
@@ -19,11 +20,18 @@ on:
|
|||||||
- "test/**"
|
- "test/**"
|
||||||
- go.mod
|
- go.mod
|
||||||
- go.sum
|
- go.sum
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
HELM_VERSION: v3.10.1
|
HELM_VERSION: v3.19.0
|
||||||
KIND_VERSION: v0.17.0
|
KIND_VERSION: v0.30.0
|
||||||
|
KIND_CLUSTER_NAME: kind
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-upgrade-test-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upgrade-test:
|
upgrade-test:
|
||||||
@@ -32,40 +40,47 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
kindimage: ["kindest/node:v1.19.16"]
|
kindversion: ["v1.31.12"]
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-24.04]
|
||||||
steps:
|
steps:
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
|
with:
|
||||||
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Checkout action sources
|
- name: Checkout action sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Setup Helm
|
- name: Setup Helm
|
||||||
uses: Azure/setup-helm@v3
|
uses: Azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
|
||||||
with:
|
with:
|
||||||
version: ${{ env.HELM_VERSION }}
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
- name: Setup Kind Clutser
|
- name: Setup Kind Cluster
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
|
||||||
with:
|
with:
|
||||||
image: ${{ matrix.kindimage }}
|
node_image: kindest/node:${{ matrix.kindversion }}
|
||||||
version: ${{ env.KIND_VERSION }}
|
version: ${{ env.KIND_VERSION }}
|
||||||
|
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
|
version: "~> v2"
|
||||||
|
|
||||||
- name: Setup kubectl & fetch node information
|
- name: Setup kubectl & fetch node information
|
||||||
run: |
|
run: |
|
||||||
kubectl cluster-info --context kind-kind
|
kubectl cluster-info --context kind-${{ env.KIND_CLUSTER_NAME }}
|
||||||
kubectl get nodes
|
kubectl get nodes
|
||||||
kubectl get storageclasses.storage.k8s.io
|
kubectl get storageclasses.storage.k8s.io
|
||||||
kubectl config use-context kind-kind
|
kubectl config use-context kind-${{ env.KIND_CLUSTER_NAME }}
|
||||||
kubectl config set-context --current --namespace=default
|
kubectl config set-context --current --namespace=default
|
||||||
kubectl config view
|
kubectl config view
|
||||||
|
|
||||||
@@ -99,11 +114,11 @@ jobs:
|
|||||||
- name: Kind export logs
|
- name: Kind export logs
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
kind export logs --name kind kind-logs
|
kind export logs --name ${{ env.KIND_CLUSTER_NAME }} kind-logs
|
||||||
|
|
||||||
- name: Archive fission dump
|
- name: Archive fission dump
|
||||||
if: ${{ failure() || cancelled() }}
|
if: ${{ failure() || cancelled() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: fission-dump/*.zip
|
path: fission-dump/*.zip
|
||||||
@@ -111,7 +126,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Archive kind logs
|
- name: Archive kind logs
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: kind-logs/*
|
path: kind-logs/*
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ cmd/reporter/reporter
|
|||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
test/logs/
|
test/logs/
|
||||||
|
test/e2e/cli/fission-dump/
|
||||||
|
|
||||||
# Pycharm IDE
|
# Pycharm IDE
|
||||||
.idea
|
.idea
|
||||||
|
|||||||
+43
-27
@@ -1,35 +1,51 @@
|
|||||||
|
version: "2"
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
# Default linter
|
|
||||||
- errcheck
|
- errcheck
|
||||||
- gosimple
|
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- staticcheck
|
|
||||||
- typecheck
|
|
||||||
- unused
|
|
||||||
# Additional linters
|
|
||||||
- gofmt
|
|
||||||
- goimports
|
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- unconvert
|
|
||||||
- promlinter
|
- promlinter
|
||||||
# Enable in future
|
- unconvert
|
||||||
# - bodyclose
|
- unused
|
||||||
# - dogsled
|
- staticcheck
|
||||||
# - dupl
|
settings:
|
||||||
# - gosec
|
errcheck:
|
||||||
# - nilerr
|
exclude-functions:
|
||||||
# - prealloc
|
- (*go.uber.org/zap.Logger).Sync
|
||||||
# - revive
|
exclusions:
|
||||||
# - unparam
|
generated: lax
|
||||||
# - wrapcheck
|
presets:
|
||||||
# - gocritic
|
- comments
|
||||||
linters-settings:
|
- common-false-positives
|
||||||
errcheck:
|
- legacy
|
||||||
ignore: go.uber.org/zap:Sync
|
- std-error-handling
|
||||||
goimports:
|
paths:
|
||||||
# put imports beginning with prefix after 3rd-party packages;
|
- third_party$
|
||||||
# it's a comma-separated list of prefixes
|
- builtin$
|
||||||
local: github.com/fission/fission
|
- examples$
|
||||||
|
rules:
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
text: "QF1008"
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
text: "QF1001"
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
text: "QF1003"
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gofmt
|
||||||
|
- goimports
|
||||||
|
settings:
|
||||||
|
goimports:
|
||||||
|
local-prefixes:
|
||||||
|
- github.com/fission/fission
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
paths:
|
||||||
|
- third_party$
|
||||||
|
- builtin$
|
||||||
|
- examples$
|
||||||
|
|||||||
+118
-365
@@ -1,9 +1,14 @@
|
|||||||
|
version: 2
|
||||||
|
|
||||||
|
env:
|
||||||
|
- GHCR_REPO=ghcr.io/fission
|
||||||
|
|
||||||
project_name: fission
|
project_name: fission
|
||||||
release:
|
release:
|
||||||
github:
|
github:
|
||||||
owner: fission
|
owner: fission
|
||||||
name: fission
|
name: fission
|
||||||
prerelease: true
|
prerelease: "true"
|
||||||
draft: true
|
draft: true
|
||||||
header: |
|
header: |
|
||||||
Release Highlights: https://fission.io/docs/releases/{{ .Tag }}/
|
Release Highlights: https://fission.io/docs/releases/{{ .Tag }}/
|
||||||
@@ -16,7 +21,7 @@ before:
|
|||||||
hooks:
|
hooks:
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
snapshot:
|
snapshot:
|
||||||
name_template: "{{ .Tag }}"
|
version_template: "{{ .Tag }}"
|
||||||
builds:
|
builds:
|
||||||
- &build-linux
|
- &build-linux
|
||||||
id: builder
|
id: builder
|
||||||
@@ -36,9 +41,6 @@ builds:
|
|||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
- arm64
|
- arm64
|
||||||
- arm
|
|
||||||
goarm:
|
|
||||||
- 7
|
|
||||||
binary: builder
|
binary: builder
|
||||||
dir: ./cmd/builder
|
dir: ./cmd/builder
|
||||||
- <<: *build-linux
|
- <<: *build-linux
|
||||||
@@ -60,12 +62,6 @@ builds:
|
|||||||
ignore:
|
ignore:
|
||||||
- goos: windows
|
- goos: windows
|
||||||
goarch: arm64
|
goarch: arm64
|
||||||
- goos: darwin
|
|
||||||
goarch: arm
|
|
||||||
goarm: 7
|
|
||||||
- goos: windows
|
|
||||||
goarch: arm
|
|
||||||
goarm: 7
|
|
||||||
- <<: *build-linux
|
- <<: *build-linux
|
||||||
id: pre-upgrade-checks
|
id: pre-upgrade-checks
|
||||||
binary: pre-upgrade-checks
|
binary: pre-upgrade-checks
|
||||||
@@ -74,377 +70,134 @@ builds:
|
|||||||
id: reporter
|
id: reporter
|
||||||
binary: reporter
|
binary: reporter
|
||||||
dir: ./cmd/reporter
|
dir: ./cmd/reporter
|
||||||
dockers:
|
dockers_v2:
|
||||||
- &docker-amd64
|
- id: builder
|
||||||
use: buildx
|
tags:
|
||||||
goos: linux
|
- latest
|
||||||
goarch: amd64
|
- "{{ .Tag }}"
|
||||||
ids:
|
images:
|
||||||
- builder
|
- "{{ .Env.GHCR_REPO }}/builder"
|
||||||
image_templates:
|
labels:
|
||||||
- "fission/builder:latest-amd64"
|
org.opencontainers.image.description: "The builder assists in building the fission function source code for deployment."
|
||||||
- "fission/builder:{{ .Tag }}-amd64"
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
- "ghcr.io/fission/builder:latest-amd64"
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- "ghcr.io/fission/builder:{{ .Tag }}-amd64"
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
|
org.opencontainers.image.vendor: "Fission"
|
||||||
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
dockerfile: cmd/builder/Dockerfile
|
dockerfile: cmd/builder/Dockerfile
|
||||||
build_flag_templates:
|
- id: fetcher
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
tags:
|
||||||
- "--platform=linux/amd64"
|
- latest
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
- "{{ .Tag }}"
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
images:
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
- "{{ .Env.GHCR_REPO }}/fetcher"
|
||||||
- <<: *docker-amd64
|
labels:
|
||||||
ids:
|
org.opencontainers.image.description: "Fetcher is a lightweight component used by environment and builder pods. Fetcher helps in fetch and upload of source/deployment packages and specializing environments."
|
||||||
- fetcher
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
image_templates:
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- "fission/fetcher:latest-amd64"
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
- "fission/fetcher:{{ .Tag }}-amd64"
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
- "ghcr.io/fission/fetcher:latest-amd64"
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
- "ghcr.io/fission/fetcher:{{ .Tag }}-amd64"
|
org.opencontainers.image.vendor: "Fission"
|
||||||
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
dockerfile: cmd/fetcher/Dockerfile
|
dockerfile: cmd/fetcher/Dockerfile
|
||||||
build_flag_templates:
|
- id: fission-bundle
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
tags:
|
||||||
- "--platform=linux/amd64"
|
- latest
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
- "{{ .Tag }}"
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
images:
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
- "{{ .Env.GHCR_REPO }}/fission-bundle"
|
||||||
- <<: *docker-amd64
|
labels:
|
||||||
ids:
|
org.opencontainers.image.description: "fission-bundle is a component which is a single binary for all components. Most server side components running on server side are fission-bundle binary wrapped in container and used with different arguments."
|
||||||
- fission-bundle
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
image_templates:
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- "fission/fission-bundle:latest-amd64"
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
- "fission/fission-bundle:{{ .Tag }}-amd64"
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
- "ghcr.io/fission/fission-bundle:latest-amd64"
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
- "ghcr.io/fission/fission-bundle:{{ .Tag }}-amd64"
|
org.opencontainers.image.vendor: "Fission"
|
||||||
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
dockerfile: cmd/fission-bundle/Dockerfile
|
dockerfile: cmd/fission-bundle/Dockerfile
|
||||||
build_flag_templates:
|
- id: pre-upgrade-checks
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
tags:
|
||||||
- "--platform=linux/amd64"
|
- latest
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
- "{{ .Tag }}"
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
images:
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks"
|
||||||
- <<: *docker-amd64
|
labels:
|
||||||
ids:
|
org.opencontainers.image.description: "Preupgradechecks ensures that Fission is ready for the targeted version upgrade by performing checks beforehand."
|
||||||
- pre-upgrade-checks
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
image_templates:
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- "fission/pre-upgrade-checks:latest-amd64"
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
- "fission/pre-upgrade-checks:{{ .Tag }}-amd64"
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
- "ghcr.io/fission/pre-upgrade-checks:latest-amd64"
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
- "ghcr.io/fission/pre-upgrade-checks:{{ .Tag }}-amd64"
|
org.opencontainers.image.vendor: "Fission"
|
||||||
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
dockerfile: cmd/preupgradechecks/Dockerfile
|
dockerfile: cmd/preupgradechecks/Dockerfile
|
||||||
build_flag_templates:
|
- id: reporter
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
tags:
|
||||||
- "--platform=linux/amd64"
|
- latest
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
- "{{ .Tag }}"
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
images:
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
- "{{ .Env.GHCR_REPO }}/reporter"
|
||||||
- <<: *docker-amd64
|
labels:
|
||||||
ids:
|
org.opencontainers.image.description: "The reporter gathers information that assists in improving fission."
|
||||||
- reporter
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
image_templates:
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- "fission/reporter:latest-amd64"
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
- "fission/reporter:{{ .Tag }}-amd64"
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
- "ghcr.io/fission/reporter:latest-amd64"
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
- "ghcr.io/fission/reporter:{{ .Tag }}-amd64"
|
org.opencontainers.image.vendor: "Fission"
|
||||||
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
dockerfile: cmd/reporter/Dockerfile
|
dockerfile: cmd/reporter/Dockerfile
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/amd64"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- &docker-arm64
|
|
||||||
use: buildx
|
|
||||||
goos: linux
|
|
||||||
goarch: arm64
|
|
||||||
ids:
|
|
||||||
- builder
|
|
||||||
image_templates:
|
|
||||||
- "fission/builder:latest-arm64"
|
|
||||||
- "fission/builder:{{ .Tag }}-arm64"
|
|
||||||
- "ghcr.io/fission/builder:latest-arm64"
|
|
||||||
- "ghcr.io/fission/builder:{{ .Tag }}-arm64"
|
|
||||||
dockerfile: cmd/builder/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm64"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- <<: *docker-arm64
|
|
||||||
ids:
|
|
||||||
- fetcher
|
|
||||||
image_templates:
|
|
||||||
- "fission/fetcher:latest-arm64"
|
|
||||||
- "fission/fetcher:{{ .Tag }}-arm64"
|
|
||||||
- "ghcr.io/fission/fetcher:latest-arm64"
|
|
||||||
- "ghcr.io/fission/fetcher:{{ .Tag }}-arm64"
|
|
||||||
dockerfile: cmd/fetcher/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm64"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- <<: *docker-arm64
|
|
||||||
ids:
|
|
||||||
- fission-bundle
|
|
||||||
image_templates:
|
|
||||||
- "fission/fission-bundle:latest-arm64"
|
|
||||||
- "fission/fission-bundle:{{ .Tag }}-arm64"
|
|
||||||
- "ghcr.io/fission/fission-bundle:latest-arm64"
|
|
||||||
- "ghcr.io/fission/fission-bundle:{{ .Tag }}-arm64"
|
|
||||||
dockerfile: cmd/fission-bundle/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm64"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- <<: *docker-arm64
|
|
||||||
ids:
|
|
||||||
- pre-upgrade-checks
|
|
||||||
image_templates:
|
|
||||||
- "fission/pre-upgrade-checks:latest-arm64"
|
|
||||||
- "fission/pre-upgrade-checks:{{ .Tag }}-arm64"
|
|
||||||
- "ghcr.io/fission/pre-upgrade-checks:latest-arm64"
|
|
||||||
- "ghcr.io/fission/pre-upgrade-checks:{{ .Tag }}-arm64"
|
|
||||||
dockerfile: cmd/preupgradechecks/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm64"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- <<: *docker-arm64
|
|
||||||
ids:
|
|
||||||
- reporter
|
|
||||||
image_templates:
|
|
||||||
- "fission/reporter:latest-arm64"
|
|
||||||
- "fission/reporter:{{ .Tag }}-arm64"
|
|
||||||
- "ghcr.io/fission/reporter:latest-arm64"
|
|
||||||
- "ghcr.io/fission/reporter:{{ .Tag }}-arm64"
|
|
||||||
dockerfile: cmd/reporter/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm64"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- &docker-armv7
|
|
||||||
use: buildx
|
|
||||||
goos: linux
|
|
||||||
goarch: arm
|
|
||||||
goarm: 7
|
|
||||||
ids:
|
|
||||||
- builder
|
|
||||||
image_templates:
|
|
||||||
- "fission/builder:latest-armv7"
|
|
||||||
- "fission/builder:{{ .Tag }}-armv7"
|
|
||||||
- "ghcr.io/fission/builder:latest-armv7"
|
|
||||||
- "ghcr.io/fission/builder:{{ .Tag }}-armv7"
|
|
||||||
dockerfile: cmd/builder/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm/v7"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- <<: *docker-armv7
|
|
||||||
ids:
|
|
||||||
- fetcher
|
|
||||||
image_templates:
|
|
||||||
- "fission/fetcher:latest-armv7"
|
|
||||||
- "fission/fetcher:{{ .Tag }}-armv7"
|
|
||||||
- "ghcr.io/fission/fetcher:latest-armv7"
|
|
||||||
- "ghcr.io/fission/fetcher:{{ .Tag }}-armv7"
|
|
||||||
dockerfile: cmd/fetcher/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm/v7"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- <<: *docker-armv7
|
|
||||||
ids:
|
|
||||||
- fission-bundle
|
|
||||||
image_templates:
|
|
||||||
- "fission/fission-bundle:latest-armv7"
|
|
||||||
- "fission/fission-bundle:{{ .Tag }}-armv7"
|
|
||||||
- "ghcr.io/fission/fission-bundle:latest-armv7"
|
|
||||||
- "ghcr.io/fission/fission-bundle:{{ .Tag }}-armv7"
|
|
||||||
dockerfile: cmd/fission-bundle/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm/v7"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- <<: *docker-armv7
|
|
||||||
ids:
|
|
||||||
- pre-upgrade-checks
|
|
||||||
image_templates:
|
|
||||||
- "fission/pre-upgrade-checks:latest-armv7"
|
|
||||||
- "fission/pre-upgrade-checks:{{ .Tag }}-armv7"
|
|
||||||
- "ghcr.io/fission/pre-upgrade-checks:latest-armv7"
|
|
||||||
- "ghcr.io/fission/pre-upgrade-checks:{{ .Tag }}-armv7"
|
|
||||||
dockerfile: cmd/preupgradechecks/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm/v7"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
- <<: *docker-armv7
|
|
||||||
ids:
|
|
||||||
- reporter
|
|
||||||
image_templates:
|
|
||||||
- "fission/reporter:latest-armv7"
|
|
||||||
- "fission/reporter:{{ .Tag }}-armv7"
|
|
||||||
- "ghcr.io/fission/reporter:latest-armv7"
|
|
||||||
- "ghcr.io/fission/reporter:{{ .Tag }}-armv7"
|
|
||||||
dockerfile: cmd/reporter/Dockerfile
|
|
||||||
build_flag_templates:
|
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
|
||||||
- "--platform=linux/arm/v7"
|
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
|
||||||
docker_manifests:
|
|
||||||
- name_template: ghcr.io/fission/builder:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/builder:{{ .Tag }}-amd64
|
|
||||||
- ghcr.io/fission/builder:{{ .Tag }}-arm64
|
|
||||||
- ghcr.io/fission/builder:{{ .Tag }}-armv7
|
|
||||||
- name_template: fission/builder:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- fission/builder:{{ .Tag }}-amd64
|
|
||||||
- fission/builder:{{ .Tag }}-arm64
|
|
||||||
- fission/builder:{{ .Tag }}-armv7
|
|
||||||
- name_template: ghcr.io/fission/fetcher:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/fetcher:{{ .Tag }}-amd64
|
|
||||||
- ghcr.io/fission/fetcher:{{ .Tag }}-arm64
|
|
||||||
- ghcr.io/fission/fetcher:{{ .Tag }}-armv7
|
|
||||||
- name_template: fission/fetcher:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- fission/fetcher:{{ .Tag }}-amd64
|
|
||||||
- fission/fetcher:{{ .Tag }}-arm64
|
|
||||||
- fission/fetcher:{{ .Tag }}-armv7
|
|
||||||
- name_template: ghcr.io/fission/fission-bundle:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/fission-bundle:{{ .Tag }}-amd64
|
|
||||||
- ghcr.io/fission/fission-bundle:{{ .Tag }}-arm64
|
|
||||||
- ghcr.io/fission/fission-bundle:{{ .Tag }}-armv7
|
|
||||||
- name_template: fission/fission-bundle:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- fission/fission-bundle:{{ .Tag }}-amd64
|
|
||||||
- fission/fission-bundle:{{ .Tag }}-arm64
|
|
||||||
- fission/fission-bundle:{{ .Tag }}-armv7
|
|
||||||
- name_template: ghcr.io/fission/pre-upgrade-checks:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/pre-upgrade-checks:{{ .Tag }}-amd64
|
|
||||||
- ghcr.io/fission/pre-upgrade-checks:{{ .Tag }}-arm64
|
|
||||||
- ghcr.io/fission/pre-upgrade-checks:{{ .Tag }}-armv7
|
|
||||||
- name_template: fission/pre-upgrade-checks:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- fission/pre-upgrade-checks:{{ .Tag }}-amd64
|
|
||||||
- fission/pre-upgrade-checks:{{ .Tag }}-arm64
|
|
||||||
- fission/pre-upgrade-checks:{{ .Tag }}-armv7
|
|
||||||
- name_template: ghcr.io/fission/reporter:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/reporter:{{ .Tag }}-amd64
|
|
||||||
- ghcr.io/fission/reporter:{{ .Tag }}-arm64
|
|
||||||
- ghcr.io/fission/reporter:{{ .Tag }}-armv7
|
|
||||||
- name_template: fission/reporter:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- fission/reporter:{{ .Tag }}-amd64
|
|
||||||
- fission/reporter:{{ .Tag }}-arm64
|
|
||||||
- fission/reporter:{{ .Tag }}-armv7
|
|
||||||
- name_template: ghcr.io/fission/builder:latest
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/builder:latest-amd64
|
|
||||||
- ghcr.io/fission/builder:latest-arm64
|
|
||||||
- ghcr.io/fission/builder:latest-armv7
|
|
||||||
- name_template: fission/builder:latest
|
|
||||||
image_templates:
|
|
||||||
- fission/builder:latest-amd64
|
|
||||||
- fission/builder:latest-arm64
|
|
||||||
- fission/builder:latest-armv7
|
|
||||||
- name_template: ghcr.io/fission/fetcher:latest
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/fetcher:latest-amd64
|
|
||||||
- ghcr.io/fission/fetcher:latest-arm64
|
|
||||||
- ghcr.io/fission/fetcher:latest-armv7
|
|
||||||
- name_template: fission/fetcher:latest
|
|
||||||
image_templates:
|
|
||||||
- fission/fetcher:latest-amd64
|
|
||||||
- fission/fetcher:latest-arm64
|
|
||||||
- fission/fetcher:latest-armv7
|
|
||||||
- name_template: ghcr.io/fission/fission-bundle:latest
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/fission-bundle:latest-amd64
|
|
||||||
- ghcr.io/fission/fission-bundle:latest-arm64
|
|
||||||
- ghcr.io/fission/fission-bundle:latest-armv7
|
|
||||||
- name_template: fission/fission-bundle:latest
|
|
||||||
image_templates:
|
|
||||||
- fission/fission-bundle:latest-amd64
|
|
||||||
- fission/fission-bundle:latest-arm64
|
|
||||||
- fission/fission-bundle:latest-armv7
|
|
||||||
- name_template: ghcr.io/fission/pre-upgrade-checks:latest
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/pre-upgrade-checks:latest-amd64
|
|
||||||
- ghcr.io/fission/pre-upgrade-checks:latest-arm64
|
|
||||||
- ghcr.io/fission/pre-upgrade-checks:latest-armv7
|
|
||||||
- name_template: fission/pre-upgrade-checks:latest
|
|
||||||
image_templates:
|
|
||||||
- fission/pre-upgrade-checks:latest-amd64
|
|
||||||
- fission/pre-upgrade-checks:latest-arm64
|
|
||||||
- fission/pre-upgrade-checks:latest-armv7
|
|
||||||
- name_template: ghcr.io/fission/reporter:latest
|
|
||||||
image_templates:
|
|
||||||
- ghcr.io/fission/reporter:latest-amd64
|
|
||||||
- ghcr.io/fission/reporter:latest-arm64
|
|
||||||
- ghcr.io/fission/reporter:latest-armv7
|
|
||||||
- name_template: fission/reporter:latest
|
|
||||||
image_templates:
|
|
||||||
- fission/reporter:latest-amd64
|
|
||||||
- fission/reporter:latest-arm64
|
|
||||||
- fission/reporter:latest-armv7
|
|
||||||
changelog:
|
changelog:
|
||||||
skip: false
|
disable: true
|
||||||
archives:
|
archives:
|
||||||
- id: fission
|
- id: fission
|
||||||
builds:
|
ids:
|
||||||
- fission-cli
|
- fission-cli
|
||||||
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
||||||
format: binary
|
formats:
|
||||||
|
- binary
|
||||||
checksum:
|
checksum:
|
||||||
name_template: "checksums.txt"
|
name_template: "checksums.txt"
|
||||||
algorithm: sha256
|
docker_digest:
|
||||||
|
name_template: "docker-digests.txt"
|
||||||
|
|
||||||
# signs the checksum file
|
# signs the checksum file
|
||||||
# https://goreleaser.com/customization/sign
|
# https://goreleaser.com/customization/sign
|
||||||
signs:
|
signs:
|
||||||
- cmd: cosign
|
- id: cosign-binary
|
||||||
artifacts: all
|
env:
|
||||||
stdin: '{{ .Env.COSIGN_PWD }}'
|
- COSIGN_EXPERIMENTAL=1
|
||||||
output: true
|
signature: "${artifact}.sig.bundle"
|
||||||
args:
|
cmd: cosign
|
||||||
- sign-blob
|
artifacts: all
|
||||||
- '--key=cosign.key'
|
args:
|
||||||
- '--output-certificate=${certificate}'
|
- sign-blob
|
||||||
- '--output-signature=${signature}'
|
- "--bundle=${signature}"
|
||||||
- '${artifact}'
|
- "${artifact}"
|
||||||
|
- "--yes" # needed for cosign 2.0.0+
|
||||||
|
|
||||||
# signs our docker image
|
# signs our docker image
|
||||||
# https://goreleaser.com/customization/docker_sign
|
# https://goreleaser.com/customization/docker_sign
|
||||||
docker_signs:
|
docker_signs:
|
||||||
- cmd: cosign
|
- cmd: cosign
|
||||||
artifacts: all
|
env:
|
||||||
stdin: '{{ .Env.COSIGN_PWD }}'
|
- COSIGN_EXPERIMENTAL=1
|
||||||
output: true
|
artifacts: all
|
||||||
args:
|
args:
|
||||||
- 'sign'
|
- sign
|
||||||
- '--key=cosign.key'
|
- "${artifact}"
|
||||||
- '${artifact}'
|
- "--yes" # needed for cosign 2.0.0+
|
||||||
|
|
||||||
|
sboms:
|
||||||
|
- artifacts: archive
|
||||||
|
id: archive
|
||||||
|
- artifacts: source
|
||||||
|
id: source
|
||||||
|
- artifacts: binary
|
||||||
|
id: binary
|
||||||
|
- artifacts: package
|
||||||
|
id: package
|
||||||
|
|||||||
+4
-4
@@ -8,10 +8,10 @@ pull_request_rules:
|
|||||||
- check-success=CodeQL-Build
|
- check-success=CodeQL-Build
|
||||||
- check-success=CodeQL
|
- check-success=CodeQL
|
||||||
- check-success=lint
|
- check-success=lint
|
||||||
- check-success=upgrade-test (kindest/node:v1.19.11, ubuntu-latest)
|
- check-success=upgrade-test (kindest/node:v1.23.17, ubuntu-latest)
|
||||||
- check-success=integration-test (v1.19.11, ubuntu-latest)
|
- check-success=integration-test (v1.23.17, ubuntu-latest)
|
||||||
- check-success=integration-test (v1.20.7, ubuntu-latest)
|
- check-success=integration-test (v1.25.11, ubuntu-latest)
|
||||||
- check-success=integration-test (v1.21.1, ubuntu-latest)
|
- check-success=integration-test (v1.27.3, ubuntu-latest)
|
||||||
actions:
|
actions:
|
||||||
merge:
|
merge:
|
||||||
method: squash
|
method: squash
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/gitleaks/gitleaks
|
||||||
|
rev: v8.16.3
|
||||||
|
hooks:
|
||||||
|
- id: gitleaks
|
||||||
|
- repo: https://github.com/golangci/golangci-lint
|
||||||
|
rev: v1.52.2
|
||||||
|
hooks:
|
||||||
|
- id: golangci-lint
|
||||||
|
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
||||||
|
rev: 3.0.0
|
||||||
|
hooks:
|
||||||
|
- id: shellcheck
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.4.0
|
||||||
|
hooks:
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
@@ -23,6 +23,7 @@ COMMITSHA ?= $(shell git rev-parse HEAD)
|
|||||||
GOOS ?= $(shell go env GOOS)
|
GOOS ?= $(shell go env GOOS)
|
||||||
GOARCH ?= $(shell go env GOARCH)
|
GOARCH ?= $(shell go env GOARCH)
|
||||||
GOAMD64 ?= $(shell go env GOAMD64)
|
GOAMD64 ?= $(shell go env GOAMD64)
|
||||||
|
GOPATH ?= $(shell go env GOPATH)
|
||||||
|
|
||||||
FISSION-CLI-SUFFIX :=
|
FISSION-CLI-SUFFIX :=
|
||||||
ifeq ($(GOOS), windows)
|
ifeq ($(GOOS), windows)
|
||||||
@@ -51,30 +52,27 @@ test-run: code-checks
|
|||||||
|
|
||||||
### Binaries
|
### Binaries
|
||||||
build-fission-cli:
|
build-fission-cli:
|
||||||
@GOOS=$(GOOS) GOARCH=$(GOARCH) GOAMD64=$(GOAMD64) GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --rm-dist --single-target --id fission-cli
|
@GOOS=$(GOOS) GOARCH=$(GOARCH) GOAMD64=$(GOAMD64) GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --clean --single-target --id fission-cli
|
||||||
|
|
||||||
install-fission-cli:
|
install-fission-cli:
|
||||||
# TODO: Fix this hack, replace v1 with GOAMD64
|
# TODO: Fix this hack, replace v1 with GOAMD64
|
||||||
mv dist/fission-cli_$(GOOS)_$(GOARCH)_v1/fission$(FISSION-CLI-SUFFIX) /usr/local/bin/fission
|
mv dist/fission-cli_$(GOOS)_$(GOARCH)_v1/fission$(FISSION-CLI-SUFFIX) /usr/local/bin/fission
|
||||||
|
|
||||||
### Codegen
|
### Codegen
|
||||||
codegen: controller-gen-install
|
codegen:
|
||||||
@controller-gen object:headerFile="hack/boilerplate.txt" paths="./..."
|
|
||||||
@./hack/update-codegen.sh
|
@./hack/update-codegen.sh
|
||||||
|
go tool controller-gen object:headerFile="hack/boilerplate.txt" paths="./..."
|
||||||
|
|
||||||
### CRDs
|
### CRDs
|
||||||
controller-gen-install:
|
generate-crds:
|
||||||
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.10.0
|
go tool controller-gen crd \
|
||||||
|
|
||||||
generate-crds: controller-gen-install
|
|
||||||
controller-gen crd \
|
|
||||||
paths=./pkg/apis/core/v1 \
|
paths=./pkg/apis/core/v1 \
|
||||||
output:crd:artifacts:config=crds/v1
|
output:crd:artifacts:config=crds/v1
|
||||||
|
|
||||||
### Webhook generation: it generates webhook configs with help of kubebuilder:webhook tag
|
### Webhook generation: it generates webhook configs with help of kubebuilder:webhook tag
|
||||||
generate-webhooks: controller-gen-install
|
generate-webhooks:
|
||||||
controller-gen webhook \
|
go tool controller-gen webhook \
|
||||||
paths=./pkg/apis/core/v1 \
|
paths=./pkg/webhook \
|
||||||
output:dir=charts/fission-all/templates/webhook-server
|
output:dir=charts/fission-all/templates/webhook-server
|
||||||
|
|
||||||
|
|
||||||
@@ -98,12 +96,9 @@ generate-swagger-doc:
|
|||||||
generate-cli-docs:
|
generate-cli-docs:
|
||||||
go run tools/cmd-docs/main.go -o "../fission.io/content/en/docs/reference/fission-cli"
|
go run tools/cmd-docs/main.go -o "../fission.io/content/en/docs/reference/fission-cli"
|
||||||
|
|
||||||
install-crd-ref-docs:
|
generate-crd-ref-docs:
|
||||||
go install github.com/elastic/crd-ref-docs@v0.0.8
|
|
||||||
|
|
||||||
generate-crd-ref-docs: install-crd-ref-docs
|
|
||||||
# crd-ref-docs: https://github.com/elastic/crd-ref-docs
|
# crd-ref-docs: https://github.com/elastic/crd-ref-docs
|
||||||
crd-ref-docs --source-path=pkg/apis/core/v1 --config=tools/crd-ref-docs/config.yaml --renderer markdown
|
go tool crd-ref-docs --source-path=pkg/apis/core/v1 --config=tools/crd-ref-docs/config.yaml --renderer markdown
|
||||||
cp tools/crd-ref-docs/header.md crd_docs.md
|
cp tools/crd-ref-docs/header.md crd_docs.md
|
||||||
cat out.md >> crd_docs.md && rm out.md
|
cat out.md >> crd_docs.md && rm out.md
|
||||||
mv crd_docs.md ../fission.io/content/en/docs/reference/crd-reference.md
|
mv crd_docs.md ../fission.io/content/en/docs/reference/crd-reference.md
|
||||||
@@ -111,12 +106,13 @@ generate-crd-ref-docs: install-crd-ref-docs
|
|||||||
all-generators: codegen generate-crds generate-swagger-doc generate-cli-docs generate-crd-ref-docs
|
all-generators: codegen generate-crds generate-swagger-doc generate-cli-docs generate-crd-ref-docs
|
||||||
|
|
||||||
skaffold-prebuild:
|
skaffold-prebuild:
|
||||||
@GOOS=linux GOARCH=amd64 GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --rm-dist --single-target
|
@GOOS=linux GOARCH=amd64 GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --clean --single-target
|
||||||
@cp -v cmd/builder/Dockerfile dist/builder_linux_amd64_v1/Dockerfile
|
@cp -v cmd/builder/Dockerfile dist/builder_linux_amd64_v1/Dockerfile
|
||||||
@cp -v cmd/fetcher/Dockerfile dist/fetcher_linux_amd64_v1/Dockerfile
|
@cp -v cmd/fetcher/Dockerfile dist/fetcher_linux_amd64_v1/Dockerfile
|
||||||
@cp -v cmd/fission-bundle/Dockerfile dist/fission-bundle_linux_amd64_v1/Dockerfile
|
@cp -v cmd/fission-bundle/Dockerfile dist/fission-bundle_linux_amd64_v1/Dockerfile
|
||||||
@cp -v cmd/reporter/Dockerfile dist/reporter_linux_amd64_v1/Dockerfile
|
@cp -v cmd/reporter/Dockerfile dist/reporter_linux_amd64_v1/Dockerfile
|
||||||
@cp -v cmd/preupgradechecks/Dockerfile dist/pre-upgrade-checks_linux_amd64_v1/Dockerfile
|
@cp -v cmd/preupgradechecks/Dockerfile dist/pre-upgrade-checks_linux_amd64_v1/Dockerfile
|
||||||
|
@find dist/ -name 'Dockerfile' -exec sed -i.bak 's|$$TARGETPLATFORM/||g' {} +; find dist/ -name 'Dockerfile.bak' -delete
|
||||||
|
|
||||||
skaffold-deploy: skaffold-prebuild
|
skaffold-deploy: skaffold-prebuild
|
||||||
skaffold run -p $(SKAFFOLD_PROFILE)
|
skaffold run -p $(SKAFFOLD_PROFILE)
|
||||||
|
|||||||
@@ -36,12 +36,19 @@
|
|||||||
<a href="https://github.com/fission/fission">
|
<a href="https://github.com/fission/fission">
|
||||||
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/fission/fission?style=social">
|
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/fission/fission?style=social">
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://scorecard.dev/viewer/?uri=github.com/fission/fission">
|
||||||
|
<image alt="OpenSSF Scorecard" src="https://api.scorecard.dev/projects/github.com/fission/fission/badge">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.bestpractices.dev/projects/4986">
|
||||||
|
<img src="https://www.bestpractices.dev/projects/4986/badge">
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Fission is a fast serverless framework for Kubernetes with a focus on
|
Fission is an open-source, Kubernetes-native serverless framework that simplifies the deployment of functions and applications on Kubernetes. With Fission, developers can easily create and deploy serverless functions that can be triggered by a variety of events, such as HTTP requests, messages from a message queue, or scheduled tasks.
|
||||||
developer productivity and high performance.
|
|
||||||
|
Fission provides a simple, easy-to-use interface for developers to create serverless functions in their language of choice, without having to worry about the underlying infrastructure. The framework also offers automatic scaling, so functions can scale up or down based on demand, without any additional configuration.
|
||||||
|
|
||||||
Fission operates on _just the code_: Docker and Kubernetes are
|
Fission operates on _just the code_: Docker and Kubernetes are
|
||||||
abstracted away under normal operation, though you can use both to
|
abstracted away under normal operation, though you can use both to
|
||||||
@@ -87,7 +94,7 @@ aggregation — also helps with ops on your Fission deployment.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Add the stock NodeJS env to your Fission deployment
|
# Add the stock NodeJS env to your Fission deployment
|
||||||
$ fission env create --name nodejs --image fission/node-env
|
$ fission env create --name nodejs --image ghcr.io/fission/node-env
|
||||||
|
|
||||||
# Create a function with a javascript one-liner that prints "hello world"
|
# Create a function with a javascript one-liner that prints "hello world"
|
||||||
$ fission function create --name hello --env nodejs --code https://raw.githubusercontent.com/fission/examples/master/nodejs/hello.js
|
$ fission function create --name hello --env nodejs --code https://raw.githubusercontent.com/fission/examples/master/nodejs/hello.js
|
||||||
|
|||||||
+4
-4
@@ -6,12 +6,12 @@ Please refer using [latest stable release](https://github.com/fission/fission/re
|
|||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ------------------ |
|
| ------- | ------------------ |
|
||||||
| >=1.14.x | :white_check_mark: |
|
| >=1.20.x | :white_check_mark: |
|
||||||
| < 1.14.0 | :x: |
|
| < 1.20.0 | :x: |
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
Please send the details to both of us:
|
Please send the details to both of us:
|
||||||
|
|
||||||
- Sanket Sudake sanket@infracloud.io
|
- Sanket Sudake sanket[at]infracloud.io
|
||||||
- Vishal Biyani vishal@infracloud.io
|
- Vishal Biyani vishal[at]infracloud.io
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: fission-all
|
name: fission-all
|
||||||
version: v1.19.0-rc2
|
version: 1.22.0
|
||||||
appVersion: v1.19.0-rc2
|
appVersion: v1.22.0
|
||||||
description: Fission is a fast serverless framework for Kubernetes.
|
description: Fission is a fast serverless framework for Kubernetes.
|
||||||
|
kubeVersion: ">=1.28.0-0"
|
||||||
home: https://fission.io/
|
home: https://fission.io/
|
||||||
icon: https://fission.io/images/fission-logo-white.svg
|
icon: https://fission.io/images/fission-logo-white.svg
|
||||||
sources:
|
sources:
|
||||||
@@ -20,5 +21,8 @@ maintainers:
|
|||||||
email: vishal@infracloud.io
|
email: vishal@infracloud.io
|
||||||
- name: Sanket Sudake
|
- name: Sanket Sudake
|
||||||
email: sanket@infracloud.io
|
email: sanket@infracloud.io
|
||||||
engine: gotpl
|
type: application
|
||||||
type: application
|
annotations:
|
||||||
|
artifacthub.io/signKey: |
|
||||||
|
fingerprint: 2EAE29FDF8A387050C82CD5ABBDD4FD6A1FFCBF6
|
||||||
|
url: https://raw.githubusercontent.com/fission/fission-charts/main/public_key/pgp_keys.asc
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- Kubernetes 1.19+
|
- Kubernetes 1.28+
|
||||||
- Helm 3+
|
- Helm 3+
|
||||||
|
|
||||||
## Get Repo Info
|
## Get Repo Info
|
||||||
@@ -93,6 +93,25 @@ _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documen
|
|||||||
|
|
||||||
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.
|
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.
|
||||||
|
|
||||||
|
### Upgrade from 1.18.x to 1.20.x
|
||||||
|
|
||||||
|
We have removed controller service from fission-all chart.
|
||||||
|
|
||||||
|
### Upgrade from 1.17.x to 1.18.x
|
||||||
|
|
||||||
|
With 1.18.x, we have major change in the way we are deploying Fission.
|
||||||
|
We have added parameters `defaultNamespace`, `additionalFissionNamespaces`, `functionNamespace` and `builderNamespace` to manage the namespaces.
|
||||||
|
We watch and manage specific namespaces for Fission resources configured via `defaultNamespace` and `additionalFissionNamespaces` parameters.
|
||||||
|
You dont need to worry about `builderNamespace` and `functionNamespace` parameters, unless you want to consider legacy Fission resources.
|
||||||
|
|
||||||
|
Please refer to [core changes](https://fission.io/docs/releases/v1.18.0/#fission-core-changes) for more details.
|
||||||
|
|
||||||
|
### Upgrade from 1.16.x to 1.17.x
|
||||||
|
|
||||||
|
By default, Fission runs with the default security context. This means that it will be run as root. We have added settings in Helm chart for securityContext across all services in Fission. You can enable recommended securityContext settings during Fission installation.
|
||||||
|
|
||||||
|
Please refer to [security context settings](https://fission.io/docs/releases/v1.17.0/#security-context-setting-for-fission-installation) for more details.
|
||||||
|
|
||||||
### Upgrade from 1.15.x to 1.16.x
|
### Upgrade from 1.15.x to 1.16.x
|
||||||
|
|
||||||
If you have been using `prometheus.enabled=true` in your fission-all chart, you will need to deploy the prometheus using prometheus community supported chart.
|
If you have been using `prometheus.enabled=true` in your fission-all chart, you will need to deploy the prometheus using prometheus community supported chart.
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{{ template "deprecationWarnings" . }}
|
||||||
|
|
||||||
1. Install the client CLI.
|
1. Install the client CLI.
|
||||||
|
|
||||||
Mac:
|
Mac:
|
||||||
@@ -11,14 +13,20 @@ Windows:
|
|||||||
|
|
||||||
2. You're ready to use Fission!
|
2. You're ready to use Fission!
|
||||||
|
|
||||||
|
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
||||||
|
You can create fission resources in the namespaces "{{ .Values.defaultNamespace }},{{ join "," .Values.additionalFissionNamespaces }}"
|
||||||
|
{{- else }}
|
||||||
|
You can create fission resources in the namespace "{{ .Values.defaultNamespace }}"
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
# Create an environment
|
# Create an environment
|
||||||
$ fission env create --name nodejs --image fission/node-env
|
$ fission env create --name nodejs --image ghcr.io/fission/node-env --namespace {{ .Values.defaultNamespace }}
|
||||||
|
|
||||||
# Get a hello world
|
# Get a hello world
|
||||||
$ curl https://raw.githubusercontent.com/fission/examples/master/nodejs/hello.js > hello.js
|
$ curl https://raw.githubusercontent.com/fission/examples/master/nodejs/hello.js > hello.js
|
||||||
|
|
||||||
# Register this function with Fission
|
# Register this function with Fission
|
||||||
$ fission function create --name hello --env nodejs --code hello.js
|
$ fission function create --name hello --env nodejs --code hello.js --namespace {{ .Values.defaultNamespace }}
|
||||||
|
|
||||||
{{- if .Values.authentication.enabled }}
|
{{- if .Values.authentication.enabled }}
|
||||||
|
|
||||||
@@ -29,6 +37,6 @@ Windows:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
# Run this function
|
# Run this function
|
||||||
$ fission function test --name hello
|
$ fission function test --name hello --namespace {{ .Values.defaultNamespace }}
|
||||||
Hello, world!
|
Hello, world!
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{{- define "deprecationWarnings" -}}
|
||||||
|
{{- $deprecations := list -}}
|
||||||
|
|
||||||
|
{{- if .Values.builderNamespace -}}
|
||||||
|
{{- $deprecations = append $deprecations "The 'builderNamespace' parameter is deprecated and will be removed in future release." -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .Values.functionNamespace -}}
|
||||||
|
{{- $deprecations = append $deprecations "The 'functionNamespace' parameter is deprecated and will be removed in future release." -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if .Values.disableOwnerReference -}}
|
||||||
|
{{- $deprecations = append $deprecations "The 'disableOwnerReference' flag is temporary addition and will be removed in future release." -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if $deprecations -}}
|
||||||
|
{{- range $deprecations }}
|
||||||
|
{{- printf "WARNING: %s" . | nindent 0 }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@@ -15,28 +15,6 @@ rules:
|
|||||||
- patch
|
- patch
|
||||||
- delete
|
- delete
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- define "controller-rules" }}
|
|
||||||
rules:
|
|
||||||
- apiGroups:
|
|
||||||
- fission.io
|
|
||||||
resources:
|
|
||||||
- canaryconfigs
|
|
||||||
- environments
|
|
||||||
- functions
|
|
||||||
- httptriggers
|
|
||||||
- kuberneteswatchtriggers
|
|
||||||
- messagequeuetriggers
|
|
||||||
- packages
|
|
||||||
- timetriggers
|
|
||||||
verbs:
|
|
||||||
- create
|
|
||||||
- get
|
|
||||||
- list
|
|
||||||
- watch
|
|
||||||
- update
|
|
||||||
- patch
|
|
||||||
- delete
|
|
||||||
{{- end }}
|
|
||||||
{{- define "executor-rules" }}
|
{{- define "executor-rules" }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
|
|||||||
@@ -63,44 +63,6 @@ rules:
|
|||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- define "controller-kuberules" }}
|
|
||||||
rules:
|
|
||||||
- apiGroups:
|
|
||||||
- ""
|
|
||||||
resources:
|
|
||||||
- services
|
|
||||||
verbs:
|
|
||||||
- list
|
|
||||||
- apiGroups:
|
|
||||||
- ""
|
|
||||||
resources:
|
|
||||||
- configmaps
|
|
||||||
- secrets
|
|
||||||
verbs:
|
|
||||||
- get
|
|
||||||
- apiGroups:
|
|
||||||
- ""
|
|
||||||
resources:
|
|
||||||
- namespaces
|
|
||||||
verbs:
|
|
||||||
- get
|
|
||||||
- apiGroups:
|
|
||||||
- ""
|
|
||||||
resources:
|
|
||||||
- pods
|
|
||||||
verbs:
|
|
||||||
- get
|
|
||||||
- list
|
|
||||||
- watch
|
|
||||||
- apiGroups:
|
|
||||||
- apiextensions.k8s.io
|
|
||||||
resources:
|
|
||||||
- customresourcedefinitions
|
|
||||||
verbs:
|
|
||||||
- get
|
|
||||||
- list
|
|
||||||
- watch
|
|
||||||
{{- end }}
|
|
||||||
{{- define "executor-kuberules" }}
|
{{- define "executor-kuberules" }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
@@ -109,7 +71,6 @@ rules:
|
|||||||
- pods
|
- pods
|
||||||
- services
|
- services
|
||||||
- replicationcontrollers
|
- replicationcontrollers
|
||||||
- events
|
|
||||||
verbs:
|
verbs:
|
||||||
- create
|
- create
|
||||||
- delete
|
- delete
|
||||||
@@ -117,6 +78,16 @@ rules:
|
|||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
- patch
|
- patch
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- events
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- patch
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- ""
|
- ""
|
||||||
resources:
|
resources:
|
||||||
@@ -289,7 +260,6 @@ rules:
|
|||||||
- pods
|
- pods
|
||||||
- services
|
- services
|
||||||
- replicationcontrollers
|
- replicationcontrollers
|
||||||
- events
|
|
||||||
verbs:
|
verbs:
|
||||||
- create
|
- create
|
||||||
- delete
|
- delete
|
||||||
@@ -297,6 +267,16 @@ rules:
|
|||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
- patch
|
- patch
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- events
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- patch
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- ""
|
- ""
|
||||||
resources:
|
resources:
|
||||||
@@ -374,6 +354,8 @@ rules:
|
|||||||
# TODO: Kept for future in case preupgrade needs any permissions in the future
|
# TODO: Kept for future in case preupgrade needs any permissions in the future
|
||||||
rules: []
|
rules: []
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
# TODO: Currently, router needs ingress related permissions only.
|
||||||
|
# In future if router's permissions are modified then check the configured namespace.
|
||||||
{{- define "router-kuberules" }}
|
{{- define "router-kuberules" }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
|
|||||||
@@ -17,9 +17,6 @@ metadata:
|
|||||||
{{- if eq "canaryconfig" .component }}
|
{{- if eq "canaryconfig" .component }}
|
||||||
{{- include "canaryconfig-kuberules" . }}
|
{{- include "canaryconfig-kuberules" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq "controller" .component }}
|
|
||||||
{{- include "controller-kuberules" . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq "fluentbit" .component }}
|
{{- if eq "fluentbit" .component }}
|
||||||
{{- include "fluentbit-kuberules" . }}
|
{{- include "fluentbit-kuberules" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ metadata:
|
|||||||
{{- if eq "buildermgr" .component }}
|
{{- if eq "buildermgr" .component }}
|
||||||
{{- include "buildermgr-rules" . }}
|
{{- include "buildermgr-rules" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq "controller" .component }}
|
|
||||||
{{- include "controller-rules" . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq "executor" .component }}
|
{{- if eq "executor" .component }}
|
||||||
{{- include "executor-rules" . }}
|
{{- include "executor-rules" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -37,38 +37,37 @@ auth:
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
This template generates the image name for the deployment depending on the value of "repository" field in values.yaml file.
|
Helper template to construct image names with repository and tag
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "fission-bundleImage" -}}
|
{{- define "imageWithTag" -}}
|
||||||
{{- if .Values.repository -}}
|
{{- $repository := index . 0 -}}
|
||||||
{{- if eq .Values.imageTag "" -}}
|
{{- $image := index . 1 -}}
|
||||||
{{ .Values.repository }}/{{ .Values.image }}
|
{{- $tag := index . 2 -}}
|
||||||
{{- else -}}
|
{{- if $repository -}}
|
||||||
{{ .Values.repository }}/{{ .Values.image }}:{{ .Values.imageTag }}
|
{{- printf "%s/%s%s" $repository $image (ne $tag "" | ternary (printf ":%s" $tag) "") -}}
|
||||||
{{- end }}
|
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- if eq .Values.imageTag "" -}}
|
{{- printf "%s%s" $image (ne $tag "" | ternary (printf ":%s" $tag) "") -}}
|
||||||
{{ .Values.image }}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- end -}}
|
||||||
{{ .Values.image }}:{{ .Values.imageTag }}
|
|
||||||
{{- end }}
|
{{- define "fission-bundleImage" -}}
|
||||||
{{- end }}
|
{{- $args := list .Values.repository .Values.image .Values.imageTag -}}
|
||||||
|
{{- include "imageWithTag" $args -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "reporterImage" -}}
|
{{- define "reporterImage" -}}
|
||||||
{{- if .Values.repository -}}
|
{{- $args := list .Values.repository .Values.postInstallReportImage .Values.imageTag -}}
|
||||||
{{- if eq .Values.imageTag "" -}}
|
{{- include "imageWithTag" $args -}}
|
||||||
{{ .Values.repository }}/{{ .Values.postInstallReportImage }}
|
{{- end -}}
|
||||||
{{- else -}}
|
|
||||||
{{ .Values.repository }}/{{ .Values.postInstallReportImage }}:{{ .Values.imageTag }}
|
{{- define "fetcherImage" -}}
|
||||||
{{- end }}
|
{{- $args := list (.Values.fetcher.repository | default .Values.repository) .Values.fetcher.image .Values.fetcher.imageTag -}}
|
||||||
{{- else -}}
|
{{- include "imageWithTag" $args -}}
|
||||||
{{- if eq .Values.imageTag "" -}}
|
{{- end -}}
|
||||||
{{ .Values.postInstallReportImage }}
|
|
||||||
{{- else -}}
|
{{- define "preUpgradeChecksImage" -}}
|
||||||
{{ .Values.postInstallReportImage }}:{{ .Values.imageTag }}
|
{{- $args := list (.Values.preUpgradeChecks.repository | default .Values.repository) .Values.preUpgradeChecks.image .Values.preUpgradeChecks.imageTag -}}
|
||||||
{{- end }}
|
{{- include "imageWithTag" $args -}}
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "opentelemtry.envs" }}
|
{{- define "opentelemtry.envs" }}
|
||||||
@@ -89,6 +88,12 @@ This template generates the image name for the deployment depending on the value
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- define "fission-resource-namespace.envs" }}
|
{{- define "fission-resource-namespace.envs" }}
|
||||||
|
- name: FISSION_BUILDER_NAMESPACE
|
||||||
|
value: "{{ .Values.builderNamespace }}"
|
||||||
|
- name: FISSION_FUNCTION_NAMESPACE
|
||||||
|
value: "{{ .Values.functionNamespace }}"
|
||||||
|
- name: FISSION_DEFAULT_NAMESPACE
|
||||||
|
value: "{{ .Values.defaultNamespace }}"
|
||||||
- name: FISSION_RESOURCE_NAMESPACES
|
- name: FISSION_RESOURCE_NAMESPACES
|
||||||
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
||||||
value: "{{ .Values.defaultNamespace }},{{ join "," .Values.additionalFissionNamespaces }}"
|
value: "{{ .Values.defaultNamespace }},{{ join "," .Values.additionalFissionNamespaces }}"
|
||||||
@@ -97,6 +102,13 @@ This template generates the image name for the deployment depending on the value
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "kube_client.envs" }}
|
||||||
|
- name: KUBE_CLIENT_QPS
|
||||||
|
value: "{{ .Values.kubernetesClientQPS }}"
|
||||||
|
- name: KUBE_CLIENT_BURST
|
||||||
|
value: "{{ .Values.kubernetesClientBurst }}"
|
||||||
|
{{- end}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Define the svc's name
|
Define the svc's name
|
||||||
*/}}
|
*/}}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "fullname" . }}-{{ .Chart.Version }}
|
name: {{ template "fullname" . }}-{{ .Chart.Version }}-post-install
|
||||||
labels:
|
labels:
|
||||||
# The "release" convention makes it easy to tie a release to all of the
|
# The "release" convention makes it easy to tie a release to all of the
|
||||||
# Kubernetes resources that were created as part of that release.
|
# Kubernetes resources that were created as part of that release.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "fullname" . }}-{{ .Chart.Version }}
|
name: {{ template "fullname" . }}-{{ .Chart.Version }}-post-upgrade
|
||||||
labels:
|
labels:
|
||||||
# The "release" convention makes it easy to tie a release to all of the
|
# The "release" convention makes it easy to tie a release to all of the
|
||||||
# Kubernetes resources that were created as part of that release.
|
# Kubernetes resources that were created as part of that release.
|
||||||
|
|||||||
@@ -30,21 +30,11 @@ spec:
|
|||||||
args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}"]
|
args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: FETCHER_IMAGE
|
- name: FETCHER_IMAGE
|
||||||
{{- if eq .Values.fetcher.imageTag "" }}
|
value: {{ include "fetcherImage" . | quote }}
|
||||||
value: "{{ .Values.fetcher.image }}"
|
|
||||||
{{- else }}
|
|
||||||
value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}"
|
|
||||||
{{- end }}
|
|
||||||
- name: FETCHER_IMAGE_PULL_POLICY
|
- name: FETCHER_IMAGE_PULL_POLICY
|
||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: BUILDER_IMAGE_PULL_POLICY
|
- name: BUILDER_IMAGE_PULL_POLICY
|
||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: FISSION_BUILDER_NAMESPACE
|
|
||||||
value: "{{ .Values.builderNamespace }}"
|
|
||||||
- name: FISSION_FUNCTION_NAMESPACE
|
|
||||||
value: "{{ .Values.functionNamespace }}"
|
|
||||||
- name: FISSION_DEFAULT_NAMESPACE
|
|
||||||
value: "{{ .Values.defaultNamespace }}"
|
|
||||||
- name: ENABLE_ISTIO
|
- name: ENABLE_ISTIO
|
||||||
value: "{{ .Values.enableIstio }}"
|
value: "{{ .Values.enableIstio }}"
|
||||||
- name: FETCHER_MINCPU
|
- name: FETCHER_MINCPU
|
||||||
@@ -57,11 +47,14 @@ spec:
|
|||||||
value: {{ .Values.fetcher.resource.mem.limits | quote }}
|
value: {{ .Values.fetcher.resource.mem.limits | quote }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
|
- name: DISABLE_OWNER_REFERENCES
|
||||||
|
value: {{ .Values.disableOwnerReference | quote }}
|
||||||
- name: PPROF_ENABLED
|
- name: PPROF_ENABLED
|
||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
- name: HELM_RELEASE_NAME
|
- name: HELM_RELEASE_NAME
|
||||||
value: {{ .Release.Name | quote }}
|
value: {{ .Release.Name | quote }}
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
{{- if .Values.builderPodSpec.enabled }}
|
{{- if .Values.builderPodSpec.enabled }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ spec:
|
|||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
- name: PPROF_ENABLED
|
- name: PPROF_ENABLED
|
||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
- name: POD_NAMESPACE
|
- name: POD_NAMESPACE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
|
|||||||
@@ -1,102 +0,0 @@
|
|||||||
{{- if .Values.controller.enabled }}
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: controller
|
|
||||||
labels:
|
|
||||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
||||||
svc: controller
|
|
||||||
application: fission-api
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
svc: controller
|
|
||||||
application: fission-api
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
svc: controller
|
|
||||||
application: fission-api
|
|
||||||
annotations:
|
|
||||||
prometheus.io/scrape: "true"
|
|
||||||
prometheus.io/path: "/metrics"
|
|
||||||
prometheus.io/port: "8080"
|
|
||||||
spec:
|
|
||||||
{{- if .Values.controller.securityContext.enabled }}
|
|
||||||
securityContext: {{- omit .Values.controller.securityContext "enabled" | toYaml | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
|
||||||
- name: controller
|
|
||||||
image: {{ include "fission-bundleImage" . | quote }}
|
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
|
||||||
command: ["/fission-bundle"]
|
|
||||||
args: ["--controllerPort", "8888"]
|
|
||||||
env:
|
|
||||||
- name: FISSION_DEFAULT_NAMESPACE
|
|
||||||
value: "{{ .Values.defaultNamespace }}"
|
|
||||||
- name: FISSION_BUILDER_NAMESPACE
|
|
||||||
value: "{{ .Values.builderNamespace }}"
|
|
||||||
- name: FISSION_FUNCTION_NAMESPACE
|
|
||||||
value: "{{ .Values.functionNamespace }}"
|
|
||||||
- name: DEBUG_ENV
|
|
||||||
value: {{ .Values.debugEnv | quote }}
|
|
||||||
- name: PPROF_ENABLED
|
|
||||||
value: {{ .Values.pprof.enabled | quote }}
|
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
|
||||||
- name: POD_NAMESPACE
|
|
||||||
valueFrom:
|
|
||||||
fieldRef:
|
|
||||||
fieldPath: metadata.namespace
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
|
||||||
resources:
|
|
||||||
{{- toYaml .Values.controller.resources | nindent 10 }}
|
|
||||||
{{- if .Values.terminationMessagePath }}
|
|
||||||
terminationMessagePath: {{ .Values.terminationMessagePath }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.terminationMessagePolicy }}
|
|
||||||
terminationMessagePolicy: {{ .Values.terminationMessagePolicy }}
|
|
||||||
{{- end }}
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: "/healthz"
|
|
||||||
port: 8888
|
|
||||||
initialDelaySeconds: 1
|
|
||||||
periodSeconds: 1
|
|
||||||
failureThreshold: 30
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: "/healthz"
|
|
||||||
port: 8888
|
|
||||||
initialDelaySeconds: 35
|
|
||||||
periodSeconds: 5
|
|
||||||
volumeMounts:
|
|
||||||
- name: config-volume
|
|
||||||
mountPath: /etc/config/config.yaml
|
|
||||||
subPath: config.yaml
|
|
||||||
ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: metrics
|
|
||||||
- containerPort: 8888
|
|
||||||
name: http
|
|
||||||
{{- if .Values.pprof.enabled }}
|
|
||||||
- containerPort: 6060
|
|
||||||
name: pprof
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
serviceAccountName: fission-controller
|
|
||||||
volumes:
|
|
||||||
- name: config-volume
|
|
||||||
configMap:
|
|
||||||
name: feature-config
|
|
||||||
{{- if .Values.priorityClassName }}
|
|
||||||
priorityClassName: {{ .Values.priorityClassName }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.imagePullSecrets }}
|
|
||||||
imagePullSecrets:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{{- if .Values.controller.enabled }}
|
|
||||||
{{- include "fission-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "controller") .) }}
|
|
||||||
|
|
||||||
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
|
||||||
{{- range $namespace := $.Values.additionalFissionNamespaces }}
|
|
||||||
{{ include "fission-role-generator" (merge (dict "namespace" $namespace "component" "controller") $) }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{{- include "kubernetes-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "controller") .) }}
|
|
||||||
|
|
||||||
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
|
||||||
{{- range $namespace := $.Values.additionalFissionNamespaces }}
|
|
||||||
{{ include "kubernetes-role-generator" (merge (dict "namespace" $namespace "component" "controller") $) }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.builderNamespace -}}
|
|
||||||
{{ include "kubernetes-role-generator" (merge (dict "namespace" .Values.builderNamespace "component" "controller") $) }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.functionNamespace -}}
|
|
||||||
{{ include "kubernetes-role-generator" (merge (dict "namespace" .Values.functionNamespace "component" "controller") $) }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{{- if .Values.controller.enabled }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: fission-controller
|
|
||||||
namespace: {{ .Release.Namespace }}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{{- if .Values.controller.enabled }}
|
|
||||||
{{- if .Values.serviceMonitor.enabled }}
|
|
||||||
apiVersion: monitoring.coreos.com/v1
|
|
||||||
kind: ServiceMonitor
|
|
||||||
metadata:
|
|
||||||
name: controller-monitor
|
|
||||||
{{- if .Values.serviceMonitor.namespace }}
|
|
||||||
namespace: {{ .Values.serviceMonitor.namespace }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
|
|
||||||
labels:
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
namespaceSelector:
|
|
||||||
matchNames:
|
|
||||||
- {{ .Release.Namespace }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
svc: controller
|
|
||||||
endpoints:
|
|
||||||
- targetPort: 8080
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
{{- if .Values.controller.enabled }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: controller
|
|
||||||
labels:
|
|
||||||
svc: controller
|
|
||||||
application: fission-api
|
|
||||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
||||||
spec:
|
|
||||||
type: {{ .Values.serviceType }}
|
|
||||||
ports:
|
|
||||||
- port: 80
|
|
||||||
targetPort: 8888
|
|
||||||
{{- if eq .Values.serviceType "NodePort" }}
|
|
||||||
nodePort: {{ .Values.controllerPort }}
|
|
||||||
{{- end }}
|
|
||||||
selector:
|
|
||||||
svc: controller
|
|
||||||
{{- end -}}
|
|
||||||
@@ -30,19 +30,9 @@ spec:
|
|||||||
args: ["--executorPort", "8888"]
|
args: ["--executorPort", "8888"]
|
||||||
env:
|
env:
|
||||||
- name: FETCHER_IMAGE
|
- name: FETCHER_IMAGE
|
||||||
{{- if eq .Values.fetcher.imageTag "" }}
|
value: {{ include "fetcherImage" . | quote }}
|
||||||
value: "{{ .Values.fetcher.image }}"
|
|
||||||
{{- else }}
|
|
||||||
value: "{{ .Values.fetcher.image }}:{{ .Values.fetcher.imageTag }}"
|
|
||||||
{{- end }}
|
|
||||||
- name: FETCHER_IMAGE_PULL_POLICY
|
- name: FETCHER_IMAGE_PULL_POLICY
|
||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: FISSION_BUILDER_NAMESPACE
|
|
||||||
value: "{{ .Values.builderNamespace }}"
|
|
||||||
- name: FISSION_FUNCTION_NAMESPACE
|
|
||||||
value: "{{ .Values.functionNamespace }}"
|
|
||||||
- name: FISSION_DEFAULT_NAMESPACE
|
|
||||||
value: "{{ .Values.defaultNamespace }}"
|
|
||||||
- name: RUNTIME_IMAGE_PULL_POLICY
|
- name: RUNTIME_IMAGE_PULL_POLICY
|
||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: ADOPT_EXISTING_RESOURCES
|
- name: ADOPT_EXISTING_RESOURCES
|
||||||
@@ -82,8 +72,11 @@ spec:
|
|||||||
value: {{ .Values.executor.serviceAccountCheck.enabled | quote }}
|
value: {{ .Values.executor.serviceAccountCheck.enabled | quote }}
|
||||||
- name: SERVICEACCOUNT_CHECK_INTERVAL
|
- name: SERVICEACCOUNT_CHECK_INTERVAL
|
||||||
value: {{ .Values.executor.serviceAccountCheck.interval | quote }}
|
value: {{ .Values.executor.serviceAccountCheck.interval | quote }}
|
||||||
|
- name: DISABLE_OWNER_REFERENCES
|
||||||
|
value: {{ .Values.disableOwnerReference | quote }}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
- name: HELM_RELEASE_NAME
|
- name: HELM_RELEASE_NAME
|
||||||
value: {{ .Release.Name | quote }}
|
value: {{ .Release.Name | quote }}
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ spec:
|
|||||||
fieldRef:
|
fieldRef:
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
fieldPath: spec.nodeName
|
fieldPath: spec.nodeName
|
||||||
|
{{- include "fission-resource-namespace.envs" . | indent 12 }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--logger"]
|
args: ["--logger"]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
@@ -127,10 +128,8 @@ spec:
|
|||||||
- name: docker-log
|
- name: docker-log
|
||||||
mountPath: /var/lib/docker/containers
|
mountPath: /var/lib/docker/containers
|
||||||
readOnly: true
|
readOnly: true
|
||||||
{{- if .Values.logger.enableSecurityContext }}
|
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
{{- toYaml .Values.logger.securityContext | nindent 12 }}
|
||||||
{{- end }}
|
|
||||||
- name: fluentbit
|
- name: fluentbit
|
||||||
{{- if .Values.repository }}
|
{{- if .Values.repository }}
|
||||||
image: "{{ .Values.logger.fluentdImageRepository }}/{{ .Values.logger.fluentdImage }}:{{ .Values.logger.fluentdImageTag }}"
|
image: "{{ .Values.logger.fluentdImageRepository }}/{{ .Values.logger.fluentdImage }}:{{ .Values.logger.fluentdImageTag }}"
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ spec:
|
|||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
- name: PPROF_ENABLED
|
- name: PPROF_ENABLED
|
||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.kubewatcher.resources | nindent 10 }}
|
{{- toYaml .Values.kubewatcher.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ spec:
|
|||||||
- name: REDIS_IMAGE
|
- name: REDIS_IMAGE
|
||||||
value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}"
|
value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}"
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.mqt_keda.resources | nindent 10 }}
|
{{- toYaml .Values.mqt_keda.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -28,15 +28,12 @@ spec:
|
|||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
containers:
|
containers:
|
||||||
- name: pre-upgrade-job
|
- name: pre-upgrade-job
|
||||||
{{- if .Values.preUpgradeChecks.imageTag }}
|
image: {{ include "preUpgradeChecksImage" . | quote }}
|
||||||
image: {{ .Values.preUpgradeChecks.image }}:{{ .Values.preUpgradeChecks.imageTag }}
|
|
||||||
{{- else }}
|
|
||||||
image: {{ .Values.preUpgradeChecks.image }}
|
|
||||||
{{- end }}
|
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: [ "/pre-upgrade-checks" ]
|
command: [ "/pre-upgrade-checks" ]
|
||||||
env:
|
env:
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
{{- if .Values.terminationMessagePath }}
|
{{- if .Values.terminationMessagePath }}
|
||||||
terminationMessagePath: {{ .Values.terminationMessagePath }}
|
terminationMessagePath: {{ .Values.terminationMessagePath }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ metadata:
|
|||||||
application: fission-router
|
application: fission-router
|
||||||
spec:
|
spec:
|
||||||
{{- if not .Values.router.deployAsDaemonSet }}
|
{{- if not .Values.router.deployAsDaemonSet }}
|
||||||
replicas: 1
|
replicas: {{ .Values.router.replicas | default 1 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
@@ -83,7 +83,8 @@ spec:
|
|||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
- name: DISPLAY_ACCESS_LOG
|
- name: DISPLAY_ACCESS_LOG
|
||||||
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.router.resources | nindent 10 }}
|
{{- toYaml .Values.router.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
{{- include "kubernetes-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "router") .) }}
|
|
||||||
{{- include "kubernetes-role-generator" (merge (dict "namespace" .Release.Namespace "component" "router") .) }}
|
{{- include "kubernetes-role-generator" (merge (dict "namespace" .Release.Namespace "component" "router") .) }}
|
||||||
|
|
||||||
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
username: {{ .Values.authentication.authUsername | b64enc | quote }}
|
username: {{ .Values.authentication.authUsername | b64enc | quote }}
|
||||||
password: {{ randAlphaNum 20 | b64enc | quote }}
|
password: {{ randAlphaNum 20 | b64enc | quote }}
|
||||||
jwtSigningKey: {{ .Values.authentication.jwtSigningKey | b64enc | quote }}
|
jwtSigningKey: {{ default (randAlphaNum 20) .Values.authentication.jwtSigningKey | b64enc | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -12,6 +12,12 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
svc: storagesvc
|
svc: storagesvc
|
||||||
application: fission-storage
|
application: fission-storage
|
||||||
|
strategy:
|
||||||
|
type: {{ .Values.storagesvc.deploymentStrategy.type }}
|
||||||
|
{{- if eq .Values.storagesvc.deploymentStrategy.type "RollingUpdate" }}
|
||||||
|
rollingUpdate:
|
||||||
|
{{- toYaml .Values.storagesvc.deploymentStrategy.rollingUpdate | nindent 6}}
|
||||||
|
{{- end }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -61,6 +67,7 @@ spec:
|
|||||||
value: {{ .Values.persistence.s3.region }}
|
value: {{ .Values.persistence.s3.region }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.storagesvc.resources | nindent 10 }}
|
{{- toYaml .Values.storagesvc.resources | nindent 10 }}
|
||||||
@@ -112,7 +119,7 @@ spec:
|
|||||||
priorityClassName: {{ .Values.priorityClassName }}
|
priorityClassName: {{ .Values.priorityClassName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.imagePullSecrets }}
|
{{- with .Values.imagePullSecrets }}
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ spec:
|
|||||||
- name: PPROF_ENABLED
|
- name: PPROF_ENABLED
|
||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||||
|
{{- include "kube_client.envs" . | indent 8 }}
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.timer.resources | nindent 10 }}
|
{{- toYaml .Values.timer.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
name: metrics
|
name: metrics
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.webhook.resources | nindent 10 }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: serving-certs
|
- name: serving-certs
|
||||||
secret:
|
secret:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ apiVersion: admissionregistration.k8s.io/v1
|
|||||||
kind: MutatingWebhookConfiguration
|
kind: MutatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: mutating-webhook-configuration
|
name: fission-mutating-webhooks
|
||||||
{{- if $certManagerEnabled }}
|
{{- if $certManagerEnabled }}
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/fission-webhook-cert"
|
cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/fission-webhook-cert"
|
||||||
@@ -49,7 +49,7 @@ apiVersion: admissionregistration.k8s.io/v1
|
|||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: validating-webhook-configuration
|
name: fission-validating-webhooks
|
||||||
{{- if $certManagerEnabled }}
|
{{- if $certManagerEnabled }}
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/fission-webhook-cert"
|
cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/fission-webhook-cert"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
## Fission chart configuration
|
## Fission chart configuration
|
||||||
##
|
##
|
||||||
|
|
||||||
## serviceType to consider while creating Fission Controller service.
|
## serviceType to consider while creating Fission webhook service.
|
||||||
## For minikube/kind, set this to NodePort, elsewhere use LoadBalancer or ClusterIP.
|
## For minikube/kind, set this to NodePort, elsewhere use LoadBalancer or ClusterIP.
|
||||||
##
|
##
|
||||||
serviceType: ClusterIP
|
serviceType: ClusterIP
|
||||||
@@ -25,13 +25,13 @@ image: fission/fission-bundle
|
|||||||
## It is also used by the chart to identify version of the few more images apart from fission-bundle.
|
## It is also used by the chart to identify version of the few more images apart from fission-bundle.
|
||||||
## Keep it empty for using latest tag.
|
## Keep it empty for using latest tag.
|
||||||
##
|
##
|
||||||
imageTag: v1.19.0-rc2
|
imageTag: v1.22.0
|
||||||
|
|
||||||
## pullPolicy represents the pull policy to use for images in the chart.
|
## pullPolicy represents the pull policy to use for images in the chart.
|
||||||
##
|
##
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
## imageppullsecrets
|
## imagepullsecrets
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
## priorityClassName represents the priority class name to use for Fission components.
|
## priorityClassName represents the priority class name to use for Fission components.
|
||||||
@@ -53,10 +53,6 @@ terminationMessagePath: /dev/termination-log
|
|||||||
##
|
##
|
||||||
terminationMessagePolicy: File
|
terminationMessagePolicy: File
|
||||||
|
|
||||||
## controllerPort represents the port at which the Fission controller service should be exposed.
|
|
||||||
##
|
|
||||||
controllerPort: 31313
|
|
||||||
|
|
||||||
## routerPort represents the port at which the Fission Router service should be exposed.
|
## routerPort represents the port at which the Fission Router service should be exposed.
|
||||||
##
|
##
|
||||||
routerPort: 31314
|
routerPort: 31314
|
||||||
@@ -71,16 +67,20 @@ defaultNamespace: default
|
|||||||
## if builderNamespace is set to empty then builder resources will be created in the same namespace as the Fission resources.
|
## if builderNamespace is set to empty then builder resources will be created in the same namespace as the Fission resources.
|
||||||
## This is different from the release namespace.
|
## This is different from the release namespace.
|
||||||
##
|
##
|
||||||
|
## Note: This parameter is deprecated and will be removed in future fission releases.
|
||||||
|
##
|
||||||
builderNamespace: ""
|
builderNamespace: ""
|
||||||
|
|
||||||
## functionNamespace represents the namespace in which Fission Function resources will be created.
|
## functionNamespace represents the namespace in which Fission Function resources will be created.
|
||||||
## if functionNamespace is set to empty then function resources will be created in the same namespace as the Fission resources.
|
## if functionNamespace is set to empty then function resources will be created in the same namespace as the Fission resources.
|
||||||
## This is different from the release namespace.
|
## This is different from the release namespace.
|
||||||
##
|
##
|
||||||
|
## Note: This parameter is deprecated and will be removed in future fission releases.
|
||||||
|
##
|
||||||
functionNamespace: ""
|
functionNamespace: ""
|
||||||
|
|
||||||
## Fission will watch the following namespaces along with the `defaultNamespace` for fission custom resources.
|
## Fission will watch the following namespaces along with the `defaultNamespace` for fission custom resources.
|
||||||
## additionalFissionNamespaces:
|
## additionalFissionNamespaces:
|
||||||
## - namespace1
|
## - namespace1
|
||||||
## - namespace2
|
## - namespace2
|
||||||
## - namespace3
|
## - namespace3
|
||||||
@@ -92,18 +92,39 @@ additionalFissionNamespaces: []
|
|||||||
##
|
##
|
||||||
createNamespace: true
|
createNamespace: true
|
||||||
|
|
||||||
|
## disableOwnerReference decides to set OwnerReference to K8s resources like deployment, services, hpa etc. created by Fission.
|
||||||
|
## If set to true, the K8s resources created by Fission will not have OwnerReference set.
|
||||||
|
## Set to false if you want to add OwnerReference to K8s resources created by Fission.
|
||||||
|
##
|
||||||
|
## Set to true if you are using cross namespace meaning `builderNamespace` and `functionNamespace` are set.
|
||||||
|
##
|
||||||
|
## Note: This flag is temporary addition and would be removed in future fission releases.
|
||||||
|
##
|
||||||
|
disableOwnerReference: false
|
||||||
|
|
||||||
## enableIstio indicates whether to enable istio integration.
|
## enableIstio indicates whether to enable istio integration.
|
||||||
##
|
##
|
||||||
enableIstio: false
|
enableIstio: false
|
||||||
|
|
||||||
|
## Kubernetes client QPS and Burst settings
|
||||||
|
##
|
||||||
|
## kubernetesClientQPS represents the maximum queries per second to the kubernetes api server from client instances of fission components.
|
||||||
|
kubernetesClientQPS: 200
|
||||||
|
## kubernetesClientBurst represents the maximum burst queries to the kubernetes api server from client instances of fission components.
|
||||||
|
kubernetesClientBurst: 500
|
||||||
|
|
||||||
## fetcher is a light weight component that helps in running functions.
|
## fetcher is a light weight component that helps in running functions.
|
||||||
## fetcher helps in fetching function source code/build and uploading it when function is invoked.
|
## fetcher helps in fetching function source code/build and uploading it when function is invoked.
|
||||||
##
|
##
|
||||||
fetcher:
|
fetcher:
|
||||||
|
## repository represents the repository of the fetcher component.
|
||||||
|
##
|
||||||
|
## By default, it is empty, which means global repository will be used.
|
||||||
|
repository: ""
|
||||||
## image represents the image of the fetcher component.
|
## image represents the image of the fetcher component.
|
||||||
image: fission/fetcher
|
image: fission/fetcher
|
||||||
## imageTag represents the tag of the image of the fetcher component.
|
## imageTag represents the tag of the image of the fetcher component.
|
||||||
imageTag: v1.19.0-rc2
|
imageTag: v1.22.0
|
||||||
|
|
||||||
## Fetcher is only for to downloading or uploading archive.
|
## Fetcher is only for to downloading or uploading archive.
|
||||||
## Normally, you don't need to change the value here, unless necessary.
|
## Normally, you don't need to change the value here, unless necessary.
|
||||||
@@ -142,7 +163,7 @@ executor:
|
|||||||
## This is applicable to Pool Manager executor type only.
|
## This is applicable to Pool Manager executor type only.
|
||||||
##
|
##
|
||||||
podReadyTimeout: 300s
|
podReadyTimeout: 300s
|
||||||
|
|
||||||
## Pod resources as:
|
## Pod resources as:
|
||||||
## resources:
|
## resources:
|
||||||
## limits:
|
## limits:
|
||||||
@@ -211,6 +232,9 @@ router:
|
|||||||
## deployAsDaemonSet decides whether to deploy router as a DaemonSet or a Deployment.
|
## deployAsDaemonSet decides whether to deploy router as a DaemonSet or a Deployment.
|
||||||
##
|
##
|
||||||
deployAsDaemonSet: false
|
deployAsDaemonSet: false
|
||||||
|
## replicas decides how many router pods to deploy. Only used when deployAsDaemonSet is false.
|
||||||
|
##
|
||||||
|
replicas: 1
|
||||||
## svcAddressMaxRetries is the max times for router to retry with a specific function service address
|
## svcAddressMaxRetries is the max times for router to retry with a specific function service address
|
||||||
##
|
##
|
||||||
svcAddressMaxRetries: 5
|
svcAddressMaxRetries: 5
|
||||||
@@ -312,7 +336,7 @@ router:
|
|||||||
runAsGroup: 10001
|
runAsGroup: 10001
|
||||||
|
|
||||||
## The builder manager watches the package & environments CRD changes and manages the builds of function source code.
|
## The builder manager watches the package & environments CRD changes and manages the builds of function source code.
|
||||||
##
|
##
|
||||||
buildermgr:
|
buildermgr:
|
||||||
## Pod resources as:
|
## Pod resources as:
|
||||||
## resources:
|
## resources:
|
||||||
@@ -337,36 +361,8 @@ buildermgr:
|
|||||||
runAsUser: 10001
|
runAsUser: 10001
|
||||||
runAsGroup: 10001
|
runAsGroup: 10001
|
||||||
|
|
||||||
## controller is the component that the client talks to.
|
|
||||||
## It contains CRUD APIs for functions, triggers, environments, Kubernetes event watches, etc. and proxy APIs to internal 3rd-party services.
|
|
||||||
##
|
|
||||||
controller:
|
|
||||||
enabled: false
|
|
||||||
## Pod resources as:
|
|
||||||
## resources:
|
|
||||||
## limits:
|
|
||||||
## cpu: <tbd>
|
|
||||||
## memory: <tbd>
|
|
||||||
## requests:
|
|
||||||
## cpu: <tbd>
|
|
||||||
## memory: <tbd>
|
|
||||||
##
|
|
||||||
resources: {}
|
|
||||||
|
|
||||||
## Security Context
|
|
||||||
## It holds pod-level and container level security configuration.
|
|
||||||
## This is an experimental section, please verify before enabling in production.
|
|
||||||
## Ref: https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1
|
|
||||||
securityContext:
|
|
||||||
enabled: true
|
|
||||||
## Mark it false, if you want to stop the non root user validation
|
|
||||||
runAsNonRoot: true
|
|
||||||
fsGroup: 10001
|
|
||||||
runAsUser: 10001
|
|
||||||
runAsGroup: 10001
|
|
||||||
|
|
||||||
## webhook is the component that validates API calls.
|
## webhook is the component that validates API calls.
|
||||||
## It contains validation and mutation for functions, triggers, environments, Kubernetes event watches, etc.
|
## It contains validation and mutation for functions, triggers, environments, Kubernetes event watches, etc.
|
||||||
##
|
##
|
||||||
webhook:
|
webhook:
|
||||||
## Pod resources as:
|
## Pod resources as:
|
||||||
@@ -443,6 +439,16 @@ storagesvc:
|
|||||||
##
|
##
|
||||||
resources: {}
|
resources: {}
|
||||||
|
|
||||||
|
## Deployment strategy defaults to RollingUpdate but use Recreate if new pods fail to
|
||||||
|
## attach to the volume until the old pod has released it.
|
||||||
|
## deploymentStrategy:
|
||||||
|
## type: Recreate
|
||||||
|
deploymentStrategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 25%
|
||||||
|
maxUnavailable: 25%
|
||||||
|
|
||||||
## Archive pruner removes archives from storage which are not referenced by any package.
|
## Archive pruner removes archives from storage which are not referenced by any package.
|
||||||
archivePruner:
|
archivePruner:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -531,7 +537,7 @@ kafka:
|
|||||||
# version: "0.11.2.0"
|
# version: "0.11.2.0"
|
||||||
|
|
||||||
# The following components expose Prometheus metrics and have servicemonitors in this chart (disabled by default)
|
# The following components expose Prometheus metrics and have servicemonitors in this chart (disabled by default)
|
||||||
# Controller, router, executor, storage svc
|
# router, executor, storage svc
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
enabled: false
|
enabled: false
|
||||||
##namespace in which you want to deploy servicemonitor
|
##namespace in which you want to deploy servicemonitor
|
||||||
@@ -545,7 +551,7 @@ serviceMonitor:
|
|||||||
# key: "value"
|
# key: "value"
|
||||||
|
|
||||||
# The following components expose Prometheus metrics and have podmonitors in this chart (disabled by default)
|
# The following components expose Prometheus metrics and have podmonitors in this chart (disabled by default)
|
||||||
#
|
#
|
||||||
podMonitor:
|
podMonitor:
|
||||||
enabled: false
|
enabled: false
|
||||||
##namespace in which you want to deploy podmonitor
|
##namespace in which you want to deploy podmonitor
|
||||||
@@ -581,7 +587,7 @@ persistence:
|
|||||||
# region: <awsRegion>
|
# region: <awsRegion>
|
||||||
## For Minio and other s3 compatible storage systems set endPoint property
|
## For Minio and other s3 compatible storage systems set endPoint property
|
||||||
# endPoint: <s3StorageUrl>
|
# endPoint: <s3StorageUrl>
|
||||||
|
|
||||||
## A manually managed Persistent Volume Claim name
|
## A manually managed Persistent Volume Claim name
|
||||||
## Requires persistence.enabled: true
|
## Requires persistence.enabled: true
|
||||||
## If defined, PVC must be created manually before volume will be bound
|
## If defined, PVC must be created manually before volume will be bound
|
||||||
@@ -642,11 +648,22 @@ logger:
|
|||||||
|
|
||||||
## Fluent-bit writes/reads it’s own sqlite database to record a history of tracked
|
## Fluent-bit writes/reads it’s own sqlite database to record a history of tracked
|
||||||
## files and a state of offsets, this is very useful to resume a state if the ser-
|
## files and a state of offsets, this is very useful to resume a state if the ser-
|
||||||
## vice is restarted. For Kubernetes environment with constraints like OpenShift,
|
## vice is restarted.
|
||||||
|
##
|
||||||
|
## For Kubernetes environment with constraints like OpenShift,
|
||||||
## the containers are limited to write hostPath volume. Hence, we have to enable
|
## the containers are limited to write hostPath volume. Hence, we have to enable
|
||||||
## security context and set privileged to true.
|
## security context and set privileged to true.
|
||||||
##
|
##
|
||||||
enableSecurityContext: false
|
## The user ID in runAsUser should have access to the `/var/log` and
|
||||||
|
## `/var/lib/docker/containers` directories on your host.
|
||||||
|
## On many hosts, this user might be root ,i.e., `runAsUser: 0`.
|
||||||
|
## Although it is recommended not to use root user for security reasons.
|
||||||
|
##
|
||||||
|
## The `/var/log` and `/var/lib/docker/containers` directories on host are mounted
|
||||||
|
## to logger container with volumeType `HostPath`.
|
||||||
|
securityContext: {}
|
||||||
|
# privileged: true
|
||||||
|
# runAsUser: 0
|
||||||
|
|
||||||
## Enable PodSecurityPolicies to allow privileged container
|
## Enable PodSecurityPolicies to allow privileged container
|
||||||
## Only required in some clusters and when enableSecurityContext is true
|
## Only required in some clusters and when enableSecurityContext is true
|
||||||
@@ -680,12 +697,16 @@ preUpgradeChecks:
|
|||||||
## Run pre-install/pre-upgrade checks if true
|
## Run pre-install/pre-upgrade checks if true
|
||||||
##
|
##
|
||||||
enabled: true
|
enabled: true
|
||||||
|
## Repository for pre-install/pre-upgrade checks image
|
||||||
|
## By default it uses the global repository
|
||||||
|
##
|
||||||
|
repository: ""
|
||||||
## pre-install/pre-upgrade checks live in this image
|
## pre-install/pre-upgrade checks live in this image
|
||||||
##
|
##
|
||||||
image: fission/pre-upgrade-checks
|
image: fission/pre-upgrade-checks
|
||||||
## pre-install/pre-upgrade checks image version
|
## pre-install/pre-upgrade checks image version
|
||||||
##
|
##
|
||||||
imageTag: v1.19.0-rc2
|
imageTag: v1.22.0
|
||||||
|
|
||||||
## Fission post-install/post-upgrade reporting live in this image
|
## Fission post-install/post-upgrade reporting live in this image
|
||||||
##
|
##
|
||||||
@@ -753,12 +774,12 @@ authentication:
|
|||||||
## jwtSigningKey is the signing key used for
|
## jwtSigningKey is the signing key used for
|
||||||
## signing the JWT token
|
## signing the JWT token
|
||||||
##
|
##
|
||||||
jwtSigningKey: serverless
|
jwtSigningKey:
|
||||||
## jwtExpiryTime is the JWT expiry time
|
## jwtExpiryTime is the JWT expiry time
|
||||||
## in seconds
|
## in seconds
|
||||||
## default '120'
|
## default '120'
|
||||||
##
|
##
|
||||||
jwtExpiryTime:
|
jwtExpiryTime:
|
||||||
## jwtIssuer is the issuer of JWT
|
## jwtIssuer is the issuer of JWT
|
||||||
## default 'fission'
|
## default 'fission'
|
||||||
##
|
##
|
||||||
@@ -816,29 +837,29 @@ mqt_keda:
|
|||||||
enabled: true
|
enabled: true
|
||||||
connector_images:
|
connector_images:
|
||||||
kafka:
|
kafka:
|
||||||
image: fission/keda-kafka-http-connector
|
image: ghcr.io/fission/keda-kafka-http-connector
|
||||||
tag: v0.11
|
tag: v0.17
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: fission/keda-rabbitmq-http-connector
|
image: ghcr.io/fission/keda-rabbitmq-http-connector
|
||||||
tag: v0.10
|
tag: v0.15
|
||||||
awskinesis:
|
awskinesis:
|
||||||
image: fission/keda-aws-kinesis-http-connector
|
image: ghcr.io/fission/keda-aws-kinesis-http-connector
|
||||||
tag: v0.10
|
tag: v0.15
|
||||||
aws_sqs:
|
aws_sqs:
|
||||||
image: fission/keda-aws-sqs-http-connector
|
image: ghcr.io/fission/keda-aws-sqs-http-connector
|
||||||
tag: v0.10
|
tag: v0.16
|
||||||
nats_steaming:
|
nats_steaming:
|
||||||
image: fission/keda-nats-streaming-http-connector
|
image: ghcr.io/fission/keda-nats-streaming-http-connector
|
||||||
tag: v0.12
|
tag: v0.18
|
||||||
nats_jetstream:
|
nats_jetstream:
|
||||||
image: fission/keda-nats-jetstream-http-connector
|
image: ghcr.io/fission/keda-nats-jetstream-http-connector
|
||||||
tag: v0.2
|
tag: v0.9
|
||||||
gcp_pubsub:
|
gcp_pubsub:
|
||||||
image: fission/keda-gcp-pubsub-http-connector
|
image: ghcr.io/fission/keda-gcp-pubsub-http-connector
|
||||||
tag: v0.5
|
tag: v0.11
|
||||||
redis:
|
redis:
|
||||||
image: fission/keda-redis-http-connector
|
image: ghcr.io/fission/keda-redis-http-connector
|
||||||
tag: v0.3
|
tag: v0.8
|
||||||
|
|
||||||
## Pod resources as:
|
## Pod resources as:
|
||||||
## resources:
|
## resources:
|
||||||
@@ -863,7 +884,7 @@ runtimePodSpec:
|
|||||||
## Setting it false by default so that integration tests pass
|
## Setting it false by default so that integration tests pass
|
||||||
##
|
##
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
## Checkout PodSpec in https://fission.io/docs/reference/crd-reference/#runtime
|
## Checkout PodSpec in https://fission.io/docs/reference/crd-reference/#runtime
|
||||||
##
|
##
|
||||||
podSpec:
|
podSpec:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.17
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
RUN apk add --update ca-certificates
|
ARG TARGETPLATFORM
|
||||||
COPY builder /builder
|
COPY $TARGETPLATFORM/builder /builder
|
||||||
ENTRYPOINT ["/builder"]
|
ENTRYPOINT ["/builder"]
|
||||||
|
|||||||
@@ -24,16 +24,18 @@ import (
|
|||||||
|
|
||||||
builder "github.com/fission/fission/pkg/builder"
|
builder "github.com/fission/fission/pkg/builder"
|
||||||
"github.com/fission/fission/pkg/utils/httpserver"
|
"github.com/fission/fission/pkg/utils/httpserver"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Usage: builder <shared volume path>
|
// Usage: builder <shared volume path>
|
||||||
func Run(ctx context.Context, logger *zap.Logger, shareVolume string) {
|
func Run(ctx context.Context, logger *zap.Logger, mgr manager.Interface, shareVolume string) {
|
||||||
builder := builder.MakeBuilder(logger, shareVolume)
|
builder := builder.MakeBuilder(logger, shareVolume)
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.HandleFunc("/", builder.Handler)
|
mux.HandleFunc("/", builder.Handler)
|
||||||
|
mux.HandleFunc("/clean", builder.Clean)
|
||||||
mux.HandleFunc("/version", builder.VersionHandler)
|
mux.HandleFunc("/version", builder.VersionHandler)
|
||||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
})
|
})
|
||||||
httpserver.StartServer(ctx, logger, "builder", "8001", mux)
|
httpserver.StartServer(ctx, logger, mgr, "builder", "8001", mux)
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -24,15 +24,21 @@ import (
|
|||||||
|
|
||||||
"github.com/fission/fission/cmd/builder/app"
|
"github.com/fission/fission/cmd/builder/app"
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
"github.com/fission/fission/pkg/utils/profile"
|
"github.com/fission/fission/pkg/utils/profile"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Usage: builder <shared volume path>
|
// Usage: builder <shared volume path>
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
mgr := manager.New()
|
||||||
|
defer mgr.Wait()
|
||||||
|
|
||||||
logger := loggerfactory.GetLogger()
|
logger := loggerfactory.GetLogger()
|
||||||
defer logger.Sync()
|
defer logger.Sync()
|
||||||
ctx := signals.SetupSignalHandler()
|
ctx := signals.SetupSignalHandler()
|
||||||
profile.ProfileIfEnabled(ctx, logger)
|
profile.ProfileIfEnabled(ctx, logger, mgr)
|
||||||
|
|
||||||
shareVolume := os.Args[1]
|
shareVolume := os.Args[1]
|
||||||
if _, err := os.Stat(shareVolume); err != nil {
|
if _, err := os.Stat(shareVolume); err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
@@ -42,5 +48,5 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app.Run(ctx, logger, shareVolume)
|
app.Run(ctx, logger, mgr, shareVolume)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.17
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
RUN apk add --update ca-certificates
|
ARG TARGETPLATFORM
|
||||||
COPY fetcher /
|
COPY $TARGETPLATFORM/fetcher /
|
||||||
ENTRYPOINT ["/fetcher"]
|
ENTRYPOINT ["/fetcher"]
|
||||||
|
|||||||
@@ -28,8 +28,10 @@ import (
|
|||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
|
"github.com/fission/fission/pkg/crd"
|
||||||
"github.com/fission/fission/pkg/fetcher"
|
"github.com/fission/fission/pkg/fetcher"
|
||||||
"github.com/fission/fission/pkg/utils/httpserver"
|
"github.com/fission/fission/pkg/utils/httpserver"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -37,7 +39,7 @@ var (
|
|||||||
readyToServe uint32
|
readyToServe uint32
|
||||||
)
|
)
|
||||||
|
|
||||||
func Run(ctx context.Context, logger *zap.Logger) {
|
func Run(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, port string, podInfoMountDir string) {
|
||||||
flag.Usage = fetcherUsage
|
flag.Usage = fetcherUsage
|
||||||
specializeOnStart := flag.Bool("specialize-on-startup", false, "Flag to activate specialize process at pod startup")
|
specializeOnStart := flag.Bool("specialize-on-startup", false, "Flag to activate specialize process at pod startup")
|
||||||
specializePayload := flag.String("specialize-request", "", "JSON payload for specialize request")
|
specializePayload := flag.String("specialize-request", "", "JSON payload for specialize request")
|
||||||
@@ -72,13 +74,13 @@ func Run(ctx context.Context, logger *zap.Logger) {
|
|||||||
ctx, span := tracer.Start(ctx, "fetcher/Run")
|
ctx, span := tracer.Start(ctx, "fetcher/Run")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
|
||||||
f, err := fetcher.MakeFetcher(logger, dir, *secretDir, *configDir)
|
f, err := fetcher.MakeFetcher(logger, clientGen, dir, *secretDir, *configDir, podInfoMountDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal("error making fetcher", zap.Error(err))
|
logger.Fatal("error making fetcher", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
// do specialization in other goroutine to prevent blocking in newdeploy
|
// do specialization in other goroutine to prevent blocking in newdeploy
|
||||||
go func() {
|
mgr.Add(ctx, func(_ context.Context) {
|
||||||
if *specializeOnStart {
|
if *specializeOnStart {
|
||||||
var specializeReq fetcher.FunctionSpecializeRequest
|
var specializeReq fetcher.FunctionSpecializeRequest
|
||||||
|
|
||||||
@@ -93,7 +95,7 @@ func Run(ctx context.Context, logger *zap.Logger) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
atomic.StoreUint32(&readyToServe, 1)
|
atomic.StoreUint32(&readyToServe, 1)
|
||||||
}()
|
})
|
||||||
|
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.HandleFunc("/fetch", f.FetchHandler)
|
mux.HandleFunc("/fetch", f.FetchHandler)
|
||||||
@@ -119,7 +121,7 @@ func Run(ctx context.Context, logger *zap.Logger) {
|
|||||||
logger.Info("fetcher ready to receive requests")
|
logger.Info("fetcher ready to receive requests")
|
||||||
|
|
||||||
handler := otelUtils.GetHandlerWithOTEL(mux, "fission-fetcher", otelUtils.UrlsToIgnore("/healthz", "/readiness-healthz"))
|
handler := otelUtils.GetHandlerWithOTEL(mux, "fission-fetcher", otelUtils.UrlsToIgnore("/healthz", "/readiness-healthz"))
|
||||||
httpserver.StartServer(ctx, logger, "fetcher", "8000", handler)
|
httpserver.StartServer(ctx, logger, mgr, "fetcher", port, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func fetcherUsage() {
|
func fetcherUsage() {
|
||||||
|
|||||||
+12
-2
@@ -20,16 +20,26 @@ import (
|
|||||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||||
|
|
||||||
"github.com/fission/fission/cmd/fetcher/app"
|
"github.com/fission/fission/cmd/fetcher/app"
|
||||||
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
|
"github.com/fission/fission/pkg/crd"
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
"github.com/fission/fission/pkg/utils/profile"
|
"github.com/fission/fission/pkg/utils/profile"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const fetcherPort = "8000"
|
||||||
|
|
||||||
// Usage: fetcher <shared volume path>
|
// Usage: fetcher <shared volume path>
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
mgr := manager.New()
|
||||||
|
defer mgr.Wait()
|
||||||
|
|
||||||
logger := loggerfactory.GetLogger()
|
logger := loggerfactory.GetLogger()
|
||||||
defer logger.Sync()
|
defer logger.Sync()
|
||||||
|
|
||||||
ctx := signals.SetupSignalHandler()
|
ctx := signals.SetupSignalHandler()
|
||||||
profile.ProfileIfEnabled(ctx, logger)
|
profile.ProfileIfEnabled(ctx, logger, mgr)
|
||||||
app.Run(ctx, logger)
|
|
||||||
|
app.Run(ctx, crd.NewClientGenerator(), logger, mgr, fetcherPort, fv1.PodInfoMount)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.17
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
RUN apk add --update ca-certificates
|
ARG TARGETPLATFORM
|
||||||
COPY fission-bundle /
|
COPY $TARGETPLATFORM/fission-bundle /
|
||||||
ENTRYPOINT ["/fission-bundle"]
|
ENTRYPOINT ["/fission-bundle"]
|
||||||
|
|||||||
+238
-236
@@ -21,17 +21,17 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
docopt "github.com/docopt/docopt-go"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||||
|
cnwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"
|
||||||
|
|
||||||
"github.com/fission/fission/cmd/fission-bundle/mqtrigger"
|
"github.com/fission/fission/cmd/fission-bundle/mqtrigger"
|
||||||
"github.com/fission/fission/pkg/buildermgr"
|
"github.com/fission/fission/pkg/buildermgr"
|
||||||
"github.com/fission/fission/pkg/canaryconfigmgr"
|
"github.com/fission/fission/pkg/canaryconfigmgr"
|
||||||
"github.com/fission/fission/pkg/controller"
|
"github.com/fission/fission/pkg/crd"
|
||||||
"github.com/fission/fission/pkg/executor"
|
"github.com/fission/fission/pkg/executor"
|
||||||
|
eclient "github.com/fission/fission/pkg/executor/client"
|
||||||
"github.com/fission/fission/pkg/info"
|
"github.com/fission/fission/pkg/info"
|
||||||
"github.com/fission/fission/pkg/kubewatcher"
|
"github.com/fission/fission/pkg/kubewatcher"
|
||||||
functionLogger "github.com/fission/fission/pkg/logger"
|
functionLogger "github.com/fission/fission/pkg/logger"
|
||||||
@@ -40,133 +40,50 @@ import (
|
|||||||
"github.com/fission/fission/pkg/storagesvc"
|
"github.com/fission/fission/pkg/storagesvc"
|
||||||
"github.com/fission/fission/pkg/timer"
|
"github.com/fission/fission/pkg/timer"
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
"github.com/fission/fission/pkg/utils/otel"
|
"github.com/fission/fission/pkg/utils/otel"
|
||||||
"github.com/fission/fission/pkg/utils/profile"
|
"github.com/fission/fission/pkg/utils/profile"
|
||||||
"github.com/fission/fission/pkg/webhook"
|
"github.com/fission/fission/pkg/webhook"
|
||||||
)
|
)
|
||||||
|
|
||||||
// runWebhook starts admission webhook server
|
// Command line arguments
|
||||||
func runWebhook(ctx context.Context, logger *zap.Logger, port int) error {
|
type CommandLineArgs struct {
|
||||||
return webhook.Start(ctx, logger, port)
|
// Flags
|
||||||
|
canaryConfig bool
|
||||||
|
kubewatcher bool
|
||||||
|
timer bool
|
||||||
|
mqt bool
|
||||||
|
mqt_keda bool
|
||||||
|
builderMgr bool
|
||||||
|
showVersion bool
|
||||||
|
logger bool
|
||||||
|
|
||||||
|
// Port values
|
||||||
|
webhookPort int
|
||||||
|
routerPort int
|
||||||
|
executorPort int
|
||||||
|
storageServicePort int
|
||||||
|
|
||||||
|
// URL values
|
||||||
|
executorUrl string
|
||||||
|
routerUrl string
|
||||||
|
storageSvcUrl string
|
||||||
|
|
||||||
|
// Other configurations
|
||||||
|
storageType string
|
||||||
}
|
}
|
||||||
|
|
||||||
func runController(ctx context.Context, logger *zap.Logger, port int) {
|
// Usage information
|
||||||
controller.Start(ctx, logger, port, false)
|
const usageText string = `fission-bundle: Package of all fission microservices: router, executor.
|
||||||
}
|
|
||||||
|
|
||||||
func runCanaryConfigServer(ctx context.Context, logger *zap.Logger) error {
|
|
||||||
return canaryconfigmgr.StartCanaryServer(ctx, logger, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runRouter(ctx context.Context, logger *zap.Logger, port int, executorUrl string) {
|
|
||||||
router.Start(ctx, logger, port, executorUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runExecutor(ctx context.Context, logger *zap.Logger, port int) error {
|
|
||||||
return executor.StartExecutor(ctx, logger, port)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runKubeWatcher(ctx context.Context, logger *zap.Logger, routerUrl string) error {
|
|
||||||
return kubewatcher.Start(ctx, logger, routerUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runTimer(ctx context.Context, logger *zap.Logger, routerUrl string) error {
|
|
||||||
return timer.Start(ctx, logger, routerUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runMessageQueueMgr(ctx context.Context, logger *zap.Logger, routerUrl string) error {
|
|
||||||
return mqtrigger.Start(ctx, logger, routerUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
// KEDA based MessageQueue Trigger Manager
|
|
||||||
func runMQManager(ctx context.Context, logger *zap.Logger, routerURL string) error {
|
|
||||||
return mqt.StartScalerManager(ctx, logger, routerURL)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runStorageSvc(ctx context.Context, logger *zap.Logger, port int, storage storagesvc.Storage) error {
|
|
||||||
return storagesvc.Start(ctx, logger, storage, port)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runBuilderMgr(ctx context.Context, logger *zap.Logger, storageSvcUrl string) error {
|
|
||||||
return buildermgr.Start(ctx, logger, storageSvcUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runLogger(ctx context.Context, logger *zap.Logger) {
|
|
||||||
functionLogger.Start(ctx, logger)
|
|
||||||
}
|
|
||||||
|
|
||||||
func getPort(logger *zap.Logger, portArg interface{}) int {
|
|
||||||
portArgStr := portArg.(string)
|
|
||||||
port, err := strconv.Atoi(portArgStr)
|
|
||||||
if err != nil {
|
|
||||||
logger.Fatal("invalid port number", zap.Error(err), zap.String("port", portArgStr))
|
|
||||||
}
|
|
||||||
return port
|
|
||||||
}
|
|
||||||
|
|
||||||
func getStringArgWithDefault(arg interface{}, defaultValue string) string {
|
|
||||||
if arg != nil {
|
|
||||||
return arg.(string)
|
|
||||||
} else {
|
|
||||||
return defaultValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getServiceName(arguments map[string]interface{}) string {
|
|
||||||
serviceName := "Fission-Unknown"
|
|
||||||
|
|
||||||
if arguments["--controllerPort"] != nil {
|
|
||||||
serviceName = "Fission-Controller"
|
|
||||||
} else if arguments["--routerPort"] != nil {
|
|
||||||
serviceName = "Fission-Router"
|
|
||||||
} else if arguments["--executorPort"] != nil {
|
|
||||||
serviceName = "Fission-Executor"
|
|
||||||
} else if arguments["--kubewatcher"] == true {
|
|
||||||
serviceName = "Fission-KubeWatcher"
|
|
||||||
} else if arguments["--timer"] == true {
|
|
||||||
serviceName = "Fission-Timer"
|
|
||||||
} else if arguments["--mqt"] == true {
|
|
||||||
serviceName = "Fission-MessageQueueTrigger"
|
|
||||||
} else if arguments["--builderMgr"] == true {
|
|
||||||
serviceName = "Fission-BuilderMgr"
|
|
||||||
} else if arguments["--storageServicePort"] != nil {
|
|
||||||
serviceName = "Fission-StorageSvc"
|
|
||||||
} else if arguments["--mqt_keda"] == true {
|
|
||||||
serviceName = "Fission-Keda-MQTrigger"
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceName
|
|
||||||
}
|
|
||||||
|
|
||||||
func exitWithSync(logger *zap.Logger) {
|
|
||||||
// Ignore error, safe to ignore as per https://github.com/uber-go/zap/issues/328
|
|
||||||
_ = logger.Sync()
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
var err error
|
|
||||||
|
|
||||||
// From https://github.com/containous/traefik/pull/1817/files
|
|
||||||
// Tell glog to log into STDERR. Otherwise, we risk
|
|
||||||
// certain kinds of API errors getting logged into a directory not
|
|
||||||
// available in a `FROM scratch` Docker container, causing glog to abort
|
|
||||||
// hard with an exit code > 0.
|
|
||||||
// TODO: fix the lint error. Error checking here is causing all components to crash with error "logtostderr not found"
|
|
||||||
flag.Set("logtostderr", "true") //nolint: errcheck
|
|
||||||
|
|
||||||
usage := `fission-bundle: Package of all fission microservices: controller, router, executor.
|
|
||||||
|
|
||||||
Use it to start one or more of the fission servers:
|
Use it to start one or more of the fission servers:
|
||||||
|
|
||||||
Controller is a stateless API frontend for fission resources.
|
|
||||||
|
|
||||||
Pool manager maintains a pool of generalized function containers, and
|
Pool manager maintains a pool of generalized function containers, and
|
||||||
specializes them on-demand. Executor must be run from a pod in a
|
specializes them on-demand. Executor must be run from a pod in a
|
||||||
Kubernetes cluster.
|
Kubernetes cluster.
|
||||||
|
|
||||||
Router implements HTTP triggers: it routes to running instances,
|
Router implements HTTP triggers: it routes to running instances,
|
||||||
working with the controller and executor.
|
working with the executor.
|
||||||
|
|
||||||
Kubewatcher implements Kubernetes Watch triggers: it watches
|
Kubewatcher implements Kubernetes Watch triggers: it watches
|
||||||
Kubernetes resources and invokes functions described in the
|
Kubernetes resources and invokes functions described in the
|
||||||
@@ -177,7 +94,6 @@ Use it to start one or more of the fission servers:
|
|||||||
backends.
|
backends.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
fission-bundle --controllerPort=<port>
|
|
||||||
fission-bundle --canaryConfig
|
fission-bundle --canaryConfig
|
||||||
fission-bundle --routerPort=<port> [--executorUrl=<url>]
|
fission-bundle --routerPort=<port> [--executorUrl=<url>]
|
||||||
fission-bundle --executorPort=<port> [--namespace=<namespace>] [--fission-namespace=<namespace>]
|
fission-bundle --executorPort=<port> [--namespace=<namespace>] [--fission-namespace=<namespace>]
|
||||||
@@ -191,7 +107,6 @@ Usage:
|
|||||||
fission-bundle --logger
|
fission-bundle --logger
|
||||||
fission-bundle --version
|
fission-bundle --version
|
||||||
Options:
|
Options:
|
||||||
--controllerPort=<port> Port that the controller should listen on.
|
|
||||||
--canaryConfig Start canary config server.
|
--canaryConfig Start canary config server.
|
||||||
--webhookPort=<port> Port that the webhook should listen on.
|
--webhookPort=<port> Port that the webhook should listen on.
|
||||||
--routerPort=<port> Port that the router should listen on.
|
--routerPort=<port> Port that the router should listen on.
|
||||||
@@ -199,144 +114,231 @@ Options:
|
|||||||
--storageServicePort=<port> Port that the storage service should listen on.
|
--storageServicePort=<port> Port that the storage service should listen on.
|
||||||
--executorUrl=<url> Executor URL. Not required if --executorPort is specified.
|
--executorUrl=<url> Executor URL. Not required if --executorPort is specified.
|
||||||
--routerUrl=<url> Router URL.
|
--routerUrl=<url> Router URL.
|
||||||
--etcdUrl=<etcdUrl> Etcd URL.
|
|
||||||
--storageSvcUrl=<url> StorageService URL.
|
--storageSvcUrl=<url> StorageService URL.
|
||||||
--filePath=<filePath> Directory to store functions in.
|
|
||||||
--namespace=<namespace> Kubernetes namespace in which to run function containers. Defaults to 'fission-function'.
|
|
||||||
--kubewatcher Start Kubernetes events watcher.
|
--kubewatcher Start Kubernetes events watcher.
|
||||||
--timer Start Timer.
|
--timer Start Timer.
|
||||||
--mqt Start message queue trigger.
|
--mqt Start message queue trigger.
|
||||||
--mqt_keda Start message queue trigger of kind KEDA
|
--mqt_keda Start message queue trigger of kind KEDA
|
||||||
--builderMgr Start builder manager.
|
--builderMgr Start builder manager.
|
||||||
--version Print version information
|
--version Print version information`
|
||||||
`
|
|
||||||
logger := loggerfactory.GetLogger()
|
|
||||||
defer exitWithSync(logger)
|
|
||||||
|
|
||||||
ctx := signals.SetupSignalHandler()
|
func main() {
|
||||||
profile.ProfileIfEnabled(ctx, logger)
|
mgr := manager.New()
|
||||||
|
defer mgr.Wait()
|
||||||
|
|
||||||
version := fmt.Sprintf("Fission Bundle Version: %s", info.BuildInfo().String())
|
// Set up command line parsing
|
||||||
arguments, err := docopt.ParseArgs(usage, nil, version)
|
args := setupCommandLineArgs()
|
||||||
if err != nil {
|
|
||||||
logger.Error("failed to parse arguments", zap.Error(err))
|
// Handle version request specially - exit after printing
|
||||||
return
|
if args.showVersion {
|
||||||
|
fmt.Printf("Fission Bundle Version: %s\n", info.BuildInfo().String())
|
||||||
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
shutdown, err := otel.InitProvider(ctx, logger, getServiceName(arguments))
|
// Initialize logger
|
||||||
|
logger := loggerfactory.GetLogger()
|
||||||
|
defer func() {
|
||||||
|
// Ignore error, safe to ignore as per https://github.com/uber-go/zap/issues/328
|
||||||
|
_ = logger.Sync()
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Set up signal handling for graceful shutdown
|
||||||
|
ctx := signals.SetupSignalHandler()
|
||||||
|
|
||||||
|
// Enable profiling if configured
|
||||||
|
profile.ProfileIfEnabled(ctx, logger, mgr)
|
||||||
|
|
||||||
|
// Initialize OpenTelemetry
|
||||||
|
serviceName := getServiceNameFromArgs(args)
|
||||||
|
shutdown, err := otel.InitProvider(ctx, logger, serviceName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("error initializing provider for OTLP", zap.Error(err), zap.Any("argument", arguments))
|
logger.Error("error initializing provider for OTLP", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if shutdown != nil {
|
if shutdown != nil {
|
||||||
defer shutdown(ctx)
|
defer shutdown(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
executorUrl := getStringArgWithDefault(arguments["--executorUrl"], "http://executor.fission")
|
// Initialize client generator
|
||||||
routerUrl := getStringArgWithDefault(arguments["--routerUrl"], "http://router.fission")
|
clientGen := crd.NewClientGenerator()
|
||||||
storageSvcUrl := getStringArgWithDefault(arguments["--storageSvcUrl"], "http://storagesvc.fission")
|
|
||||||
|
|
||||||
if arguments["--webhookPort"] != nil {
|
// Start the appropriate service based on command line arguments
|
||||||
port := getPort(logger, arguments["--webhookPort"])
|
startRequestedService(ctx, args, clientGen, logger, mgr)
|
||||||
err = runWebhook(ctx, logger, port)
|
|
||||||
logger.Error("webhook server exited:", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--controllerPort"] != nil {
|
|
||||||
port := getPort(logger, arguments["--controllerPort"])
|
|
||||||
runController(ctx, logger, port)
|
|
||||||
logger.Error("controller exited")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--canaryConfig"] == true {
|
|
||||||
err := runCanaryConfigServer(ctx, logger)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("canary config server exited with error: ", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--routerPort"] != nil {
|
|
||||||
port := getPort(logger, arguments["--routerPort"])
|
|
||||||
runRouter(ctx, logger, port, executorUrl)
|
|
||||||
logger.Error("router exited")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--executorPort"] != nil {
|
|
||||||
port := getPort(logger, arguments["--executorPort"])
|
|
||||||
err = runExecutor(ctx, logger, port)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("executor exited", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--kubewatcher"] == true {
|
|
||||||
err = runKubeWatcher(ctx, logger, routerUrl)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("kubewatcher exited", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--timer"] == true {
|
|
||||||
err = runTimer(ctx, logger, routerUrl)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("timer exited", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--mqt"] == true {
|
|
||||||
err = runMessageQueueMgr(ctx, logger, routerUrl)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("message queue manager exited", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--mqt_keda"] == true {
|
|
||||||
err = runMQManager(ctx, logger, routerUrl)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("mqt scaler manager exited", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--builderMgr"] == true {
|
|
||||||
err = runBuilderMgr(ctx, logger, storageSvcUrl)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("builder manager exited", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--logger"] == true {
|
|
||||||
runLogger(ctx, logger)
|
|
||||||
logger.Error("logger exited")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if arguments["--storageServicePort"] != nil {
|
|
||||||
port := getPort(logger, arguments["--storageServicePort"])
|
|
||||||
|
|
||||||
var storage storagesvc.Storage
|
|
||||||
|
|
||||||
if arguments["--storageType"] != nil && arguments["--storageType"] == string(storagesvc.StorageTypeS3) {
|
|
||||||
storage = storagesvc.NewS3Storage()
|
|
||||||
} else if arguments["--storageType"] == string(storagesvc.StorageTypeLocal) {
|
|
||||||
storage = storagesvc.NewLocalStorage("/fission")
|
|
||||||
}
|
|
||||||
err := runStorageSvc(ctx, logger, port, storage)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("storage service exited", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<-ctx.Done()
|
<-ctx.Done()
|
||||||
logger.Error("exiting")
|
logger.Error("exiting")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// setupCommandLineArgs parses command line arguments and returns them
|
||||||
|
func setupCommandLineArgs() *CommandLineArgs {
|
||||||
|
args := &CommandLineArgs{}
|
||||||
|
|
||||||
|
// Override the default usage function
|
||||||
|
flag.Usage = func() {
|
||||||
|
fmt.Println(usageText)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tell glog to log into STDERR
|
||||||
|
flag.Set("logtostderr", "true") //nolint: errcheck
|
||||||
|
|
||||||
|
// Define flags
|
||||||
|
flag.BoolVar(&args.canaryConfig, "canaryConfig", false, "Start canary config server")
|
||||||
|
flag.BoolVar(&args.kubewatcher, "kubewatcher", false, "Start Kubernetes events watcher")
|
||||||
|
flag.BoolVar(&args.timer, "timer", false, "Start Timer")
|
||||||
|
flag.BoolVar(&args.mqt, "mqt", false, "Start message queue trigger")
|
||||||
|
flag.BoolVar(&args.mqt_keda, "mqt_keda", false, "Start message queue trigger of kind KEDA")
|
||||||
|
flag.BoolVar(&args.builderMgr, "builderMgr", false, "Start builder manager")
|
||||||
|
flag.BoolVar(&args.showVersion, "version", false, "Print version information")
|
||||||
|
flag.BoolVar(&args.logger, "logger", false, "Start logger")
|
||||||
|
|
||||||
|
// Port flags
|
||||||
|
flag.IntVar(&args.webhookPort, "webhookPort", 0, "Port that the webhook should listen on")
|
||||||
|
flag.IntVar(&args.routerPort, "routerPort", 0, "Port that the router should listen on")
|
||||||
|
flag.IntVar(&args.executorPort, "executorPort", 0, "Port that the executor should listen on")
|
||||||
|
flag.IntVar(&args.storageServicePort, "storageServicePort", 0, "Port that the storage service should listen on")
|
||||||
|
|
||||||
|
// URL flags
|
||||||
|
flag.StringVar(&args.executorUrl, "executorUrl", "http://executor.fission", "Executor URL")
|
||||||
|
flag.StringVar(&args.routerUrl, "routerUrl", "http://router.fission", "Router URL")
|
||||||
|
flag.StringVar(&args.storageSvcUrl, "storageSvcUrl", "http://storagesvc.fission", "StorageService URL")
|
||||||
|
|
||||||
|
// Other configuration flags
|
||||||
|
flag.StringVar(&args.storageType, "storageType", "", "Type of storage to use")
|
||||||
|
|
||||||
|
// Parse flags
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
// getServiceNameFromArgs determines which service is being started based on command line args
|
||||||
|
func getServiceNameFromArgs(args *CommandLineArgs) string {
|
||||||
|
serviceName := "Fission-Unknown"
|
||||||
|
|
||||||
|
if args.routerPort != 0 {
|
||||||
|
serviceName = "Fission-Router"
|
||||||
|
} else if args.executorPort != 0 {
|
||||||
|
serviceName = "Fission-Executor"
|
||||||
|
} else if args.kubewatcher {
|
||||||
|
serviceName = "Fission-KubeWatcher"
|
||||||
|
} else if args.timer {
|
||||||
|
serviceName = "Fission-Timer"
|
||||||
|
} else if args.mqt {
|
||||||
|
serviceName = "Fission-MessageQueueTrigger"
|
||||||
|
} else if args.builderMgr {
|
||||||
|
serviceName = "Fission-BuilderMgr"
|
||||||
|
} else if args.storageServicePort != 0 {
|
||||||
|
serviceName = "Fission-StorageSvc"
|
||||||
|
} else if args.mqt_keda {
|
||||||
|
serviceName = "Fission-Keda-MQTrigger"
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceName
|
||||||
|
}
|
||||||
|
|
||||||
|
// startRequestedService starts the service specified by command line arguments
|
||||||
|
func startRequestedService(ctx context.Context, args *CommandLineArgs, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface) {
|
||||||
|
var err error
|
||||||
|
|
||||||
|
// Start the requested service based on command line arguments
|
||||||
|
if args.webhookPort != 0 {
|
||||||
|
err = webhook.Start(ctx, clientGen, logger, cnwebhook.Options{
|
||||||
|
Port: args.webhookPort,
|
||||||
|
})
|
||||||
|
logger.Error("webhook server exited:", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.canaryConfig {
|
||||||
|
err = canaryconfigmgr.StartCanaryServer(ctx, clientGen, logger, mgr, false)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("canary config server exited with error: ", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.routerPort != 0 {
|
||||||
|
err = router.Start(ctx, clientGen, logger, mgr, args.routerPort, eclient.MakeClient(logger, args.executorUrl))
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("router exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.executorPort != 0 {
|
||||||
|
err = executor.StartExecutor(ctx, clientGen, logger, mgr, args.executorPort)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("executor exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.kubewatcher {
|
||||||
|
err = kubewatcher.Start(ctx, clientGen, logger, mgr, args.routerUrl)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("kubewatcher exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.timer {
|
||||||
|
err = timer.Start(ctx, clientGen, logger, mgr, args.routerUrl)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("timer exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.mqt {
|
||||||
|
err = mqtrigger.Start(ctx, clientGen, logger, mgr, args.routerUrl)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("message queue manager exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.mqt_keda {
|
||||||
|
err = mqt.StartScalerManager(ctx, clientGen, logger, mgr, args.routerUrl)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("mqt scaler manager exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.builderMgr {
|
||||||
|
err = buildermgr.Start(ctx, clientGen, logger, mgr, args.storageSvcUrl)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("builder manager exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.logger {
|
||||||
|
err = functionLogger.Start(ctx, clientGen, logger)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("logger exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if args.storageServicePort != 0 {
|
||||||
|
startStorageService(ctx, args, clientGen, logger, mgr)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// startStorageService initializes and starts the storage service
|
||||||
|
func startStorageService(ctx context.Context, args *CommandLineArgs, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface) {
|
||||||
|
var storage storagesvc.Storage
|
||||||
|
|
||||||
|
if args.storageType == string(storagesvc.StorageTypeS3) {
|
||||||
|
storage = storagesvc.NewS3Storage()
|
||||||
|
} else if args.storageType == string(storagesvc.StorageTypeLocal) {
|
||||||
|
storage = storagesvc.NewLocalStorage("/fission")
|
||||||
|
}
|
||||||
|
|
||||||
|
err := storagesvc.Start(ctx, clientGen, logger, storage, mgr, args.storageServicePort)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("storage service exited", zap.Error(err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,28 +22,30 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
"github.com/fission/fission/pkg/crd"
|
"github.com/fission/fission/pkg/crd"
|
||||||
|
genInformer "github.com/fission/fission/pkg/generated/informers/externalversions"
|
||||||
"github.com/fission/fission/pkg/mqtrigger"
|
"github.com/fission/fission/pkg/mqtrigger"
|
||||||
"github.com/fission/fission/pkg/mqtrigger/factory"
|
"github.com/fission/fission/pkg/mqtrigger/factory"
|
||||||
"github.com/fission/fission/pkg/mqtrigger/messageQueue"
|
"github.com/fission/fission/pkg/mqtrigger/messageQueue"
|
||||||
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/kafka"
|
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/kafka"
|
||||||
|
"github.com/fission/fission/pkg/utils"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Start(ctx context.Context, logger *zap.Logger, routerUrl string) error {
|
func Start(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, routerUrl string) error {
|
||||||
clientGen := crd.NewClientGenerator()
|
|
||||||
fissionClient, err := clientGen.GetFissionClient()
|
fissionClient, err := clientGen.GetFissionClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get fission client")
|
return fmt.Errorf("failed to get fission client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = crd.WaitForCRDs(ctx, logger, fissionClient)
|
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error waiting for CRDs")
|
return fmt.Errorf("error waiting for CRDs: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mqType := (fv1.MessageQueueType)(os.Getenv("MESSAGE_QUEUE_TYPE"))
|
mqType := (fv1.MessageQueueType)(os.Getenv("MESSAGE_QUEUE_TYPE"))
|
||||||
@@ -73,8 +75,24 @@ func Start(ctx context.Context, logger *zap.Logger, routerUrl string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal("failed to connect to remote message queue server", zap.Error(err))
|
logger.Fatal("failed to connect to remote message queue server", zap.Error(err))
|
||||||
}
|
}
|
||||||
mqtMgr := mqtrigger.MakeMessageQueueTriggerManager(logger, fissionClient, mqType, mq)
|
|
||||||
mqtMgr.Run(ctx)
|
finformerFactory := make(map[string]genInformer.SharedInformerFactory, 0)
|
||||||
|
for _, ns := range utils.DefaultNSResolver().FissionResourceNS {
|
||||||
|
finformerFactory[ns] = genInformer.NewFilteredSharedInformerFactory(fissionClient, time.Minute*30, ns, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
mqtMgr, err := mqtrigger.MakeMessageQueueTriggerManager(logger, fissionClient, mqType, finformerFactory, mq)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start informer factory
|
||||||
|
for _, factory := range finformerFactory {
|
||||||
|
factory.Start(ctx.Done())
|
||||||
|
}
|
||||||
|
|
||||||
|
mqtMgr.Run(ctx, ctx.Done(), mgr)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ limitations under the License.
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -49,7 +50,7 @@ const (
|
|||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
|
||||||
func App() *cobra.Command {
|
func App(clientOptions cmd.ClientOptions) *cobra.Command {
|
||||||
cobra.EnableCommandSorting = false
|
cobra.EnableCommandSorting = false
|
||||||
|
|
||||||
rootCmd := &cobra.Command{
|
rootCmd := &cobra.Command{
|
||||||
@@ -59,15 +60,13 @@ func App() *cobra.Command {
|
|||||||
PersistentPreRunE: wrapper.Wrapper(
|
PersistentPreRunE: wrapper.Wrapper(
|
||||||
func(input cli.Input) error {
|
func(input cli.Input) error {
|
||||||
console.Verbosity = input.Int(flagkey.Verbosity)
|
console.Verbosity = input.Int(flagkey.Verbosity)
|
||||||
clientOptions := cmd.ClientOptions{
|
clientOptions.KubeContext = input.String(flagkey.KubeContext)
|
||||||
KubeContext: input.String(flagkey.KubeContext),
|
|
||||||
}
|
|
||||||
// TODO: use fake rest client for offline spec generation
|
// TODO: use fake rest client for offline spec generation
|
||||||
// if input.IsSet(flagkey.ClientOnly) || input.IsSet(flagkey.PreCheckOnly) {
|
// if input.IsSet(flagkey.ClientOnly) || input.IsSet(flagkey.PreCheckOnly) {
|
||||||
// }
|
// }
|
||||||
client, err := cmd.NewClient(clientOptions)
|
client, err := cmd.NewClient(clientOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get fission client")
|
return fmt.Errorf("failed to get fission client: %w", err)
|
||||||
}
|
}
|
||||||
cmd.SetClientset(*client)
|
cmd.SetClientset(*client)
|
||||||
return nil
|
return nil
|
||||||
@@ -83,7 +82,7 @@ func App() *cobra.Command {
|
|||||||
})
|
})
|
||||||
|
|
||||||
wrapper.SetFlags(rootCmd, flag.FlagSet{
|
wrapper.SetFlags(rootCmd, flag.FlagSet{
|
||||||
Global: []flag.Flag{flag.GlobalServer, flag.GlobalVerbosity, flag.KubeContext, flag.Namespace},
|
Global: []flag.Flag{flag.GlobalVerbosity, flag.KubeContext, flag.Namespace},
|
||||||
})
|
})
|
||||||
|
|
||||||
groups := helptemplate.CommandGroups{}
|
groups := helptemplate.CommandGroups{}
|
||||||
|
|||||||
@@ -20,11 +20,12 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/fission/fission/cmd/fission-cli/app"
|
"github.com/fission/fission/cmd/fission-cli/app"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd"
|
||||||
"github.com/fission/fission/pkg/fission-cli/console"
|
"github.com/fission/fission/pkg/fission-cli/console"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cmd := app.App()
|
cmd := app.App(cmd.ClientOptions{})
|
||||||
cmd.SilenceErrors = true // use our own error message printer
|
cmd.SilenceErrors = true // use our own error message printer
|
||||||
|
|
||||||
err := cmd.Execute()
|
err := cmd.Execute()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.17
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
RUN apk add --update ca-certificates
|
ARG TARGETPLATFORM
|
||||||
COPY pre-upgrade-checks /
|
COPY $TARGETPLATFORM/pre-upgrade-checks /
|
||||||
ENTRYPOINT ["/pre-upgrade-checks"]
|
ENTRYPOINT ["/pre-upgrade-checks"]
|
||||||
|
|||||||
@@ -18,11 +18,10 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
multierror "github.com/hashicorp/go-multierror"
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||||
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
||||||
@@ -51,19 +50,19 @@ const (
|
|||||||
MqtCRD = "messagequeuetriggers.fission.io"
|
MqtCRD = "messagequeuetriggers.fission.io"
|
||||||
)
|
)
|
||||||
|
|
||||||
func makePreUpgradeTaskClient(logger *zap.Logger) (*PreUpgradeTaskClient, error) {
|
func makePreUpgradeTaskClient(clientGen crd.ClientGeneratorInterface, logger *zap.Logger) (*PreUpgradeTaskClient, error) {
|
||||||
clientGen := crd.NewClientGenerator()
|
var err error
|
||||||
fissionClient, err := clientGen.GetFissionClient()
|
fissionClient, err := clientGen.GetFissionClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to get fission client")
|
return nil, fmt.Errorf("failed to get fission client: %w", err)
|
||||||
}
|
}
|
||||||
k8sClient, err := clientGen.GetKubernetesClient()
|
k8sClient, err := clientGen.GetKubernetesClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to get kubernetes client")
|
return nil, fmt.Errorf("failed to get kubernetes client: %w", err)
|
||||||
}
|
}
|
||||||
apiExtClient, err := clientGen.GetApiExtensionsClient()
|
apiExtClient, err := clientGen.GetApiExtensionsClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to get apiextensions client")
|
return nil, fmt.Errorf("failed to get apiextensions client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &PreUpgradeTaskClient{
|
return &PreUpgradeTaskClient{
|
||||||
@@ -125,12 +124,12 @@ func (client *PreUpgradeTaskClient) LatestSchemaApplied(ctx context.Context) err
|
|||||||
|
|
||||||
// VerifyFunctionSpecReferences verifies that a function references secrets, configmaps, pkgs in its own namespace and
|
// VerifyFunctionSpecReferences verifies that a function references secrets, configmaps, pkgs in its own namespace and
|
||||||
// outputs a list of functions that don't adhere to this requirement.
|
// outputs a list of functions that don't adhere to this requirement.
|
||||||
func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences(ctx context.Context) {
|
func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences(ctx context.Context) error {
|
||||||
client.logger.Info("verifying function spec references for all functions in the cluster")
|
client.logger.Info("verifying function spec references for all functions in the cluster")
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var fList *fv1.FunctionList
|
var fList *fv1.FunctionList
|
||||||
errs := &multierror.Error{}
|
var errs error
|
||||||
|
|
||||||
for _, namespace := range utils.DefaultNSResolver().FissionResourceNS {
|
for _, namespace := range utils.DefaultNSResolver().FissionResourceNS {
|
||||||
for i := 0; i < maxRetries; i++ {
|
for i := 0; i < maxRetries; i++ {
|
||||||
@@ -141,9 +140,11 @@ func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences(ctx context.Con
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
client.logger.Fatal("error listing functions after max retries",
|
client.logger.Error("error listing functions after max retries",
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.Int("max_retries", maxRetries))
|
zap.Int("max_retries", maxRetries))
|
||||||
|
errs = errors.Join(errs, fmt.Errorf("error listing functions in namespace : %s", namespace))
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that all secrets, configmaps, packages are in the same namespace
|
// check that all secrets, configmaps, packages are in the same namespace
|
||||||
@@ -151,28 +152,27 @@ func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences(ctx context.Con
|
|||||||
secrets := fn.Spec.Secrets
|
secrets := fn.Spec.Secrets
|
||||||
for _, secret := range secrets {
|
for _, secret := range secrets {
|
||||||
if secret.Namespace != "" && secret.Namespace != fn.ObjectMeta.Namespace {
|
if secret.Namespace != "" && secret.Namespace != fn.ObjectMeta.Namespace {
|
||||||
errs = multierror.Append(errs, fmt.Errorf("function : %s.%s cannot reference a secret : %s in namespace : %s", fn.ObjectMeta.Name, fn.ObjectMeta.Namespace, secret.Name, secret.Namespace))
|
errs = errors.Join(errs, fmt.Errorf("function : %s.%s cannot reference a secret : %s in namespace : %s", fn.ObjectMeta.Name, fn.ObjectMeta.Namespace, secret.Name, secret.Namespace))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configmaps := fn.Spec.ConfigMaps
|
configmaps := fn.Spec.ConfigMaps
|
||||||
for _, configmap := range configmaps {
|
for _, configmap := range configmaps {
|
||||||
if configmap.Namespace != "" && configmap.Namespace != fn.ObjectMeta.Namespace {
|
if configmap.Namespace != "" && configmap.Namespace != fn.ObjectMeta.Namespace {
|
||||||
errs = multierror.Append(errs, fmt.Errorf("function : %s.%s cannot reference a configmap : %s in namespace : %s", fn.ObjectMeta.Name, fn.ObjectMeta.Namespace, configmap.Name, configmap.Namespace))
|
errs = errors.Join(errs, fmt.Errorf("function : %s.%s cannot reference a configmap : %s in namespace : %s", fn.ObjectMeta.Name, fn.ObjectMeta.Namespace, configmap.Name, configmap.Namespace))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if fn.Spec.Package.PackageRef.Namespace != "" && fn.Spec.Package.PackageRef.Namespace != fn.ObjectMeta.Namespace {
|
if fn.Spec.Package.PackageRef.Namespace != "" && fn.Spec.Package.PackageRef.Namespace != fn.ObjectMeta.Namespace {
|
||||||
errs = multierror.Append(errs, fmt.Errorf("function : %s.%s cannot reference a package : %s in namespace : %s", fn.ObjectMeta.Name, fn.ObjectMeta.Namespace, fn.Spec.Package.PackageRef.Name, fn.Spec.Package.PackageRef.Namespace))
|
errs = errors.Join(errs, fmt.Errorf("function : %s.%s cannot reference a package : %s in namespace : %s", fn.ObjectMeta.Name, fn.ObjectMeta.Namespace, fn.Spec.Package.PackageRef.Name, fn.Spec.Package.PackageRef.Namespace))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if errs.ErrorOrNil() != nil {
|
if errs != nil {
|
||||||
client.logger.Fatal("installation failed",
|
return errs
|
||||||
zap.Error(errs),
|
|
||||||
zap.String("summary", "a function cannot reference secrets, configmaps and packages outside it's own namespace"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
client.logger.Info("function spec references verified")
|
client.logger.Info("function spec references verified")
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/fission/fission/test/e2e/framework"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestPreUpgradeTaskClient(t *testing.T) {
|
||||||
|
f := framework.NewFramework()
|
||||||
|
defer f.Logger().Sync()
|
||||||
|
ctx := t.Context()
|
||||||
|
err := f.Start(ctx)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
preupgradeClient, err := makePreUpgradeTaskClient(f.ClientGen(), f.Logger())
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
crd := preupgradeClient.GetFunctionCRD(ctx)
|
||||||
|
require.NotNil(t, crd)
|
||||||
|
|
||||||
|
err = preupgradeClient.LatestSchemaApplied(ctx)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
err = preupgradeClient.VerifyFunctionSpecReferences(ctx)
|
||||||
|
require.NoError(t, err)
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||||
|
|
||||||
|
"github.com/fission/fission/pkg/crd"
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -27,22 +28,25 @@ func main() {
|
|||||||
logger := loggerfactory.GetLogger()
|
logger := loggerfactory.GetLogger()
|
||||||
defer logger.Sync()
|
defer logger.Sync()
|
||||||
|
|
||||||
crdBackedClient, err := makePreUpgradeTaskClient(logger)
|
ctx := signals.SetupSignalHandler()
|
||||||
|
|
||||||
|
preupgradeClient, err := makePreUpgradeTaskClient(crd.NewClientGenerator(), logger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal("error creating a crd client, please retry helm upgrade",
|
logger.Fatal("error creating a crd client, please retry helm upgrade",
|
||||||
zap.Error(err))
|
zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := signals.SetupSignalHandler()
|
crd := preupgradeClient.GetFunctionCRD(ctx)
|
||||||
crd := crdBackedClient.GetFunctionCRD(ctx)
|
|
||||||
if crd == nil {
|
if crd == nil {
|
||||||
logger.Info("nothing to do since CRDs are not present on the cluster")
|
logger.Info("nothing to do since CRDs are not present on the cluster")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
err = preupgradeClient.LatestSchemaApplied(ctx)
|
||||||
err = crdBackedClient.LatestSchemaApplied(ctx)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal("New CRDs are not applied", zap.Error(err))
|
logger.Fatal("New CRDs are not applied", zap.Error(err))
|
||||||
}
|
}
|
||||||
crdBackedClient.VerifyFunctionSpecReferences(ctx)
|
err = preupgradeClient.VerifyFunctionSpecReferences(ctx)
|
||||||
|
if err != nil {
|
||||||
|
logger.Fatal("Function spec references are not valid", zap.Error(err))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.17
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
RUN apk add --update ca-certificates
|
ARG TARGETPLATFORM
|
||||||
COPY reporter /
|
COPY $TARGETPLATFORM/reporter /
|
||||||
ENTRYPOINT ["/reporter"]
|
ENTRYPOINT ["/reporter"]
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.10.0
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
creationTimestamp: null
|
|
||||||
name: canaryconfigs.fission.io
|
name: canaryconfigs.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
@@ -21,14 +20,19 @@ spec:
|
|||||||
description: CanaryConfig is for canary deployment of two functions.
|
description: CanaryConfig is for canary deployment of two functions.
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
description: 'APIVersion defines the versioned schema of this representation
|
description: |-
|
||||||
of an object. Servers should convert recognized schemas to the latest
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
type: string
|
type: string
|
||||||
kind:
|
kind:
|
||||||
description: 'Kind is a string value representing the REST resource this
|
description: |-
|
||||||
object represents. Servers may infer this from the endpoint the client
|
Kind is a string value representing the REST resource this object represents.
|
||||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
type: string
|
type: string
|
||||||
metadata:
|
metadata:
|
||||||
type: object
|
type: object
|
||||||
|
|||||||
+10959
-7857
File diff suppressed because it is too large
Load Diff
+4978
-3451
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.10.0
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
creationTimestamp: null
|
|
||||||
name: httptriggers.fission.io
|
name: httptriggers.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
@@ -22,14 +21,19 @@ spec:
|
|||||||
HTTP requests.
|
HTTP requests.
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
description: 'APIVersion defines the versioned schema of this representation
|
description: |-
|
||||||
of an object. Servers should convert recognized schemas to the latest
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
type: string
|
type: string
|
||||||
kind:
|
kind:
|
||||||
description: 'Kind is a string value representing the REST resource this
|
description: |-
|
||||||
object represents. Servers may infer this from the endpoint the client
|
Kind is a string value representing the REST resource this object represents.
|
||||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
type: string
|
type: string
|
||||||
metadata:
|
metadata:
|
||||||
type: object
|
type: object
|
||||||
@@ -47,35 +51,36 @@ spec:
|
|||||||
functionweights:
|
functionweights:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: integer
|
type: integer
|
||||||
description: Function Reference by weight. this map contains function
|
description: |-
|
||||||
name as key and its weight as the value. This is for canary
|
Function Reference by weight. this map contains function name as key and its weight
|
||||||
upgrade purpose.
|
as the value. This is for canary upgrade purpose.
|
||||||
nullable: true
|
nullable: true
|
||||||
type: object
|
type: object
|
||||||
name:
|
name:
|
||||||
description: Name of the function.
|
description: Name of the function.
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
description: 'Type indicates whether this function reference is
|
description: |-
|
||||||
by name or selector. For now, the only supported reference type
|
Type indicates whether this function reference is by name or selector. For now,
|
||||||
is by "name". Future reference types: * Function by label or
|
the only supported reference type is by "name". Future reference types:
|
||||||
annotation * Branch or tag of a versioned function * A "rolling
|
* Function by label or annotation
|
||||||
upgrade" from one version of a function to another Available
|
* Branch or tag of a versioned function
|
||||||
value: - name - function-weights'
|
* A "rolling upgrade" from one version of a function to another
|
||||||
|
Available value:
|
||||||
|
- name
|
||||||
|
- function-weights
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
- type
|
- type
|
||||||
type: object
|
type: object
|
||||||
host:
|
host:
|
||||||
description: 'TODO: remove this field since we have IngressConfig
|
description: |-
|
||||||
already Deprecated: the original idea of this field is not for setting
|
Deprecated: the original idea of this field is not for setting Ingress.
|
||||||
Ingress. Since we have IngressConfig now, remove Host after couple
|
Since we have IngressConfig now, remove Host after couple releases.
|
||||||
releases.'
|
|
||||||
type: string
|
type: string
|
||||||
ingressconfig:
|
ingressconfig:
|
||||||
description: 'TODO: make IngressConfig an independent Fission resource
|
description: IngressConfig for router to set up Ingress.
|
||||||
IngressConfig for router to set up Ingress.'
|
|
||||||
properties:
|
properties:
|
||||||
annotations:
|
annotations:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
@@ -85,26 +90,32 @@ spec:
|
|||||||
nullable: true
|
nullable: true
|
||||||
type: object
|
type: object
|
||||||
host:
|
host:
|
||||||
description: Host is for ingress controller to apply rules. If
|
description: |-
|
||||||
host is empty or "*", the rule applies to all inbound HTTP traffic.
|
Host is for ingress controller to apply rules. If
|
||||||
|
host is empty or "*", the rule applies to all
|
||||||
|
inbound HTTP traffic.
|
||||||
type: string
|
type: string
|
||||||
path:
|
path:
|
||||||
description: Path is for path matching. The format of path depends
|
description: |-
|
||||||
on what ingress controller you used.
|
Path is for path matching. The format of path
|
||||||
|
depends on what ingress controller you used.
|
||||||
type: string
|
type: string
|
||||||
tls:
|
tls:
|
||||||
description: TLS is for user to specify a Secret that contains
|
description: |-
|
||||||
TLS key and certificate. The domain name in the key and crt
|
TLS is for user to specify a Secret that contains
|
||||||
must match the value of Host field.
|
TLS key and certificate. The domain name in the
|
||||||
|
key and crt must match the value of Host field.
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
keepPrefix:
|
keepPrefix:
|
||||||
description: When function is exposed with Prefix based path, keepPrefix
|
description: |-
|
||||||
decides whether to keep or trim prefix in URL while invoking function.
|
When function is exposed with Prefix based path,
|
||||||
|
keepPrefix decides whether to keep or trim prefix in URL while invoking function.
|
||||||
type: boolean
|
type: boolean
|
||||||
method:
|
method:
|
||||||
description: Use Methods instead of Method. This field is going to
|
description: |-
|
||||||
be deprecated in a future release HTTP method to access a function.
|
Use Methods instead of Method. This field is going to be deprecated in a future release
|
||||||
|
HTTP method to access a function.
|
||||||
type: string
|
type: string
|
||||||
methods:
|
methods:
|
||||||
description: HTTP methods to access a function
|
description: HTTP methods to access a function
|
||||||
@@ -112,9 +123,11 @@ spec:
|
|||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
prefix:
|
prefix:
|
||||||
description: 'Prefix with which functions are exposed. NOTE: Prefix
|
description: |-
|
||||||
takes precedence over URL/RelativeURL. Note that it does not treat
|
Prefix with which functions are exposed.
|
||||||
slashes specially ("/foobar/" will be matched by the prefix "/foobar").'
|
NOTE: Prefix takes precedence over URL/RelativeURL.
|
||||||
|
Note that it does not treat slashes specially ("/foobar/" will be matched by
|
||||||
|
the prefix "/foobar").
|
||||||
type: string
|
type: string
|
||||||
relativeurl:
|
relativeurl:
|
||||||
description: RelativeURL is the exposed URL for external client to
|
description: RelativeURL is the exposed URL for external client to
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.10.0
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
creationTimestamp: null
|
|
||||||
name: kuberneteswatchtriggers.fission.io
|
name: kuberneteswatchtriggers.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
@@ -22,14 +21,19 @@ spec:
|
|||||||
invokes functions.
|
invokes functions.
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
description: 'APIVersion defines the versioned schema of this representation
|
description: |-
|
||||||
of an object. Servers should convert recognized schemas to the latest
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
type: string
|
type: string
|
||||||
kind:
|
kind:
|
||||||
description: 'Kind is a string value representing the REST resource this
|
description: |-
|
||||||
object represents. Servers may infer this from the endpoint the client
|
Kind is a string value representing the REST resource this object represents.
|
||||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
type: string
|
type: string
|
||||||
metadata:
|
metadata:
|
||||||
type: object
|
type: object
|
||||||
@@ -37,27 +41,31 @@ spec:
|
|||||||
description: KubernetesWatchTriggerSpec defines spec of KuberenetesWatchTrigger
|
description: KubernetesWatchTriggerSpec defines spec of KuberenetesWatchTrigger
|
||||||
properties:
|
properties:
|
||||||
functionref:
|
functionref:
|
||||||
description: The reference to a function for kubewatcher to invoke
|
description: |-
|
||||||
with when receiving events.
|
The reference to a function for kubewatcher to invoke with
|
||||||
|
when receiving events.
|
||||||
properties:
|
properties:
|
||||||
functionweights:
|
functionweights:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: integer
|
type: integer
|
||||||
description: Function Reference by weight. this map contains function
|
description: |-
|
||||||
name as key and its weight as the value. This is for canary
|
Function Reference by weight. this map contains function name as key and its weight
|
||||||
upgrade purpose.
|
as the value. This is for canary upgrade purpose.
|
||||||
nullable: true
|
nullable: true
|
||||||
type: object
|
type: object
|
||||||
name:
|
name:
|
||||||
description: Name of the function.
|
description: Name of the function.
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
description: 'Type indicates whether this function reference is
|
description: |-
|
||||||
by name or selector. For now, the only supported reference type
|
Type indicates whether this function reference is by name or selector. For now,
|
||||||
is by "name". Future reference types: * Function by label or
|
the only supported reference type is by "name". Future reference types:
|
||||||
annotation * Branch or tag of a versioned function * A "rolling
|
* Function by label or annotation
|
||||||
upgrade" from one version of a function to another Available
|
* Branch or tag of a versioned function
|
||||||
value: - name - function-weights'
|
* A "rolling upgrade" from one version of a function to another
|
||||||
|
Available value:
|
||||||
|
- name
|
||||||
|
- function-weights
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.10.0
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
creationTimestamp: null
|
|
||||||
name: packages.fission.io
|
name: packages.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
@@ -23,14 +22,19 @@ spec:
|
|||||||
description: Package Think of these as function-level images.
|
description: Package Think of these as function-level images.
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
description: 'APIVersion defines the versioned schema of this representation
|
description: |-
|
||||||
of an object. Servers should convert recognized schemas to the latest
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
type: string
|
type: string
|
||||||
kind:
|
kind:
|
||||||
description: 'Kind is a string value representing the REST resource this
|
description: |-
|
||||||
object represents. Servers may infer this from the endpoint the client
|
Kind is a string value representing the REST resource this object represents.
|
||||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
type: string
|
type: string
|
||||||
metadata:
|
metadata:
|
||||||
type: object
|
type: object
|
||||||
@@ -47,24 +51,30 @@ spec:
|
|||||||
runtime used to run user function.
|
runtime used to run user function.
|
||||||
properties:
|
properties:
|
||||||
checksum:
|
checksum:
|
||||||
description: Checksum ensures the integrity of packages referenced
|
description: |-
|
||||||
by URL. Ignored for literals.
|
Checksum ensures the integrity of packages
|
||||||
|
referenced by URL. Ignored for literals.
|
||||||
properties:
|
properties:
|
||||||
sum:
|
sum:
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
description: ChecksumType specifies the checksum algorithm,
|
description: |-
|
||||||
such as sha256, used for a checksum.
|
ChecksumType specifies the checksum algorithm, such as
|
||||||
|
sha256, used for a checksum.
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
literal:
|
literal:
|
||||||
description: Literal contents of the package. Can be used for
|
description: |-
|
||||||
|
Literal contents of the package. Can be used for
|
||||||
encoding packages below TODO (256 KB?) size.
|
encoding packages below TODO (256 KB?) size.
|
||||||
format: byte
|
format: byte
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
description: 'Type defines how the package is specified: literal
|
description: |-
|
||||||
or URL. Available value: - literal - url'
|
Type defines how the package is specified: literal or URL.
|
||||||
|
Available value:
|
||||||
|
- literal
|
||||||
|
- url
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
description: URL references a package.
|
description: URL references a package.
|
||||||
@@ -83,30 +93,36 @@ spec:
|
|||||||
- namespace
|
- namespace
|
||||||
type: object
|
type: object
|
||||||
source:
|
source:
|
||||||
description: Source is the archive contains source code and dependencies
|
description: |-
|
||||||
file. If the package status is in PENDING state, builder manager
|
Source is the archive contains source code and dependencies file.
|
||||||
will then notify builder to compile source and save the result as
|
If the package status is in PENDING state, builder manager will then
|
||||||
deployable archive.
|
notify builder to compile source and save the result as deployable archive.
|
||||||
properties:
|
properties:
|
||||||
checksum:
|
checksum:
|
||||||
description: Checksum ensures the integrity of packages referenced
|
description: |-
|
||||||
by URL. Ignored for literals.
|
Checksum ensures the integrity of packages
|
||||||
|
referenced by URL. Ignored for literals.
|
||||||
properties:
|
properties:
|
||||||
sum:
|
sum:
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
description: ChecksumType specifies the checksum algorithm,
|
description: |-
|
||||||
such as sha256, used for a checksum.
|
ChecksumType specifies the checksum algorithm, such as
|
||||||
|
sha256, used for a checksum.
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
literal:
|
literal:
|
||||||
description: Literal contents of the package. Can be used for
|
description: |-
|
||||||
|
Literal contents of the package. Can be used for
|
||||||
encoding packages below TODO (256 KB?) size.
|
encoding packages below TODO (256 KB?) size.
|
||||||
format: byte
|
format: byte
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
description: 'Type defines how the package is specified: literal
|
description: |-
|
||||||
or URL. Available value: - literal - url'
|
Type defines how the package is specified: literal or URL.
|
||||||
|
Available value:
|
||||||
|
- literal
|
||||||
|
- url
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
description: URL references a package.
|
description: URL references a package.
|
||||||
@@ -126,9 +142,10 @@ spec:
|
|||||||
description: BuildStatus is the package build status.
|
description: BuildStatus is the package build status.
|
||||||
type: string
|
type: string
|
||||||
lastUpdateTimestamp:
|
lastUpdateTimestamp:
|
||||||
description: LastUpdateTimestamp will store the timestamp the package
|
description: |-
|
||||||
was last updated metav1.Time is a wrapper around time.Time which
|
LastUpdateTimestamp will store the timestamp the package was last updated
|
||||||
supports correct marshaling to YAML and JSON. https://github.com/kubernetes/apimachinery/blob/44bd77c24ef93cd3a5eb6fef64e514025d10d44e/pkg/apis/meta/v1/time.go#L26-L35
|
metav1.Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.
|
||||||
|
https://github.com/kubernetes/apimachinery/blob/44bd77c24ef93cd3a5eb6fef64e514025d10d44e/pkg/apis/meta/v1/time.go#L26-L35
|
||||||
format: date-time
|
format: date-time
|
||||||
nullable: true
|
nullable: true
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.10.0
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
creationTimestamp: null
|
|
||||||
name: timetriggers.fission.io
|
name: timetriggers.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
@@ -21,19 +20,25 @@ spec:
|
|||||||
description: TimeTrigger invokes functions based on given cron schedule.
|
description: TimeTrigger invokes functions based on given cron schedule.
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
description: 'APIVersion defines the versioned schema of this representation
|
description: |-
|
||||||
of an object. Servers should convert recognized schemas to the latest
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
type: string
|
type: string
|
||||||
kind:
|
kind:
|
||||||
description: 'Kind is a string value representing the REST resource this
|
description: |-
|
||||||
object represents. Servers may infer this from the endpoint the client
|
Kind is a string value representing the REST resource this object represents.
|
||||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
type: string
|
type: string
|
||||||
metadata:
|
metadata:
|
||||||
type: object
|
type: object
|
||||||
spec:
|
spec:
|
||||||
description: TimeTriggerSpec invokes the specific function at a time or
|
description: |-
|
||||||
|
TimeTriggerSpec invokes the specific function at a time or
|
||||||
times specified by a cron string.
|
times specified by a cron string.
|
||||||
properties:
|
properties:
|
||||||
cron:
|
cron:
|
||||||
@@ -45,26 +50,40 @@ spec:
|
|||||||
functionweights:
|
functionweights:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: integer
|
type: integer
|
||||||
description: Function Reference by weight. this map contains function
|
description: |-
|
||||||
name as key and its weight as the value. This is for canary
|
Function Reference by weight. this map contains function name as key and its weight
|
||||||
upgrade purpose.
|
as the value. This is for canary upgrade purpose.
|
||||||
nullable: true
|
nullable: true
|
||||||
type: object
|
type: object
|
||||||
name:
|
name:
|
||||||
description: Name of the function.
|
description: Name of the function.
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
description: 'Type indicates whether this function reference is
|
description: |-
|
||||||
by name or selector. For now, the only supported reference type
|
Type indicates whether this function reference is by name or selector. For now,
|
||||||
is by "name". Future reference types: * Function by label or
|
the only supported reference type is by "name". Future reference types:
|
||||||
annotation * Branch or tag of a versioned function * A "rolling
|
* Function by label or annotation
|
||||||
upgrade" from one version of a function to another Available
|
* Branch or tag of a versioned function
|
||||||
value: - name - function-weights'
|
* A "rolling upgrade" from one version of a function to another
|
||||||
|
Available value:
|
||||||
|
- name
|
||||||
|
- function-weights
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
- type
|
- type
|
||||||
type: object
|
type: object
|
||||||
|
method:
|
||||||
|
default: POST
|
||||||
|
description: 'HTTP Method for trigger, ex : GET, POST, PUT, DELETE,
|
||||||
|
HEAD (default: "POST")'
|
||||||
|
type: string
|
||||||
|
subpath:
|
||||||
|
default: /
|
||||||
|
description: |-
|
||||||
|
Subpath to trigger a specific route if function
|
||||||
|
internally supports routing, (default: "/")
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- cron
|
- cron
|
||||||
- functionref
|
- functionref
|
||||||
|
|||||||
+12
-10
@@ -1,13 +1,15 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
commonLabels:
|
|
||||||
group: fission.io
|
|
||||||
resources:
|
resources:
|
||||||
- fission.io_canaryconfigs.yaml
|
- fission.io_canaryconfigs.yaml
|
||||||
- fission.io_environments.yaml
|
- fission.io_environments.yaml
|
||||||
- fission.io_functions.yaml
|
- fission.io_functions.yaml
|
||||||
- fission.io_httptriggers.yaml
|
- fission.io_httptriggers.yaml
|
||||||
- fission.io_kuberneteswatchtriggers.yaml
|
- fission.io_kuberneteswatchtriggers.yaml
|
||||||
- fission.io_messagequeuetriggers.yaml
|
- fission.io_messagequeuetriggers.yaml
|
||||||
- fission.io_packages.yaml
|
- fission.io_packages.yaml
|
||||||
- fission.io_timetriggers.yaml
|
- fission.io_timetriggers.yaml
|
||||||
|
labels:
|
||||||
|
- includeSelectors: true
|
||||||
|
pairs:
|
||||||
|
group: fission.io
|
||||||
|
|||||||
@@ -1,196 +1,227 @@
|
|||||||
module github.com/fission/fission
|
module github.com/fission/fission
|
||||||
|
|
||||||
go 1.20
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Shopify/sarama v1.37.2
|
dario.cat/mergo v1.0.2
|
||||||
|
github.com/IBM/sarama v1.46.3
|
||||||
github.com/bep/debounce v1.2.1
|
github.com/bep/debounce v1.2.1
|
||||||
github.com/dchest/uniuri v1.2.0
|
github.com/dchest/uniuri v1.2.0
|
||||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
github.com/dustin/go-humanize v1.0.1
|
||||||
github.com/dustin/go-humanize v1.0.0
|
github.com/fatih/color v1.18.0
|
||||||
github.com/elastic/crd-ref-docs v0.0.8
|
github.com/fsnotify/fsnotify v1.9.0
|
||||||
github.com/emicklei/go-restful-openapi/v2 v2.9.1
|
github.com/go-git/go-git/v5 v5.16.4
|
||||||
github.com/emicklei/go-restful/v3 v3.10.1
|
github.com/go-logr/zapr v1.3.0
|
||||||
github.com/fatih/color v1.13.0
|
github.com/golang-jwt/jwt/v4 v4.5.2
|
||||||
github.com/fsnotify/fsnotify v1.6.0
|
github.com/google/go-cmp v0.7.0
|
||||||
github.com/go-git/go-git/v5 v5.4.2
|
github.com/google/uuid v1.6.0
|
||||||
github.com/go-openapi/spec v0.20.7
|
github.com/gorilla/mux v1.8.1
|
||||||
github.com/golang-jwt/jwt/v4 v4.4.3
|
|
||||||
github.com/google/go-cmp v0.5.9
|
|
||||||
github.com/gorilla/mux v1.8.0
|
|
||||||
github.com/graymeta/stow v0.2.8
|
github.com/graymeta/stow v0.2.8
|
||||||
github.com/hashicorp/go-multierror v1.1.1
|
github.com/hashicorp/go-multierror v1.1.1
|
||||||
github.com/hashicorp/go-retryablehttp v0.7.1
|
github.com/hashicorp/go-retryablehttp v0.7.8
|
||||||
github.com/imdario/mergo v0.3.13
|
github.com/influxdata/influxdb v1.12.2
|
||||||
github.com/influxdata/influxdb v1.11.0
|
github.com/kedacore/keda/v2 v2.18.2
|
||||||
github.com/mholt/archiver/v3 v3.5.1
|
github.com/mholt/archives v0.1.5
|
||||||
github.com/minio/minio-go v6.0.14+incompatible
|
github.com/minio/minio-go/v7 v7.0.97
|
||||||
github.com/ory/dockertest v3.3.5+incompatible
|
github.com/ory/dockertest/v3 v3.12.0
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/prometheus/client_golang v1.23.2
|
||||||
github.com/prometheus/client_golang v1.14.0
|
github.com/prometheus/common v0.67.4
|
||||||
github.com/prometheus/common v0.37.0
|
github.com/robfig/cron/v3 v3.0.1
|
||||||
github.com/robfig/cron/v3 v3.0.0
|
|
||||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
||||||
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
|
github.com/spf13/cobra v1.10.2
|
||||||
github.com/spf13/cobra v1.6.1
|
github.com/spf13/pflag v1.0.10
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/stretchr/testify v1.11.1
|
||||||
github.com/stretchr/testify v1.8.1
|
|
||||||
github.com/wcharczuk/go-chart v2.0.1+incompatible
|
github.com/wcharczuk/go-chart v2.0.1+incompatible
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0
|
||||||
go.opentelemetry.io/contrib/propagators/autoprop v0.37.0
|
go.opentelemetry.io/contrib/propagators/autoprop v0.64.0
|
||||||
go.opentelemetry.io/otel v1.11.2
|
go.opentelemetry.io/otel v1.39.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.2
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.2
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0
|
||||||
go.opentelemetry.io/otel/sdk v1.11.2
|
go.opentelemetry.io/otel/sdk v1.39.0
|
||||||
go.opentelemetry.io/otel/trace v1.11.2
|
go.opentelemetry.io/otel/trace v1.39.0
|
||||||
go.uber.org/zap v1.24.0
|
go.uber.org/zap v1.27.1
|
||||||
golang.org/x/net v0.7.0
|
golang.org/x/net v0.48.0
|
||||||
google.golang.org/grpc v1.51.0
|
google.golang.org/grpc v1.77.0
|
||||||
k8s.io/api v0.25.4
|
k8s.io/api v0.34.3
|
||||||
k8s.io/apiextensions-apiserver v0.25.4
|
k8s.io/apiextensions-apiserver v0.34.3
|
||||||
k8s.io/apimachinery v0.25.4
|
k8s.io/apimachinery v0.34.3
|
||||||
k8s.io/client-go v0.25.4
|
k8s.io/client-go v0.34.3
|
||||||
k8s.io/metrics v0.25.4
|
k8s.io/metrics v0.34.3
|
||||||
sigs.k8s.io/controller-runtime v0.13.1
|
sigs.k8s.io/controller-runtime v0.22.4
|
||||||
sigs.k8s.io/controller-tools v0.10.0
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.1
|
||||||
sigs.k8s.io/yaml v1.3.0
|
sigs.k8s.io/yaml v1.6.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.99.0 // indirect
|
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
|
||||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
|
||||||
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
|
|
||||||
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
|
|
||||||
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
|
|
||||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
|
||||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
|
||||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||||
github.com/Masterminds/semver v1.5.0 // indirect
|
github.com/Masterminds/semver v1.5.0 // indirect
|
||||||
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
|
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
|
||||||
github.com/Microsoft/go-winio v0.5.2 // indirect
|
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
|
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 // indirect
|
github.com/ProtonMail/go-crypto v1.1.6 // indirect
|
||||||
github.com/acomagu/bufpipe v1.0.3 // indirect
|
github.com/STARRY-S/zip v0.2.3 // indirect
|
||||||
github.com/andybalholm/brotli v1.0.1 // indirect
|
github.com/andybalholm/brotli v1.2.0 // indirect
|
||||||
github.com/aws/aws-sdk-go v1.42.34 // indirect
|
github.com/aws/aws-sdk-go v1.55.7 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/blend/go-sdk v1.20220112.5 // indirect
|
github.com/blend/go-sdk v1.20220112.5 // indirect
|
||||||
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
github.com/bodgit/plumbing v1.3.0 // indirect
|
||||||
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
|
github.com/bodgit/sevenzip v1.6.1 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
github.com/bodgit/windows v1.0.1 // indirect
|
||||||
github.com/cloudflare/circl v1.1.0 // indirect
|
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||||
github.com/containerd/continuity v0.2.2 // indirect
|
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/cloudflare/circl v1.6.1 // indirect
|
||||||
github.com/docker/go-connections v0.4.0 // indirect
|
github.com/containerd/continuity v0.4.5 // indirect
|
||||||
github.com/docker/go-units v0.4.0 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
|
||||||
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
|
github.com/cyphar/filepath-securejoin v0.5.1 // indirect
|
||||||
github.com/eapache/go-resiliency v1.3.0 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
|
github.com/docker/cli v27.4.1+incompatible // indirect
|
||||||
|
github.com/docker/docker v28.1.1+incompatible // indirect
|
||||||
|
github.com/docker/go-connections v0.5.0 // indirect
|
||||||
|
github.com/docker/go-units v0.5.0 // indirect
|
||||||
|
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
|
||||||
|
github.com/eapache/go-resiliency v1.7.0 // indirect
|
||||||
|
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
|
||||||
github.com/eapache/queue v1.1.0 // indirect
|
github.com/eapache/queue v1.1.0 // indirect
|
||||||
|
github.com/elastic/crd-ref-docs v0.2.0 // indirect
|
||||||
|
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
|
||||||
github.com/emirpasic/gods v1.18.1 // indirect
|
github.com/emirpasic/gods v1.18.1 // indirect
|
||||||
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
|
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
|
||||||
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
|
github.com/expr-lang/expr v1.17.6 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
github.com/go-git/gcfg v1.5.0 // indirect
|
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||||
github.com/go-git/go-billy/v5 v5.3.1 // indirect
|
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||||
github.com/go-ini/ini v1.66.4 // indirect
|
github.com/go-git/go-billy/v5 v5.6.2 // indirect
|
||||||
github.com/go-logr/logr v1.2.3 // indirect
|
github.com/go-ini/ini v1.67.0 // indirect
|
||||||
|
github.com/go-logr/logr v1.4.3 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-logr/zapr v1.2.3 // indirect
|
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.0 // indirect
|
github.com/go-openapi/swag v0.23.0 // indirect
|
||||||
github.com/go-openapi/swag v0.19.15 // indirect
|
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
|
||||||
github.com/gobuffalo/flect v0.2.5 // indirect
|
github.com/gobuffalo/flect v1.0.3 // indirect
|
||||||
github.com/goccy/go-yaml v1.1.5 // indirect
|
github.com/goccy/go-yaml v1.18.0 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/golang/snappy v1.0.0 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/google/btree v1.1.3 // indirect
|
||||||
github.com/google/gnostic v0.5.7-v3refs // indirect
|
github.com/google/gnostic-models v0.7.0 // indirect
|
||||||
github.com/google/gofuzz v1.1.0 // indirect
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
|
||||||
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
|
|
||||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||||
github.com/huandu/xstrings v1.2.1 // indirect
|
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
github.com/huandu/xstrings v1.5.0 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.16 // indirect
|
||||||
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||||
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/gofork v1.7.6 // indirect
|
github.com/jcmturner/gofork v1.7.6 // indirect
|
||||||
github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect
|
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
|
||||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||||
github.com/klauspost/compress v1.15.11 // indirect
|
github.com/klauspost/compress v1.18.1 // indirect
|
||||||
github.com/klauspost/pgzip v1.2.5 // indirect
|
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||||
github.com/lib/pq v1.10.4 // indirect
|
github.com/klauspost/crc32 v1.3.0 // indirect
|
||||||
github.com/mailru/easyjson v0.7.6 // indirect
|
github.com/klauspost/pgzip v1.2.6 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
github.com/mailru/easyjson v0.9.0 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/mitchellh/copystructure v1.0.0 // indirect
|
github.com/mikelolasagasti/xz v1.0.1 // indirect
|
||||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
github.com/minio/crc64nvme v1.1.0 // indirect
|
||||||
github.com/mitchellh/reflectwalk v1.0.0 // indirect
|
github.com/minio/md5-simd v1.1.2 // indirect
|
||||||
github.com/moby/spdystream v0.2.0 // indirect
|
github.com/minio/minlz v1.0.1 // indirect
|
||||||
|
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||||
|
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||||
|
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||||
|
github.com/moby/spdystream v0.5.0 // indirect
|
||||||
|
github.com/moby/sys/user v0.3.0 // indirect
|
||||||
|
github.com/moby/term v0.5.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
github.com/nwaples/rardecode v1.1.0 // indirect
|
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||||
|
github.com/nwaples/rardecode/v2 v2.2.0 // indirect
|
||||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||||
github.com/opencontainers/image-spec v1.0.2 // indirect
|
github.com/opencontainers/image-spec v1.1.0 // indirect
|
||||||
github.com/opencontainers/runc v1.1.5 // indirect
|
github.com/opencontainers/runc v1.2.8 // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
github.com/philhofer/fwd v1.2.0 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||||
github.com/prometheus/client_model v0.3.0 // indirect
|
github.com/pjbgf/sha1cd v0.3.2 // indirect
|
||||||
github.com/prometheus/procfs v0.8.0 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/rogpeppe/go-internal v1.9.0 // indirect
|
github.com/prometheus/client_model v0.6.2 // indirect
|
||||||
|
github.com/prometheus/procfs v0.17.0 // indirect
|
||||||
|
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
|
||||||
|
github.com/rs/xid v1.6.0 // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/sergi/go-diff v1.1.0 // indirect
|
github.com/sergi/go-diff v1.4.0 // indirect
|
||||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||||
github.com/ulikunitz/xz v0.5.9 // indirect
|
github.com/skeema/knownhosts v1.3.1 // indirect
|
||||||
github.com/xanzy/ssh-agent v0.3.2 // indirect
|
github.com/sorairolake/lzip-go v0.3.8 // indirect
|
||||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
|
github.com/spf13/afero v1.15.0 // indirect
|
||||||
go.opentelemetry.io/contrib/propagators/aws v1.12.0 // indirect
|
github.com/tinylib/msgp v1.3.0 // indirect
|
||||||
go.opentelemetry.io/contrib/propagators/b3 v1.12.0 // indirect
|
github.com/ulikunitz/xz v0.5.15 // indirect
|
||||||
go.opentelemetry.io/contrib/propagators/jaeger v1.12.0 // indirect
|
github.com/x448/float16 v0.8.4 // indirect
|
||||||
go.opentelemetry.io/contrib/propagators/ot v1.12.0 // indirect
|
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.2 // indirect
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||||
go.opentelemetry.io/otel/metric v0.34.0 // indirect
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
|
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||||
go.uber.org/multierr v1.8.0 // indirect
|
go.opentelemetry.io/contrib/propagators/aws v1.39.0 // indirect
|
||||||
golang.org/x/crypto v0.3.0 // indirect
|
go.opentelemetry.io/contrib/propagators/b3 v1.39.0 // indirect
|
||||||
golang.org/x/image v0.5.0 // indirect
|
go.opentelemetry.io/contrib/propagators/jaeger v1.39.0 // indirect
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
go.opentelemetry.io/contrib/propagators/ot v1.39.0 // indirect
|
||||||
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
|
go.opentelemetry.io/otel/metric v1.39.0 // indirect
|
||||||
golang.org/x/sys v0.5.0 // indirect
|
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
|
||||||
golang.org/x/term v0.5.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/text v0.7.0 // indirect
|
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||||
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
|
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||||
golang.org/x/tools v0.1.12 // indirect
|
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
|
golang.org/x/crypto v0.46.0 // indirect
|
||||||
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
|
golang.org/x/image v0.18.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
golang.org/x/mod v0.30.0 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03 // indirect
|
golang.org/x/oauth2 v0.33.0 // indirect
|
||||||
google.golang.org/protobuf v1.28.1 // indirect
|
golang.org/x/sync v0.19.0 // indirect
|
||||||
|
golang.org/x/sys v0.39.0 // indirect
|
||||||
|
golang.org/x/term v0.38.0 // indirect
|
||||||
|
golang.org/x/text v0.32.0 // indirect
|
||||||
|
golang.org/x/time v0.14.0 // indirect
|
||||||
|
golang.org/x/tools v0.39.0 // indirect
|
||||||
|
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
||||||
|
google.golang.org/protobuf v1.36.10 // indirect
|
||||||
|
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
gotest.tools v2.2.0+incompatible // indirect
|
k8s.io/code-generator v0.34.3 // indirect
|
||||||
k8s.io/component-base v0.25.4 // indirect
|
k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect
|
||||||
k8s.io/klog/v2 v2.70.1 // indirect
|
k8s.io/klog/v2 v2.130.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
|
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
|
||||||
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
|
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
|
||||||
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
|
knative.dev/pkg v0.0.0-20250326102644-9f3e60a9244c // indirect
|
||||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250211091558-894df3a7e664 // indirect
|
||||||
|
sigs.k8s.io/controller-tools v0.19.0 // indirect
|
||||||
|
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
|
||||||
|
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
tool (
|
||||||
|
github.com/elastic/crd-ref-docs
|
||||||
|
k8s.io/code-generator
|
||||||
|
sigs.k8s.io/controller-runtime/tools/setup-envtest
|
||||||
|
sigs.k8s.io/controller-tools/cmd/controller-gen
|
||||||
|
)
|
||||||
|
|
||||||
|
replace k8s.io/code-generator => github.com/fission/code-generator v0.18.0-alpha.1.0.20250914164041-5cd640227cd4
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
if ! command -v dashboard-linter >/dev/null 2>&1; then
|
if ! command -v dashboard-linter >/dev/null 2>&1; then
|
||||||
echo "dashboard-linter is not installed"
|
echo "dashboard-linter is not installed"
|
||||||
|
echo "Installing dashboard-linter..."
|
||||||
|
go install github.com/grafana/dashboard-linter@latest
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
BASE_PATH=$(pwd)
|
BASE_PATH=$(pwd)
|
||||||
|
|||||||
+13
-7
@@ -28,12 +28,18 @@ set +x
|
|||||||
# for codecov
|
# for codecov
|
||||||
echo "" > coverage.txt
|
echo "" > coverage.txt
|
||||||
|
|
||||||
|
KUBEBUILDER_ASSETS=$(go tool setup-envtest -p path use 1.30.x)
|
||||||
|
export KUBEBUILDER_ASSETS
|
||||||
|
|
||||||
# The executor unit test only works with NodePort-type services for
|
# The executor unit test only works with NodePort-type services for
|
||||||
# now. So disable it for our travis ci tests except some partial tests.
|
# now. So disable it for our travis ci tests except some partial tests.
|
||||||
for d in $(go list ./... | grep -v '/vendor/' | grep -v 'examples/go' | grep -v executor | grep -v 'benchmark') github.com/fission/fission/pkg/executor/util; do
|
# for d in $(go list ./... | grep -v '/vendor/' | grep -v 'examples/go' | grep -v 'benchmark'); do
|
||||||
go test -race -v -coverprofile=profile.out -covermode=atomic $d
|
# echo "Running tests in $d"
|
||||||
if [ -f profile.out ]; then
|
# go test -race -v -coverprofile=profile.out -covermode=atomic $d
|
||||||
cat profile.out >> coverage.txt
|
# if [ -f profile.out ]; then
|
||||||
rm profile.out
|
# cat profile.out >> coverage.txt
|
||||||
fi
|
# rm profile.out
|
||||||
done
|
# fi
|
||||||
|
# done
|
||||||
|
echo "Running tests ..."
|
||||||
|
go test -race -v -coverprofile=coverage.txt -covermode=atomic --coverpkg=./... ./...
|
||||||
+27
-10
@@ -3,17 +3,34 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
if [ ! -d "../code-generator" ]; then
|
CODEGEN_PKG_VERSION=$(go list -m -f '{{.Replace.Version}}' k8s.io/code-generator)
|
||||||
echo "Please get code-generator from fission org"
|
if [ -z "$CODEGEN_PKG_VERSION" ]; then
|
||||||
|
echo "Error: could not determine code-generator version from go.mod"
|
||||||
|
echo "Received output: '$CODEGEN_PKG_VERSION'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
GOPATH=$(go env GOPATH)
|
||||||
|
GOMODCACHEPATH=$(go env GOMODCACHE)
|
||||||
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
|
CODEGEN_PKG=${CODEGEN_PKG:-$(
|
||||||
|
cd "${SCRIPT_ROOT}"
|
||||||
|
echo ${GOMODCACHEPATH}/github.com/fission/code-generator@${CODEGEN_PKG_VERSION}
|
||||||
|
)}
|
||||||
|
OUTDIR="${SCRIPT_ROOT}/pkg/generated"
|
||||||
|
|
||||||
bash "${CODEGEN_PKG}"/generate-groups.sh "client,informer,lister" \
|
echo "Generating code under ${OUTDIR} using ${CODEGEN_PKG} ..."
|
||||||
github.com/fission/fission/pkg/generated \
|
|
||||||
github.com/fission/fission/pkg/apis \
|
source "${CODEGEN_PKG}/kube_codegen.sh"
|
||||||
"core:v1" \
|
|
||||||
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../../.." \
|
# kube::codegen::gen_helpers \
|
||||||
--go-header-file "$(dirname "${BASH_SOURCE[0]}")/boilerplate.txt"
|
# --input-pkg-root github.com/fission/fission/pkg/apis \
|
||||||
|
# --output-base "${OUTDIR}" \
|
||||||
|
# --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.txt"
|
||||||
|
|
||||||
|
kube::codegen::gen_client \
|
||||||
|
--with-watch \
|
||||||
|
--with-applyconfig \
|
||||||
|
--output-pkg github.com/fission/fission/pkg/generated \
|
||||||
|
--output-dir "${OUTDIR}" \
|
||||||
|
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.txt" \
|
||||||
|
"${SCRIPT_ROOT}/pkg/apis" \
|
||||||
|
|||||||
@@ -167,3 +167,7 @@ const (
|
|||||||
ConfigMaps = "configmaps"
|
ConfigMaps = "configmaps"
|
||||||
Secrets = "secrets"
|
Secrets = "secrets"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
BuilderContainerName = "builder"
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2022.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
|
||||||
)
|
|
||||||
|
|
||||||
// log is for logging in this package.
|
|
||||||
var environmentlog = loggerfactory.GetLogger().Named("environment-resource")
|
|
||||||
|
|
||||||
func (r *Environment) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
|
||||||
return ctrl.NewWebhookManagedBy(mgr).
|
|
||||||
For(r).
|
|
||||||
Complete()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Admission webhooks can be added by adding tag: kubebuilder:webhook:path=/mutate-fission-io-v1-environment,mutating=true,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=environments,verbs=create;update,versions=v1,name=menvironment.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Defaulter = &Environment{}
|
|
||||||
|
|
||||||
// Default implements webhook.Defaulter so a webhook will be registered for the type
|
|
||||||
func (r *Environment) Default() {
|
|
||||||
environmentlog.Debug("default", zap.String("name", r.Name))
|
|
||||||
}
|
|
||||||
|
|
||||||
// user: change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
|
|
||||||
//+kubebuilder:webhook:path=/validate-fission-io-v1-environment,mutating=false,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=environments,verbs=create,versions=v1,name=venvironment.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Validator = &Environment{}
|
|
||||||
|
|
||||||
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Environment) ValidateCreate() error {
|
|
||||||
environmentlog.Debug("validate create", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("Environment", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Environment) ValidateUpdate(old runtime.Object) error {
|
|
||||||
environmentlog.Debug("validate update", zap.String("name", r.Name))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Environment) ValidateDelete() error {
|
|
||||||
environmentlog.Debug("validate delete", zap.String("name", r.Name))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2022.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
|
||||||
)
|
|
||||||
|
|
||||||
// log is for logging in this package.
|
|
||||||
var functionlog = loggerfactory.GetLogger().Named("function-resource")
|
|
||||||
|
|
||||||
func (r *Function) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
|
||||||
return ctrl.NewWebhookManagedBy(mgr).
|
|
||||||
For(r).
|
|
||||||
Complete()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Admission webhooks can be added by adding tag: kubebuilder:webhook:path=/mutate-fission-io-v1-function,mutating=true,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=functions,verbs=create;update,versions=v1,name=mfunction.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Defaulter = &Function{}
|
|
||||||
|
|
||||||
// Default implements webhook.Defaulter so a webhook will be registered for the type
|
|
||||||
func (r *Function) Default() {
|
|
||||||
}
|
|
||||||
|
|
||||||
// user change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
|
|
||||||
//+kubebuilder:webhook:path=/validate-fission-io-v1-function,mutating=false,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=functions,verbs=create;update,versions=v1,name=vfunction.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Validator = &Function{}
|
|
||||||
|
|
||||||
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Function) ValidateCreate() error {
|
|
||||||
functionlog.Debug("validate create", zap.String("name", r.Name))
|
|
||||||
|
|
||||||
for _, cnfMap := range r.Spec.ConfigMaps {
|
|
||||||
if cnfMap.Namespace != r.ObjectMeta.Namespace {
|
|
||||||
err := fmt.Errorf("ConfigMap's [%s] and function's Namespace [%s] are different. ConfigMap needs to be present in the same namespace as function", cnfMap.Namespace, r.ObjectMeta.Namespace)
|
|
||||||
return AggregateValidationErrors("Function", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for _, secret := range r.Spec.Secrets {
|
|
||||||
if secret.Namespace != r.ObjectMeta.Namespace {
|
|
||||||
err := fmt.Errorf("secret [%s] and function's Namespace [%s] are different. Secret needs to be present in the same namespace as function", secret.Namespace, r.ObjectMeta.Namespace)
|
|
||||||
return AggregateValidationErrors("Function", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
return AggregateValidationErrors("Function", err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Function) ValidateUpdate(old runtime.Object) error {
|
|
||||||
functionlog.Debug("validate update", zap.String("name", r.Name))
|
|
||||||
|
|
||||||
for _, cnfMap := range r.Spec.ConfigMaps {
|
|
||||||
if cnfMap.Namespace != r.ObjectMeta.Namespace {
|
|
||||||
err := fmt.Errorf("ConfigMap's [%s] and function's Namespace [%s] are different. ConfigMap needs to be present in the same namespace as function", cnfMap.Namespace, r.ObjectMeta.Namespace)
|
|
||||||
return AggregateValidationErrors("Function", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for _, secret := range r.Spec.Secrets {
|
|
||||||
if secret.Namespace != r.ObjectMeta.Namespace {
|
|
||||||
err := fmt.Errorf("secret [%s] and function's Namespace [%s] are different. Secret needs to be present in the same namespace as function", secret.Namespace, r.ObjectMeta.Namespace)
|
|
||||||
return AggregateValidationErrors("Function", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
return AggregateValidationErrors("Function", err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Function) ValidateDelete() error {
|
|
||||||
functionlog.Debug("validate delete", zap.String("name", r.Name))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2022.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
|
||||||
)
|
|
||||||
|
|
||||||
// log is for logging in this package.
|
|
||||||
var httptriggerlog = loggerfactory.GetLogger().Named("httptrigger-resource")
|
|
||||||
|
|
||||||
func (r *HTTPTrigger) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
|
||||||
return ctrl.NewWebhookManagedBy(mgr).
|
|
||||||
For(r).
|
|
||||||
Complete()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Admission webhooks can be added by adding tag: kubebuilder:webhook:path=/mutate-fission-io-v1-httptrigger,mutating=true,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=httptriggers,verbs=create;update,versions=v1,name=mhttptrigger.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Defaulter = &HTTPTrigger{}
|
|
||||||
|
|
||||||
// Default implements webhook.Defaulter so a webhook will be registered for the type
|
|
||||||
func (r *HTTPTrigger) Default() {
|
|
||||||
httptriggerlog.Debug("default", zap.String("name", r.Name))
|
|
||||||
}
|
|
||||||
|
|
||||||
// user change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
|
|
||||||
//+kubebuilder:webhook:path=/validate-fission-io-v1-httptrigger,mutating=false,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=httptriggers,verbs=create;update,versions=v1,name=vhttptrigger.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Validator = &HTTPTrigger{}
|
|
||||||
|
|
||||||
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (t *HTTPTrigger) ValidateCreate() error {
|
|
||||||
httptriggerlog.Debug("validate create", zap.String("name", t.Name))
|
|
||||||
err := t.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("HTTPTrigger", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *HTTPTrigger) ValidateUpdate(old runtime.Object) error {
|
|
||||||
httptriggerlog.Debug("validate update", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("HTTPTrigger", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *HTTPTrigger) ValidateDelete() error {
|
|
||||||
httptriggerlog.Debug("validate delete", zap.String("name", r.Name))
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2022.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
|
||||||
)
|
|
||||||
|
|
||||||
// log is for logging in this package.
|
|
||||||
var kuberneteswatchtriggerlog = loggerfactory.GetLogger().Named("kuberneteswatchtrigger-resource")
|
|
||||||
|
|
||||||
func (r *KubernetesWatchTrigger) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
|
||||||
return ctrl.NewWebhookManagedBy(mgr).
|
|
||||||
For(r).
|
|
||||||
Complete()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Admission webhooks can be added by adding tag: kubebuilder:webhook:path=/mutate-fission-io-v1-kuberneteswatchtrigger,mutating=true,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=kuberneteswatchtriggers,verbs=create;update,versions=v1,name=mkuberneteswatchtrigger.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Defaulter = &KubernetesWatchTrigger{}
|
|
||||||
|
|
||||||
// Default implements webhook.Defaulter so a webhook will be registered for the type
|
|
||||||
func (r *KubernetesWatchTrigger) Default() {
|
|
||||||
kuberneteswatchtriggerlog.Debug("default", zap.String("name", r.Name))
|
|
||||||
}
|
|
||||||
|
|
||||||
// user: change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
|
|
||||||
//+kubebuilder:webhook:path=/validate-fission-io-v1-kuberneteswatchtrigger,mutating=false,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=kuberneteswatchtriggers,verbs=create,versions=v1,name=vkuberneteswatchtrigger.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Validator = &KubernetesWatchTrigger{}
|
|
||||||
|
|
||||||
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *KubernetesWatchTrigger) ValidateCreate() error {
|
|
||||||
kuberneteswatchtriggerlog.Debug("validate create", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("Watch", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *KubernetesWatchTrigger) ValidateUpdate(old runtime.Object) error {
|
|
||||||
// WATCH UPDATE NOT IMPLEMENTED
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *KubernetesWatchTrigger) ValidateDelete() error {
|
|
||||||
kuberneteswatchtriggerlog.Debug("validate delete", zap.String("name", r.Name))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2022.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
|
||||||
)
|
|
||||||
|
|
||||||
// log is for logging in this package.
|
|
||||||
var messagequeuetriggerlog = loggerfactory.GetLogger().Named("messagequeuetrigger-resource")
|
|
||||||
|
|
||||||
func (r *MessageQueueTrigger) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
|
||||||
return ctrl.NewWebhookManagedBy(mgr).
|
|
||||||
For(r).
|
|
||||||
Complete()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Admission webhooks can be added by adding tag: kubebuilder:webhook:path=/mutate-fission-io-v1-messagequeuetrigger,mutating=true,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=messagequeuetriggers,verbs=create;update,versions=v1,name=mmessagequeuetrigger.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Defaulter = &MessageQueueTrigger{}
|
|
||||||
|
|
||||||
// Default implements webhook.Defaulter so a webhook will be registered for the type
|
|
||||||
func (r *MessageQueueTrigger) Default() {
|
|
||||||
messagequeuetriggerlog.Debug("default", zap.String("name", r.Name))
|
|
||||||
}
|
|
||||||
|
|
||||||
// user change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
|
|
||||||
//+kubebuilder:webhook:path=/validate-fission-io-v1-messagequeuetrigger,mutating=false,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=messagequeuetriggers,verbs=create;update,versions=v1,name=vmessagequeuetrigger.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Validator = &MessageQueueTrigger{}
|
|
||||||
|
|
||||||
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *MessageQueueTrigger) ValidateCreate() error {
|
|
||||||
messagequeuetriggerlog.Debug("validate create", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("MessageQueueTrigger", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *MessageQueueTrigger) ValidateUpdate(old runtime.Object) error {
|
|
||||||
messagequeuetriggerlog.Debug("validate update", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("MessageQueueTrigger", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *MessageQueueTrigger) ValidateDelete() error {
|
|
||||||
messagequeuetriggerlog.Debug("validate delete", zap.String("name", r.Name))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2022.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/dustin/go-humanize"
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
|
||||||
|
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
|
||||||
)
|
|
||||||
|
|
||||||
// log is for logging in this package.
|
|
||||||
var packagelog = loggerfactory.GetLogger().Named("package-resource")
|
|
||||||
|
|
||||||
func (r *Package) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
|
||||||
return ctrl.NewWebhookManagedBy(mgr).
|
|
||||||
For(r).
|
|
||||||
Complete()
|
|
||||||
}
|
|
||||||
|
|
||||||
//+kubebuilder:webhook:path=/mutate-fission-io-v1-package,mutating=true,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=packages,verbs=create;update,versions=v1,name=mpackage.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Defaulter = &Package{}
|
|
||||||
|
|
||||||
// Default implements webhook.Defaulter so a webhook will be registered for the type
|
|
||||||
func (r *Package) Default() {
|
|
||||||
packagelog.Debug("default", zap.String("name", r.Name))
|
|
||||||
if r.Status.BuildStatus == "" {
|
|
||||||
r.Status.BuildStatus = BuildStatusPending
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// user change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
|
|
||||||
//+kubebuilder:webhook:path=/validate-fission-io-v1-package,mutating=false,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=packages,verbs=create;update,versions=v1,name=vpackage.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Validator = &Package{}
|
|
||||||
|
|
||||||
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Package) ValidateCreate() error {
|
|
||||||
packagelog.Debug("validate create", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("Package", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure size limits
|
|
||||||
if len(r.Spec.Source.Literal) > int(ArchiveLiteralSizeLimit) {
|
|
||||||
err := ferror.MakeError(ferror.ErrorInvalidArgument,
|
|
||||||
fmt.Sprintf("Package literal larger than %s", humanize.Bytes(uint64(ArchiveLiteralSizeLimit))))
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if len(r.Spec.Deployment.Literal) > int(ArchiveLiteralSizeLimit) {
|
|
||||||
err := ferror.MakeError(ferror.ErrorInvalidArgument,
|
|
||||||
fmt.Sprintf("Package literal larger than %s", humanize.Bytes(uint64(ArchiveLiteralSizeLimit))))
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Package) ValidateUpdate(old runtime.Object) error {
|
|
||||||
packagelog.Debug("validate update", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("Package", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *Package) ValidateDelete() error {
|
|
||||||
packagelog.Debug("validate delete", zap.String("name", r.Name))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2022.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package v1
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
|
||||||
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
|
||||||
|
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
|
||||||
)
|
|
||||||
|
|
||||||
// log is for logging in this package.
|
|
||||||
var timetriggerlog = loggerfactory.GetLogger().Named("timetrigger-resource")
|
|
||||||
|
|
||||||
func (r *TimeTrigger) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
|
||||||
return ctrl.NewWebhookManagedBy(mgr).
|
|
||||||
For(r).
|
|
||||||
Complete()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Admission webhooks can be added by adding tag: kubebuilder:webhook:path=/mutate-fission-io-v1-timetrigger,mutating=true,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=timetriggers,verbs=create;update,versions=v1,name=mtimetrigger.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Defaulter = &TimeTrigger{}
|
|
||||||
|
|
||||||
// Default implements webhook.Defaulter so a webhook will be registered for the type
|
|
||||||
func (r *TimeTrigger) Default() {
|
|
||||||
timetriggerlog.Debug("default", zap.String("name", r.Name))
|
|
||||||
}
|
|
||||||
|
|
||||||
// user change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
|
|
||||||
//+kubebuilder:webhook:path=/validate-fission-io-v1-timetrigger,mutating=false,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=timetriggers,verbs=create;update,versions=v1,name=vtimetrigger.fission.io,admissionReviewVersions=v1
|
|
||||||
|
|
||||||
var _ webhook.Validator = &TimeTrigger{}
|
|
||||||
|
|
||||||
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *TimeTrigger) ValidateCreate() error {
|
|
||||||
timetriggerlog.Debug("validate create", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("TimeTrigger", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = IsValidCronSpec(r.Spec.Cron)
|
|
||||||
if err != nil {
|
|
||||||
err = ferror.MakeError(ferror.ErrorInvalidArgument, "TimeTrigger cron spec is not valid")
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *TimeTrigger) ValidateUpdate(old runtime.Object) error {
|
|
||||||
timetriggerlog.Debug("validate update", zap.String("name", r.Name))
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
err = AggregateValidationErrors("TimeTrigger", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = IsValidCronSpec(r.Spec.Cron)
|
|
||||||
if err != nil {
|
|
||||||
err = ferror.MakeError(ferror.ErrorInvalidArgument, "TimeTrigger cron spec is not valid")
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
|
|
||||||
func (r *TimeTrigger) ValidateDelete() error {
|
|
||||||
timetriggerlog.Debug("validate delete", zap.String("name", r.Name))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
asv2beta2 "k8s.io/api/autoscaling/v2beta2"
|
asv2 "k8s.io/api/autoscaling/v2"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
@@ -399,6 +399,11 @@ type (
|
|||||||
// +optional
|
// +optional
|
||||||
OnceOnly bool `json:"onceOnly,omitempty"`
|
OnceOnly bool `json:"onceOnly,omitempty"`
|
||||||
|
|
||||||
|
// RetainPods specifies the number of specialized pods that should be retained after serving requests
|
||||||
|
// This is optional. If not specified default value will be taken as 0
|
||||||
|
// +optional
|
||||||
|
RetainPods int `json:"retainPods,omitempty"`
|
||||||
|
|
||||||
// Podspec specifies podspec to use for executor type container based functions
|
// Podspec specifies podspec to use for executor type container based functions
|
||||||
// Different arguments mentioned for container based function are populated inside a pod.
|
// Different arguments mentioned for container based function are populated inside a pod.
|
||||||
// +optional
|
// +optional
|
||||||
@@ -470,12 +475,12 @@ type (
|
|||||||
// created for the function.
|
// created for the function.
|
||||||
// Applicable for executor type newdeploy and container.
|
// Applicable for executor type newdeploy and container.
|
||||||
// +optional
|
// +optional
|
||||||
Metrics []asv2beta2.MetricSpec `json:"hpaMetrics,omitempty"`
|
Metrics []asv2.MetricSpec `json:"hpaMetrics,omitempty"`
|
||||||
|
|
||||||
// hpaBehavior is the behavior of HPA when scaling in up/down direction.
|
// hpaBehavior is the behavior of HPA when scaling in up/down direction.
|
||||||
// Applicable for executor type newdeploy and container.
|
// Applicable for executor type newdeploy and container.
|
||||||
// +optional
|
// +optional
|
||||||
Behavior *asv2beta2.HorizontalPodAutoscalerBehavior `json:"hpaBehavior,omitempty"`
|
Behavior *asv2.HorizontalPodAutoscalerBehavior `json:"hpaBehavior,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// FunctionReferenceType refers to type of Function
|
// FunctionReferenceType refers to type of Function
|
||||||
@@ -816,6 +821,17 @@ type (
|
|||||||
|
|
||||||
// The reference to function
|
// The reference to function
|
||||||
FunctionReference `json:"functionref"`
|
FunctionReference `json:"functionref"`
|
||||||
|
|
||||||
|
// HTTP Method for trigger, ex : GET, POST, PUT, DELETE, HEAD (default: "POST")
|
||||||
|
// +kubebuilder:default:="POST"
|
||||||
|
// +optional
|
||||||
|
Method string `json:"method,omitempty"`
|
||||||
|
|
||||||
|
// Subpath to trigger a specific route if function
|
||||||
|
// internally supports routing, (default: "/")
|
||||||
|
// +kubebuilder:default:="/"
|
||||||
|
// +optional
|
||||||
|
Subpath string `json:"subpath,omitempty"`
|
||||||
}
|
}
|
||||||
// FailureType refers to the type of failure
|
// FailureType refers to the type of failure
|
||||||
FailureType string
|
FailureType string
|
||||||
@@ -876,6 +892,10 @@ func (fn Function) GetConcurrency() int {
|
|||||||
return fn.Spec.Concurrency
|
return fn.Spec.Concurrency
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fn Function) GetRetainPods() int {
|
||||||
|
return fn.Spec.RetainPods
|
||||||
|
}
|
||||||
|
|
||||||
func (fn Function) GetRequestPerPod() int {
|
func (fn Function) GetRequestPerPod() int {
|
||||||
if fn.Spec.RequestsPerPod == 0 {
|
if fn.Spec.RequestsPerPod == 0 {
|
||||||
return DefaultRequestsPerPod
|
return DefaultRequestsPerPod
|
||||||
|
|||||||
@@ -129,25 +129,24 @@ func ValidateKubeLabel(field string, labels map[string]string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ValidateKubePort(field string, port int) error {
|
func ValidateKubePort(field string, port int) error {
|
||||||
result := &multierror.Error{}
|
var err error
|
||||||
|
|
||||||
e := validation.IsValidPortNum(port)
|
e := validation.IsValidPortNum(port)
|
||||||
if len(e) > 0 {
|
if len(e) > 0 {
|
||||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, field, port, e...))
|
err = errors.Join(err, MakeValidationErr(ErrorInvalidValue, field, port, e...))
|
||||||
}
|
}
|
||||||
|
return err
|
||||||
return result.ErrorOrNil()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func ValidateKubeName(field string, val string) error {
|
func ValidateKubeName(field string, val string) error {
|
||||||
result := &multierror.Error{}
|
var err error
|
||||||
|
|
||||||
e := validation.IsDNS1123Label(val)
|
e := validation.IsDNS1123Label(val)
|
||||||
if len(e) > 0 {
|
if len(e) > 0 {
|
||||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, field, val, e...))
|
err = errors.Join(err, MakeValidationErr(ErrorInvalidValue, field, val, e...))
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.ErrorOrNil()
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// validateNS is to match the k8s behaviour. Where it is not mandatory to provide a NS. And so we validate it if user has provided one.
|
// validateNS is to match the k8s behaviour. Where it is not mandatory to provide a NS. And so we validate it if user has provided one.
|
||||||
@@ -338,7 +337,7 @@ func (es ExecutionStrategy) Validate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO Add validation warning
|
// TODO Add validation warning
|
||||||
//if es.SpecializationTimeout < 120 {
|
// if es.SpecializationTimeout < 120 {
|
||||||
// result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "ExecutionStrategy.SpecializationTimeout", es.SpecializationTimeout, "SpecializationTimeout must be a value equal to or greater than 120"))
|
// result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "ExecutionStrategy.SpecializationTimeout", es.SpecializationTimeout, "SpecializationTimeout must be a value equal to or greater than 120"))
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
@@ -600,7 +599,7 @@ func (e *Environment) Validate() error {
|
|||||||
|
|
||||||
if e.Spec.Runtime.PodSpec != nil {
|
if e.Spec.Runtime.PodSpec != nil {
|
||||||
for _, container := range e.Spec.Runtime.PodSpec.Containers {
|
for _, container := range e.Spec.Runtime.PodSpec.Containers {
|
||||||
if container.Command == nil && container.Image == e.Spec.Runtime.Image && container.Name != e.ObjectMeta.Name {
|
if container.Command == nil && container.Image == e.Spec.Runtime.Image && container.Name != e.Name {
|
||||||
result = multierror.Append(result, errors.New("container with image same as runtime image in podspec, must have name same as environment name"))
|
result = multierror.Append(result, errors.New("container with image same as runtime image in podspec, must have name same as environment name"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build !ignore_autogenerated
|
//go:build !ignore_autogenerated
|
||||||
// +build !ignore_autogenerated
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright The Fission Authors.
|
Copyright The Fission Authors.
|
||||||
@@ -22,9 +21,9 @@ limitations under the License.
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/api/autoscaling/v2beta2"
|
"k8s.io/api/autoscaling/v2"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
@@ -303,14 +302,14 @@ func (in *ExecutionStrategy) DeepCopyInto(out *ExecutionStrategy) {
|
|||||||
*out = *in
|
*out = *in
|
||||||
if in.Metrics != nil {
|
if in.Metrics != nil {
|
||||||
in, out := &in.Metrics, &out.Metrics
|
in, out := &in.Metrics, &out.Metrics
|
||||||
*out = make([]v2beta2.MetricSpec, len(*in))
|
*out = make([]v2.MetricSpec, len(*in))
|
||||||
for i := range *in {
|
for i := range *in {
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if in.Behavior != nil {
|
if in.Behavior != nil {
|
||||||
in, out := &in.Behavior, &out.Behavior
|
in, out := &in.Behavior, &out.Behavior
|
||||||
*out = new(v2beta2.HorizontalPodAutoscalerBehavior)
|
*out = new(v2.HorizontalPodAutoscalerBehavior)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,537 @@
|
|||||||
|
//go:build !ignore_autogenerated
|
||||||
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
|
/*
|
||||||
|
Copyright The Fission 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 defaulter-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||||
|
// Public to allow building arbitrary schemes.
|
||||||
|
// All generated defaulters are covering - they call all nested defaulters.
|
||||||
|
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||||
|
scheme.AddTypeDefaultingFunc(&Environment{}, func(obj interface{}) { SetObjectDefaults_Environment(obj.(*Environment)) })
|
||||||
|
scheme.AddTypeDefaultingFunc(&EnvironmentList{}, func(obj interface{}) { SetObjectDefaults_EnvironmentList(obj.(*EnvironmentList)) })
|
||||||
|
scheme.AddTypeDefaultingFunc(&Function{}, func(obj interface{}) { SetObjectDefaults_Function(obj.(*Function)) })
|
||||||
|
scheme.AddTypeDefaultingFunc(&FunctionList{}, func(obj interface{}) { SetObjectDefaults_FunctionList(obj.(*FunctionList)) })
|
||||||
|
scheme.AddTypeDefaultingFunc(&MessageQueueTrigger{}, func(obj interface{}) { SetObjectDefaults_MessageQueueTrigger(obj.(*MessageQueueTrigger)) })
|
||||||
|
scheme.AddTypeDefaultingFunc(&MessageQueueTriggerList{}, func(obj interface{}) { SetObjectDefaults_MessageQueueTriggerList(obj.(*MessageQueueTriggerList)) })
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_Environment(in *Environment) {
|
||||||
|
if in.Spec.Runtime.Container != nil {
|
||||||
|
for i := range in.Spec.Runtime.Container.Ports {
|
||||||
|
a := &in.Spec.Runtime.Container.Ports[i]
|
||||||
|
if a.Protocol == "" {
|
||||||
|
a.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Runtime.Container.LivenessProbe != nil {
|
||||||
|
if in.Spec.Runtime.Container.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if in.Spec.Runtime.Container.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
in.Spec.Runtime.Container.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Runtime.Container.ReadinessProbe != nil {
|
||||||
|
if in.Spec.Runtime.Container.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if in.Spec.Runtime.Container.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
in.Spec.Runtime.Container.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Runtime.Container.StartupProbe != nil {
|
||||||
|
if in.Spec.Runtime.Container.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if in.Spec.Runtime.Container.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
in.Spec.Runtime.Container.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Runtime.PodSpec != nil {
|
||||||
|
for i := range in.Spec.Runtime.PodSpec.InitContainers {
|
||||||
|
a := &in.Spec.Runtime.PodSpec.InitContainers[i]
|
||||||
|
for j := range a.Ports {
|
||||||
|
b := &a.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.LivenessProbe != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.ReadinessProbe != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.StartupProbe != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range in.Spec.Runtime.PodSpec.Containers {
|
||||||
|
a := &in.Spec.Runtime.PodSpec.Containers[i]
|
||||||
|
for j := range a.Ports {
|
||||||
|
b := &a.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.LivenessProbe != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.ReadinessProbe != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.StartupProbe != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range in.Spec.Runtime.PodSpec.EphemeralContainers {
|
||||||
|
a := &in.Spec.Runtime.PodSpec.EphemeralContainers[i]
|
||||||
|
for j := range a.EphemeralContainerCommon.Ports {
|
||||||
|
b := &a.EphemeralContainerCommon.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Builder.Container != nil {
|
||||||
|
for i := range in.Spec.Builder.Container.Ports {
|
||||||
|
a := &in.Spec.Builder.Container.Ports[i]
|
||||||
|
if a.Protocol == "" {
|
||||||
|
a.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Builder.Container.LivenessProbe != nil {
|
||||||
|
if in.Spec.Builder.Container.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if in.Spec.Builder.Container.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
in.Spec.Builder.Container.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Builder.Container.ReadinessProbe != nil {
|
||||||
|
if in.Spec.Builder.Container.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if in.Spec.Builder.Container.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
in.Spec.Builder.Container.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Builder.Container.StartupProbe != nil {
|
||||||
|
if in.Spec.Builder.Container.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if in.Spec.Builder.Container.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
in.Spec.Builder.Container.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.Spec.Builder.PodSpec != nil {
|
||||||
|
for i := range in.Spec.Builder.PodSpec.InitContainers {
|
||||||
|
a := &in.Spec.Builder.PodSpec.InitContainers[i]
|
||||||
|
for j := range a.Ports {
|
||||||
|
b := &a.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.LivenessProbe != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.ReadinessProbe != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.StartupProbe != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range in.Spec.Builder.PodSpec.Containers {
|
||||||
|
a := &in.Spec.Builder.PodSpec.Containers[i]
|
||||||
|
for j := range a.Ports {
|
||||||
|
b := &a.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.LivenessProbe != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.ReadinessProbe != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.StartupProbe != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range in.Spec.Builder.PodSpec.EphemeralContainers {
|
||||||
|
a := &in.Spec.Builder.PodSpec.EphemeralContainers[i]
|
||||||
|
for j := range a.EphemeralContainerCommon.Ports {
|
||||||
|
b := &a.EphemeralContainerCommon.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_EnvironmentList(in *EnvironmentList) {
|
||||||
|
for i := range in.Items {
|
||||||
|
a := &in.Items[i]
|
||||||
|
SetObjectDefaults_Environment(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_Function(in *Function) {
|
||||||
|
if in.Spec.PodSpec != nil {
|
||||||
|
for i := range in.Spec.PodSpec.InitContainers {
|
||||||
|
a := &in.Spec.PodSpec.InitContainers[i]
|
||||||
|
for j := range a.Ports {
|
||||||
|
b := &a.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.LivenessProbe != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.ReadinessProbe != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.StartupProbe != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range in.Spec.PodSpec.Containers {
|
||||||
|
a := &in.Spec.PodSpec.Containers[i]
|
||||||
|
for j := range a.Ports {
|
||||||
|
b := &a.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.LivenessProbe != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.ReadinessProbe != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.StartupProbe != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range in.Spec.PodSpec.EphemeralContainers {
|
||||||
|
a := &in.Spec.PodSpec.EphemeralContainers[i]
|
||||||
|
for j := range a.EphemeralContainerCommon.Ports {
|
||||||
|
b := &a.EphemeralContainerCommon.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_FunctionList(in *FunctionList) {
|
||||||
|
for i := range in.Items {
|
||||||
|
a := &in.Items[i]
|
||||||
|
SetObjectDefaults_Function(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_MessageQueueTrigger(in *MessageQueueTrigger) {
|
||||||
|
if in.Spec.PodSpec != nil {
|
||||||
|
for i := range in.Spec.PodSpec.InitContainers {
|
||||||
|
a := &in.Spec.PodSpec.InitContainers[i]
|
||||||
|
for j := range a.Ports {
|
||||||
|
b := &a.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.LivenessProbe != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.ReadinessProbe != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.StartupProbe != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range in.Spec.PodSpec.Containers {
|
||||||
|
a := &in.Spec.PodSpec.Containers[i]
|
||||||
|
for j := range a.Ports {
|
||||||
|
b := &a.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.LivenessProbe != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.ReadinessProbe != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.StartupProbe != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for i := range in.Spec.PodSpec.EphemeralContainers {
|
||||||
|
a := &in.Spec.PodSpec.EphemeralContainers[i]
|
||||||
|
for j := range a.EphemeralContainerCommon.Ports {
|
||||||
|
b := &a.EphemeralContainerCommon.Ports[j]
|
||||||
|
if b.Protocol == "" {
|
||||||
|
b.Protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe != nil {
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil {
|
||||||
|
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil {
|
||||||
|
var ptrVar1 string = ""
|
||||||
|
a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_MessageQueueTriggerList(in *MessageQueueTriggerList) {
|
||||||
|
for i := range in.Items {
|
||||||
|
a := &in.Items[i]
|
||||||
|
SetObjectDefaults_MessageQueueTrigger(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -203,6 +203,7 @@ var map_FunctionSpec = map[string]string{
|
|||||||
"concurrency": "Maximum number of pods to be specialized which will serve requests This is optional. If not specified default value will be taken as 500",
|
"concurrency": "Maximum number of pods to be specialized which will serve requests This is optional. If not specified default value will be taken as 500",
|
||||||
"requestsPerPod": "RequestsPerPod indicates the maximum number of concurrent requests that can be served by a specialized pod This is optional. If not specified default value will be taken as 1",
|
"requestsPerPod": "RequestsPerPod indicates the maximum number of concurrent requests that can be served by a specialized pod This is optional. If not specified default value will be taken as 1",
|
||||||
"onceOnly": "OnceOnly specifies if specialized pod will serve exactly one request in its lifetime and would be garbage collected after serving that one request This is optional. If not specified default value will be taken as false",
|
"onceOnly": "OnceOnly specifies if specialized pod will serve exactly one request in its lifetime and would be garbage collected after serving that one request This is optional. If not specified default value will be taken as false",
|
||||||
|
"retainPods": "RetainPods specifies the number of specialized pods that should be retained after serving requests This is optional. If not specified default value will be taken as 0",
|
||||||
"podspec": "Podspec specifies podspec to use for executor type container based functions Different arguments mentioned for container based function are populated inside a pod.",
|
"podspec": "Podspec specifies podspec to use for executor type container based functions Different arguments mentioned for container based function are populated inside a pod.",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,6 +428,8 @@ var map_TimeTriggerSpec = map[string]string{
|
|||||||
"": "TimeTriggerSpec invokes the specific function at a time or times specified by a cron string.",
|
"": "TimeTriggerSpec invokes the specific function at a time or times specified by a cron string.",
|
||||||
"cron": "Cron schedule",
|
"cron": "Cron schedule",
|
||||||
"functionref": "The reference to function",
|
"functionref": "The reference to function",
|
||||||
|
"method": "HTTP Method for trigger, ex : GET, POST, PUT, DELETE, HEAD (default: \"POST\")",
|
||||||
|
"subpath": "Subpath to trigger a specific route if function internally supports routing, (default: \"/\")",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (TimeTriggerSpec) SwaggerDoc() map[string]string {
|
func (TimeTriggerSpec) SwaggerDoc() map[string]string {
|
||||||
|
|||||||
+51
-9
@@ -31,10 +31,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dchest/uniuri"
|
"github.com/dchest/uniuri"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/info"
|
"github.com/fission/fission/pkg/info"
|
||||||
|
"github.com/fission/fission/pkg/utils"
|
||||||
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -121,9 +121,19 @@ func (builder *Builder) Handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
logger.Info("builder received request", zap.Any("request", req))
|
logger.Info("builder received request", zap.Any("request", req))
|
||||||
|
|
||||||
logger.Debug("starting build")
|
logger.Debug("starting build")
|
||||||
srcPkgPath := filepath.Join(builder.sharedVolumePath, req.SrcPkgFilename)
|
srcPkgPath, err := utils.SanitizeFilePath(filepath.Join(builder.sharedVolumePath, req.SrcPkgFilename), builder.sharedVolumePath)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error(err.Error(), zap.String("filename", req.SrcPkgFilename))
|
||||||
|
builder.reply(r.Context(), w, "", err.Error(), http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
deployPkgFilename := fmt.Sprintf("%s-%s", req.SrcPkgFilename, strings.ToLower(uniuri.NewLen(6)))
|
deployPkgFilename := fmt.Sprintf("%s-%s", req.SrcPkgFilename, strings.ToLower(uniuri.NewLen(6)))
|
||||||
deployPkgPath := filepath.Join(builder.sharedVolumePath, deployPkgFilename)
|
deployPkgPath, err := utils.SanitizeFilePath(filepath.Join(builder.sharedVolumePath, deployPkgFilename), builder.sharedVolumePath)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error(err.Error(), zap.String("filename", req.SrcPkgFilename))
|
||||||
|
builder.reply(r.Context(), w, "", err.Error(), http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var buildArgs []string
|
var buildArgs []string
|
||||||
buildCmd := req.BuildCommand
|
buildCmd := req.BuildCommand
|
||||||
@@ -154,6 +164,38 @@ func (builder *Builder) Handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
builder.reply(r.Context(), w, deployPkgFilename, buildLogs, http.StatusOK)
|
builder.reply(r.Context(), w, deployPkgFilename, buildLogs, http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (builder *Builder) Clean(w http.ResponseWriter, r *http.Request) {
|
||||||
|
logger := otelUtils.LoggerWithTraceID(r.Context(), builder.logger)
|
||||||
|
|
||||||
|
if r.Method != "DELETE" {
|
||||||
|
e := "method not allowed"
|
||||||
|
logger.Error(e, zap.String("http_method", r.Method))
|
||||||
|
builder.reply(r.Context(), w, "", fmt.Sprintf("%s: %s", e, r.Method), http.StatusMethodNotAllowed)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
startTime := time.Now()
|
||||||
|
defer func() {
|
||||||
|
elapsed := time.Since(startTime)
|
||||||
|
logger.Info("clean request complete", zap.Duration("elapsed_time", elapsed))
|
||||||
|
}()
|
||||||
|
|
||||||
|
srcPkgFilename := r.URL.Query().Get("name")
|
||||||
|
srcPkgPath := filepath.Join(builder.sharedVolumePath, srcPkgFilename)
|
||||||
|
|
||||||
|
logger.Info("builder received clean request", zap.Any("source_package", srcPkgFilename))
|
||||||
|
|
||||||
|
err := utils.DeleteOldPackages(srcPkgPath, envSrcPkg)
|
||||||
|
if err != nil {
|
||||||
|
e := "error deleting src package after build"
|
||||||
|
logger.Error(e, zap.Error(err))
|
||||||
|
builder.reply(r.Context(), w, srcPkgFilename, "", http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.reply(r.Context(), w, srcPkgFilename, "", http.StatusOK)
|
||||||
|
}
|
||||||
|
|
||||||
func (builder *Builder) reply(ctx context.Context, w http.ResponseWriter, pkgFilename string, buildLogs string, statusCode int) {
|
func (builder *Builder) reply(ctx context.Context, w http.ResponseWriter, pkgFilename string, buildLogs string, statusCode int) {
|
||||||
logger := otelUtils.LoggerWithTraceID(ctx, builder.logger)
|
logger := otelUtils.LoggerWithTraceID(ctx, builder.logger)
|
||||||
resp := PackageBuildResponse{
|
resp := PackageBuildResponse{
|
||||||
@@ -163,7 +205,7 @@ func (builder *Builder) reply(ctx context.Context, w http.ResponseWriter, pkgFil
|
|||||||
|
|
||||||
rBody, err := json.Marshal(resp)
|
rBody, err := json.Marshal(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e := errors.Wrap(err, "error encoding response body")
|
e := fmt.Errorf("error encoding response body: %w", err)
|
||||||
rBody = []byte(fmt.Sprintf(`{"buildLogs": "%s"}`, e.Error()))
|
rBody = []byte(fmt.Sprintf(`{"buildLogs": "%s"}`, e.Error()))
|
||||||
statusCode = http.StatusInternalServerError
|
statusCode = http.StatusInternalServerError
|
||||||
}
|
}
|
||||||
@@ -204,12 +246,12 @@ func (builder *Builder) build(ctx context.Context, command string, args []string
|
|||||||
|
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "error creating stdout pipe for cmd")
|
return "", fmt.Errorf("error creating stdout pipe for cmd: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
stderr, err := cmd.StderrPipe()
|
stderr, err := cmd.StderrPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "error creating stderr pipe for cmd")
|
return "", fmt.Errorf("error creating stderr pipe for cmd: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init logs
|
// Init logs
|
||||||
@@ -220,7 +262,7 @@ func (builder *Builder) build(ctx context.Context, command string, args []string
|
|||||||
|
|
||||||
err = cmd.Start()
|
err = cmd.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "error starting cmd")
|
return "", fmt.Errorf("error starting cmd: %w", err)
|
||||||
}
|
}
|
||||||
fmt.Printf("========= START =========\n")
|
fmt.Printf("========= START =========\n")
|
||||||
defer fmt.Printf("========= END ===========\n")
|
defer fmt.Printf("========= END ===========\n")
|
||||||
@@ -233,14 +275,14 @@ func (builder *Builder) build(ctx context.Context, command string, args []string
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := scanner.Err(); err != nil {
|
if err := scanner.Err(); err != nil {
|
||||||
scanErr := errors.Wrap(err, "error reading cmd output")
|
scanErr := fmt.Errorf("error reading cmd output: %w", err)
|
||||||
fmt.Println(scanErr)
|
fmt.Println(scanErr)
|
||||||
return buildLogs, scanErr
|
return buildLogs, scanErr
|
||||||
}
|
}
|
||||||
|
|
||||||
err = cmd.Wait()
|
err = cmd.Wait()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmdErr := errors.Wrapf(err, "error waiting for cmd %q", command)
|
cmdErr := fmt.Errorf("error waiting for cmd %q: %w", command, err)
|
||||||
fmt.Println(cmdErr)
|
fmt.Println(cmdErr)
|
||||||
return buildLogs, cmdErr
|
return buildLogs, cmdErr
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,4 +168,50 @@ func TestBuilder(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Test CleanHandler
|
||||||
|
t.Run("CleanHandler", func(t *testing.T) {
|
||||||
|
for _, test := range []struct {
|
||||||
|
name string
|
||||||
|
srcPkgFilename string
|
||||||
|
handler func(w http.ResponseWriter, r *http.Request)
|
||||||
|
status int
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "should fail deleting src pkg: invalid shared volume path",
|
||||||
|
srcPkgFilename: "test2",
|
||||||
|
handler: func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
builder.Clean(w, r)
|
||||||
|
},
|
||||||
|
status: http.StatusInternalServerError,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "should fail deleting src pkg: method not allowed",
|
||||||
|
srcPkgFilename: "test3",
|
||||||
|
handler: func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
builder.Handler(w, r)
|
||||||
|
},
|
||||||
|
status: http.StatusMethodNotAllowed,
|
||||||
|
},
|
||||||
|
} {
|
||||||
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
_, err := os.MkdirTemp(dir, test.srcPkgFilename)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
srcFile, err := os.Create(dir + "/" + test.srcPkgFilename)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer srcFile.Close()
|
||||||
|
w := httptest.NewRecorder()
|
||||||
|
r := httptest.NewRequest(http.MethodDelete, "/clean/"+test.srcPkgFilename, http.NoBody)
|
||||||
|
test.handler(w, r)
|
||||||
|
resp := w.Result()
|
||||||
|
if resp.StatusCode != test.status {
|
||||||
|
t.Errorf("expected status code %d, got %d", test.status, resp.StatusCode)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,11 +20,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/go-retryablehttp"
|
"github.com/hashicorp/go-retryablehttp"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
@@ -35,49 +36,85 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
Client struct {
|
ClientInterface interface {
|
||||||
|
Build(context.Context, *builder.PackageBuildRequest) (*builder.PackageBuildResponse, error)
|
||||||
|
Clean(context.Context, string) error
|
||||||
|
}
|
||||||
|
|
||||||
|
client struct {
|
||||||
logger *zap.Logger
|
logger *zap.Logger
|
||||||
url string
|
url string
|
||||||
httpClient *retryablehttp.Client
|
httpClient *retryablehttp.Client
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func MakeClient(logger *zap.Logger, builderUrl string) *Client {
|
func MakeClient(logger *zap.Logger, builderUrl string) ClientInterface {
|
||||||
hc := retryablehttp.NewClient()
|
hc := retryablehttp.NewClient()
|
||||||
|
hc.ErrorHandler = retryablehttp.PassthroughErrorHandler
|
||||||
hc.HTTPClient.Transport = otelhttp.NewTransport(hc.HTTPClient.Transport)
|
hc.HTTPClient.Transport = otelhttp.NewTransport(hc.HTTPClient.Transport)
|
||||||
return &Client{
|
return &client{
|
||||||
logger: logger.Named("builder_client"),
|
logger: logger.Named("builder_client"),
|
||||||
url: strings.TrimSuffix(builderUrl, "/"),
|
url: strings.TrimSuffix(builderUrl, "/"),
|
||||||
httpClient: hc,
|
httpClient: hc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Build(ctx context.Context, req *builder.PackageBuildRequest) (*builder.PackageBuildResponse, error) {
|
func (c *client) getCleanUrl(srcPkgFilename string) string {
|
||||||
|
return c.url + "/clean" + "?name=" + srcPkgFilename
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *client) Build(ctx context.Context, req *builder.PackageBuildRequest) (*builder.PackageBuildResponse, error) {
|
||||||
logger := otelUtils.LoggerWithTraceID(ctx, c.logger)
|
logger := otelUtils.LoggerWithTraceID(ctx, c.logger)
|
||||||
|
|
||||||
body, err := json.Marshal(req)
|
body, err := json.Marshal(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error marshaling json")
|
return nil, fmt.Errorf("error marshaling json: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := ctxhttp.Post(ctx, c.httpClient.StandardClient(), c.url, "application/json", bytes.NewReader(body))
|
resp, err := ctxhttp.Post(ctx, c.httpClient.StandardClient(), c.url, "application/json", bytes.NewReader(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("error sending request: %w", err)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
rBody, err := io.ReadAll(resp.Body)
|
rBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("error reading resp body", zap.Error(err))
|
logger.Error("error reading resp body", zap.Error(err))
|
||||||
return nil, err
|
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgBuildResp := builder.PackageBuildResponse{}
|
pkgBuildResp := builder.PackageBuildResponse{}
|
||||||
err = json.Unmarshal(rBody, &pkgBuildResp)
|
err = json.Unmarshal(rBody, &pkgBuildResp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("error parsing resp body", zap.Error(err))
|
logger.Error("error parsing resp body", zap.Error(err))
|
||||||
return nil, err
|
return nil, fmt.Errorf("error parsing response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &pkgBuildResp, ferror.MakeErrorFromHTTP(resp)
|
return &pkgBuildResp, ferror.MakeErrorFromHTTP(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *client) Clean(ctx context.Context, srcPkgFilename string) error {
|
||||||
|
logger := otelUtils.LoggerWithTraceID(ctx, c.logger)
|
||||||
|
|
||||||
|
req, err := http.NewRequest(http.MethodDelete, c.getCleanUrl(srcPkgFilename), http.NoBody)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error creating http request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := ctxhttp.Do(ctx, c.httpClient.StandardClient(), req)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("error sending clean request", zap.Error(err))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
if resp.StatusCode == http.StatusMethodNotAllowed {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
return ferror.MakeErrorFromHTTP(resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,9 +18,10 @@ package buildermgr
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -28,44 +29,50 @@ import (
|
|||||||
"github.com/fission/fission/pkg/executor/util"
|
"github.com/fission/fission/pkg/executor/util"
|
||||||
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
|
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
|
||||||
"github.com/fission/fission/pkg/utils"
|
"github.com/fission/fission/pkg/utils"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Start the buildermgr service.
|
// Start the buildermgr service.
|
||||||
func Start(ctx context.Context, logger *zap.Logger, storageSvcUrl string) error {
|
func Start(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, storageSvcUrl string) error {
|
||||||
bmLogger := logger.Named("builder_manager")
|
bmLogger := logger.Named("builder_manager")
|
||||||
|
|
||||||
clientGen := crd.NewClientGenerator()
|
|
||||||
fissionClient, err := clientGen.GetFissionClient()
|
fissionClient, err := clientGen.GetFissionClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get fission client")
|
return fmt.Errorf("failed to get fission client: %w", err)
|
||||||
}
|
}
|
||||||
kubernetesClient, err := clientGen.GetKubernetesClient()
|
kubernetesClient, err := clientGen.GetKubernetesClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get kubernetes client")
|
return fmt.Errorf("failed to get kubernetes client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = crd.WaitForCRDs(ctx, logger, fissionClient)
|
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error waiting for CRDs")
|
return fmt.Errorf("error waiting for CRDs: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/packages")
|
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/packages")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error making fetcher config")
|
return fmt.Errorf("error making fetcher config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
podSpecPatch, err := util.GetSpecFromConfigMap(fv1.BuilderPodSpecPath)
|
podSpecPatch, err := util.GetSpecFromConfigMap(fv1.BuilderPodSpecPath)
|
||||||
if err != nil {
|
if err != nil && !os.IsNotExist(err) {
|
||||||
logger.Warn("error reading data for pod spec patch", zap.String("path", fv1.BuilderPodSpecPath), zap.Error(err))
|
logger.Warn("error reading data for pod spec patch", zap.String("path", fv1.BuilderPodSpecPath), zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
envWatcher := makeEnvironmentWatcher(ctx, bmLogger, fissionClient, kubernetesClient, fetcherConfig, podSpecPatch)
|
envWatcher, err := makeEnvironmentWatcher(ctx, bmLogger, fissionClient, kubernetesClient, fetcherConfig, podSpecPatch)
|
||||||
envWatcher.Run(ctx)
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
envWatcher.Run(ctx, mgr)
|
||||||
|
|
||||||
pkgWatcher := makePackageWatcher(bmLogger, fissionClient,
|
pkgWatcher := makePackageWatcher(bmLogger, fissionClient,
|
||||||
kubernetesClient, storageSvcUrl,
|
kubernetesClient, storageSvcUrl,
|
||||||
utils.GetK8sInformersForNamespaces(kubernetesClient, time.Minute*30, fv1.Pods),
|
utils.GetK8sInformersForNamespaces(kubernetesClient, time.Minute*30, fv1.Pods),
|
||||||
utils.GetInformersForNamespaces(fissionClient, time.Minute*30, fv1.PackagesResource))
|
utils.GetInformersForNamespaces(fissionClient, time.Minute*30, fv1.PackagesResource))
|
||||||
pkgWatcher.Run(ctx)
|
err = pkgWatcher.Run(ctx, mgr)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dchest/uniuri"
|
"github.com/dchest/uniuri"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -55,10 +54,19 @@ func buildPackage(ctx context.Context, logger *zap.Logger, fissionClient version
|
|||||||
return nil, e, ferror.MakeError(http.StatusInternalServerError, e)
|
return nil, e, ferror.MakeError(http.StatusInternalServerError, e)
|
||||||
}
|
}
|
||||||
|
|
||||||
svcName := fmt.Sprintf("%v-%v.%v", env.ObjectMeta.Name, env.ObjectMeta.ResourceVersion, envBuilderNamespace)
|
svcName := fmt.Sprintf("%s-%s.%s", env.Name, env.ResourceVersion, envBuilderNamespace)
|
||||||
srcPkgFilename := fmt.Sprintf("%v-%v", pkg.ObjectMeta.Name, strings.ToLower(uniuri.NewLen(6)))
|
srcPkgFilename := fmt.Sprintf("%s-%s", pkg.Name, strings.ToLower(uniuri.NewLen(6)))
|
||||||
fetcherC := fetcherClient.MakeClient(logger, fmt.Sprintf("http://%v:8000", svcName))
|
fetcherC := fetcherClient.MakeClient(logger, fmt.Sprintf("http://%s:8000", svcName))
|
||||||
builderC := builderClient.MakeClient(logger, fmt.Sprintf("http://%v:8001", svcName))
|
builderC := builderClient.MakeClient(logger, fmt.Sprintf("http://%s:8001", svcName))
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
logger.Info("cleaning src pkg from builder storage", zap.String("source_package", srcPkgFilename))
|
||||||
|
errC := cleanPackage(ctx, builderC, srcPkgFilename)
|
||||||
|
if errC != nil {
|
||||||
|
m := "error cleaning src pkg from builder storage"
|
||||||
|
logger.Error(m, zap.Error(errC))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
fetchReq := &fetcher.FunctionFetchRequest{
|
fetchReq := &fetcher.FunctionFetchRequest{
|
||||||
FetchType: fv1.FETCH_SOURCE,
|
FetchType: fv1.FETCH_SOURCE,
|
||||||
@@ -121,6 +129,15 @@ func buildPackage(ctx context.Context, logger *zap.Logger, fissionClient version
|
|||||||
return uploadResp, buildResp.BuildLogs, nil
|
return uploadResp, buildResp.BuildLogs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func cleanPackage(ctx context.Context, builderClient builderClient.ClientInterface, srcPkgFileName string) error {
|
||||||
|
err := builderClient.Clean(ctx, srcPkgFileName)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func updatePackage(ctx context.Context, logger *zap.Logger, fissionClient versioned.Interface,
|
func updatePackage(ctx context.Context, logger *zap.Logger, fissionClient versioned.Interface,
|
||||||
pkg *fv1.Package, status fv1.BuildStatus, buildLogs string,
|
pkg *fv1.Package, status fv1.BuildStatus, buildLogs string,
|
||||||
uploadResp *fetcher.ArchiveUploadResponse) (*fv1.Package, error) {
|
uploadResp *fetcher.ArchiveUploadResponse) (*fv1.Package, error) {
|
||||||
@@ -144,7 +161,7 @@ func updatePackage(ctx context.Context, logger *zap.Logger, fissionClient versio
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
e := "error updating package"
|
e := "error updating package"
|
||||||
logger.Error(e, zap.Error(err))
|
logger.Error(e, zap.Error(err))
|
||||||
return nil, errors.Wrap(err, e)
|
return nil, fmt.Errorf("%s: %w", e, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// return resource version for function to update function package ref
|
// return resource version for function to update function package ref
|
||||||
|
|||||||
@@ -23,12 +23,13 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
"k8s.io/apimachinery/pkg/types"
|
||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
k8sCache "k8s.io/client-go/tools/cache"
|
k8sCache "k8s.io/client-go/tools/cache"
|
||||||
@@ -39,6 +40,7 @@ import (
|
|||||||
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
|
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
|
||||||
"github.com/fission/fission/pkg/generated/clientset/versioned"
|
"github.com/fission/fission/pkg/generated/clientset/versioned"
|
||||||
"github.com/fission/fission/pkg/utils"
|
"github.com/fission/fission/pkg/utils"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -63,7 +65,7 @@ type (
|
|||||||
|
|
||||||
environmentWatcher struct {
|
environmentWatcher struct {
|
||||||
logger *zap.Logger
|
logger *zap.Logger
|
||||||
cache map[string]*builderInfo
|
cache map[types.UID]*builderInfo
|
||||||
fissionClient versioned.Interface
|
fissionClient versioned.Interface
|
||||||
kubernetesClient kubernetes.Interface
|
kubernetesClient kubernetes.Interface
|
||||||
nsResolver *utils.NamespaceResolver
|
nsResolver *utils.NamespaceResolver
|
||||||
@@ -72,6 +74,7 @@ type (
|
|||||||
useIstio bool
|
useIstio bool
|
||||||
podSpecPatch *apiv1.PodSpec
|
podSpecPatch *apiv1.PodSpec
|
||||||
envWatchInformer map[string]k8sCache.SharedIndexInformer
|
envWatchInformer map[string]k8sCache.SharedIndexInformer
|
||||||
|
enableOwnerReferences bool
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -81,7 +84,7 @@ func makeEnvironmentWatcher(
|
|||||||
fissionClient versioned.Interface,
|
fissionClient versioned.Interface,
|
||||||
kubernetesClient kubernetes.Interface,
|
kubernetesClient kubernetes.Interface,
|
||||||
fetcherConfig *fetcherConfig.Config,
|
fetcherConfig *fetcherConfig.Config,
|
||||||
podSpecPatch *apiv1.PodSpec) *environmentWatcher {
|
podSpecPatch *apiv1.PodSpec) (*environmentWatcher, error) {
|
||||||
|
|
||||||
useIstio := false
|
useIstio := false
|
||||||
enableIstio := os.Getenv("ENABLE_ISTIO")
|
enableIstio := os.Getenv("ENABLE_ISTIO")
|
||||||
@@ -97,7 +100,7 @@ func makeEnvironmentWatcher(
|
|||||||
|
|
||||||
envWatcher := &environmentWatcher{
|
envWatcher := &environmentWatcher{
|
||||||
logger: logger.Named("environment_watcher"),
|
logger: logger.Named("environment_watcher"),
|
||||||
cache: make(map[string]*builderInfo),
|
cache: make(map[types.UID]*builderInfo),
|
||||||
fissionClient: fissionClient,
|
fissionClient: fissionClient,
|
||||||
kubernetesClient: kubernetesClient,
|
kubernetesClient: kubernetesClient,
|
||||||
nsResolver: utils.DefaultNSResolver(),
|
nsResolver: utils.DefaultNSResolver(),
|
||||||
@@ -106,10 +109,14 @@ func makeEnvironmentWatcher(
|
|||||||
fetcherConfig: fetcherConfig,
|
fetcherConfig: fetcherConfig,
|
||||||
podSpecPatch: podSpecPatch,
|
podSpecPatch: podSpecPatch,
|
||||||
envWatchInformer: utils.GetInformersForNamespaces(fissionClient, time.Minute*30, fv1.EnvironmentResource),
|
envWatchInformer: utils.GetInformersForNamespaces(fissionClient, time.Minute*30, fv1.EnvironmentResource),
|
||||||
|
enableOwnerReferences: utils.IsOwnerReferencesEnabled(),
|
||||||
}
|
}
|
||||||
|
|
||||||
envWatcher.EnvWatchEventHandlers(ctx)
|
err := envWatcher.EnvWatchEventHandlers(ctx)
|
||||||
return envWatcher
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return envWatcher, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (env *environmentWatcher) getDeploymentLabels(envName string) map[string]string {
|
func (env *environmentWatcher) getDeploymentLabels(envName string) map[string]string {
|
||||||
@@ -128,15 +135,13 @@ func (envw *environmentWatcher) getLabels(envName string, envNamespace string, e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (envw *environmentWatcher) Run(ctx context.Context) {
|
func (envw *environmentWatcher) Run(ctx context.Context, mgr manager.Interface) {
|
||||||
for _, informer := range envw.envWatchInformer {
|
mgr.AddInformers(ctx, envw.envWatchInformer)
|
||||||
go informer.Run(ctx.Done())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (envw *environmentWatcher) EnvWatchEventHandlers(ctx context.Context) {
|
func (envw *environmentWatcher) EnvWatchEventHandlers(ctx context.Context) error {
|
||||||
for _, informer := range envw.envWatchInformer {
|
for _, informer := range envw.envWatchInformer {
|
||||||
informer.AddEventHandler(k8sCache.ResourceEventHandlerFuncs{
|
_, err := informer.AddEventHandler(k8sCache.ResourceEventHandlerFuncs{
|
||||||
AddFunc: func(obj interface{}) {
|
AddFunc: func(obj interface{}) {
|
||||||
envObj := obj.(*fv1.Environment)
|
envObj := obj.(*fv1.Environment)
|
||||||
envw.AddUpdateBuilder(ctx, envObj)
|
envw.AddUpdateBuilder(ctx, envObj)
|
||||||
@@ -153,19 +158,23 @@ func (envw *environmentWatcher) EnvWatchEventHandlers(ctx context.Context) {
|
|||||||
envw.DeleteBuilder(ctx, envObj)
|
envw.DeleteBuilder(ctx, envObj)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (envw *environmentWatcher) AddUpdateBuilder(ctx context.Context, env *fv1.Environment) {
|
func (envw *environmentWatcher) AddUpdateBuilder(ctx context.Context, env *fv1.Environment) {
|
||||||
//builder is not supported with v1 interface and ignore env without builder image
|
// builder is not supported with v1 interface and ignore env without builder image
|
||||||
if env.Spec.Version != 1 && len(env.Spec.Builder.Image) != 0 {
|
if env.Spec.Version != 1 && len(env.Spec.Builder.Image) != 0 {
|
||||||
if _, ok := envw.cache[crd.CacheKeyUID(&env.ObjectMeta)]; !ok {
|
if _, ok := envw.cache[crd.CacheKeyUIDFromMeta(&env.ObjectMeta)]; !ok {
|
||||||
builderInfo, err := envw.createBuilder(ctx, env, envw.nsResolver.GetBuilderNS(env.ObjectMeta.Namespace))
|
builderInfo, err := envw.createBuilder(ctx, env, envw.nsResolver.GetBuilderNS(env.ObjectMeta.Namespace))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
envw.logger.Error("error creating builder service", zap.Error(err))
|
envw.logger.Error("error creating builder service", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
envw.cache[crd.CacheKeyUID(&env.ObjectMeta)] = builderInfo
|
envw.cache[crd.CacheKeyUIDFromMeta(&env.ObjectMeta)] = builderInfo
|
||||||
} else {
|
} else {
|
||||||
envw.DeleteBuilder(ctx, env)
|
envw.DeleteBuilder(ctx, env)
|
||||||
// once older builder deleted then add new builder service
|
// once older builder deleted then add new builder service
|
||||||
@@ -174,16 +183,16 @@ func (envw *environmentWatcher) AddUpdateBuilder(ctx context.Context, env *fv1.E
|
|||||||
envw.logger.Error("error updating builder service", zap.Error(err))
|
envw.logger.Error("error updating builder service", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
envw.cache[crd.CacheKeyUID(&env.ObjectMeta)] = builderInfo
|
envw.cache[crd.CacheKeyUIDFromMeta(&env.ObjectMeta)] = builderInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (envw *environmentWatcher) DeleteBuilder(ctx context.Context, env *fv1.Environment) {
|
func (envw *environmentWatcher) DeleteBuilder(ctx context.Context, env *fv1.Environment) {
|
||||||
if _, ok := envw.cache[crd.CacheKeyUID(&env.ObjectMeta)]; ok {
|
if _, ok := envw.cache[crd.CacheKeyUIDFromMeta(&env.ObjectMeta)]; ok {
|
||||||
envw.DeleteBuilderService(ctx, env)
|
envw.DeleteBuilderService(ctx, env)
|
||||||
envw.DeleteBuilderDeployment(ctx, env)
|
envw.DeleteBuilderDeployment(ctx, env)
|
||||||
delete(envw.cache, crd.CacheKeyUID(&env.ObjectMeta))
|
delete(envw.cache, crd.CacheKeyUIDFromMeta(&env.ObjectMeta))
|
||||||
envw.logger.Info("builder service deleted", zap.String("env_name", env.ObjectMeta.Name), zap.String("namespace", envw.nsResolver.GetBuilderNS(env.ObjectMeta.Namespace)))
|
envw.logger.Info("builder service deleted", zap.String("env_name", env.ObjectMeta.Name), zap.String("namespace", envw.nsResolver.GetBuilderNS(env.ObjectMeta.Namespace)))
|
||||||
} else {
|
} else {
|
||||||
envw.logger.Debug("builder service not found", zap.String("env_name", env.ObjectMeta.Name), zap.String("namespace", envw.nsResolver.GetBuilderNS(env.ObjectMeta.Namespace)))
|
envw.logger.Debug("builder service not found", zap.String("env_name", env.ObjectMeta.Name), zap.String("namespace", envw.nsResolver.GetBuilderNS(env.ObjectMeta.Namespace)))
|
||||||
@@ -198,7 +207,7 @@ func (envw *environmentWatcher) DeleteBuilderService(ctx context.Context, env *f
|
|||||||
}
|
}
|
||||||
for _, svc := range svcList {
|
for _, svc := range svcList {
|
||||||
envName := svc.ObjectMeta.Labels[LABEL_ENV_NAME]
|
envName := svc.ObjectMeta.Labels[LABEL_ENV_NAME]
|
||||||
if _, ok := envw.cache[crd.CacheKeyUID(&env.ObjectMeta)]; ok {
|
if _, ok := envw.cache[crd.CacheKeyUIDFromMeta(&env.ObjectMeta)]; ok {
|
||||||
err := envw.deleteBuilderServiceByName(ctx, svc.ObjectMeta.Name, svc.ObjectMeta.Namespace)
|
err := envw.deleteBuilderServiceByName(ctx, svc.ObjectMeta.Name, svc.ObjectMeta.Namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
envw.logger.Error("error removing builder service", zap.Error(err),
|
envw.logger.Error("error removing builder service", zap.Error(err),
|
||||||
@@ -222,7 +231,7 @@ func (envw *environmentWatcher) DeleteBuilderDeployment(ctx context.Context, env
|
|||||||
envw.logger.Error("error getting the builder deployment list", zap.Error(err))
|
envw.logger.Error("error getting the builder deployment list", zap.Error(err))
|
||||||
}
|
}
|
||||||
for _, deploy := range deployList {
|
for _, deploy := range deployList {
|
||||||
if _, ok := envw.cache[crd.CacheKeyUID(&env.ObjectMeta)]; ok {
|
if _, ok := envw.cache[crd.CacheKeyUIDFromMeta(&env.ObjectMeta)]; ok {
|
||||||
err := envw.deleteBuilderDeploymentByName(ctx, deploy.ObjectMeta.Name, deploy.ObjectMeta.Namespace)
|
err := envw.deleteBuilderDeploymentByName(ctx, deploy.ObjectMeta.Name, deploy.ObjectMeta.Namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
envw.logger.Error("error removing builder deployment", zap.Error(err),
|
envw.logger.Error("error removing builder deployment", zap.Error(err),
|
||||||
@@ -252,9 +261,7 @@ func (envw *environmentWatcher) createBuilder(ctx context.Context, env *fv1.Envi
|
|||||||
if len(svcList) == 0 {
|
if len(svcList) == 0 {
|
||||||
svc, err = envw.createBuilderService(ctx, env, ns)
|
svc, err = envw.createBuilderService(ctx, env, ns)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err,
|
return nil, fmt.Errorf("error creating builder service for environment in namespace %s %s: %w", env.ObjectMeta.Name, ns, err)
|
||||||
fmt.Sprintf("error creating builder service for environment in namespace %s %s", env.ObjectMeta.Name, ns))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if len(svcList) == 1 {
|
} else if len(svcList) == 1 {
|
||||||
svc = &svcList[0]
|
svc = &svcList[0]
|
||||||
@@ -270,8 +277,7 @@ func (envw *environmentWatcher) createBuilder(ctx context.Context, env *fv1.Envi
|
|||||||
if len(deployList) == 0 {
|
if len(deployList) == 0 {
|
||||||
deploy, err = envw.createBuilderDeployment(ctx, env, ns)
|
deploy, err = envw.createBuilderDeployment(ctx, env, ns)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, fmt.Sprintf("error creating builder deployment for environment in namespace %s %s", env.ObjectMeta.Name, ns))
|
return nil, fmt.Errorf("error creating builder deployment for environment in namespace %s %s: %w", env.ObjectMeta.Name, ns, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if len(deployList) == 1 {
|
} else if len(deployList) == 1 {
|
||||||
deploy = &deployList[0]
|
deploy = &deployList[0]
|
||||||
@@ -291,7 +297,7 @@ func (envw *environmentWatcher) deleteBuilderServiceByName(ctx context.Context,
|
|||||||
Services(namespace).
|
Services(namespace).
|
||||||
Delete(ctx, name, delOpt)
|
Delete(ctx, name, delOpt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "error deleting builder service %s.%s", name, namespace)
|
return fmt.Errorf("error deleting builder service %s.%s: %w", name, namespace, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -301,7 +307,7 @@ func (envw *environmentWatcher) deleteBuilderDeploymentByName(ctx context.Contex
|
|||||||
Deployments(namespace).
|
Deployments(namespace).
|
||||||
Delete(ctx, name, delOpt)
|
Delete(ctx, name, delOpt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "error deleting builder deployment %s.%s", name, namespace)
|
return fmt.Errorf("error deleting builder deployment %s.%s: %w", name, namespace, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -313,7 +319,7 @@ func (envw *environmentWatcher) getBuilderServiceList(ctx context.Context, sel m
|
|||||||
LabelSelector: labels.Set(sel).AsSelector().String(),
|
LabelSelector: labels.Set(sel).AsSelector().String(),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error getting builder service list")
|
return nil, fmt.Errorf("error getting builder service list for namespace %s: %w", ns, err)
|
||||||
}
|
}
|
||||||
return svcList.Items, nil
|
return svcList.Items, nil
|
||||||
}
|
}
|
||||||
@@ -321,11 +327,22 @@ func (envw *environmentWatcher) getBuilderServiceList(ctx context.Context, sel m
|
|||||||
func (envw *environmentWatcher) createBuilderService(ctx context.Context, env *fv1.Environment, ns string) (*apiv1.Service, error) {
|
func (envw *environmentWatcher) createBuilderService(ctx context.Context, env *fv1.Environment, ns string) (*apiv1.Service, error) {
|
||||||
name := fmt.Sprintf("%v-%v", env.ObjectMeta.Name, env.ObjectMeta.ResourceVersion)
|
name := fmt.Sprintf("%v-%v", env.ObjectMeta.Name, env.ObjectMeta.ResourceVersion)
|
||||||
sel := envw.getLabels(env.ObjectMeta.Name, ns, env.ObjectMeta.ResourceVersion)
|
sel := envw.getLabels(env.ObjectMeta.Name, ns, env.ObjectMeta.ResourceVersion)
|
||||||
|
var ownerReferences []metav1.OwnerReference
|
||||||
|
if envw.enableOwnerReferences {
|
||||||
|
ownerReferences = []metav1.OwnerReference{
|
||||||
|
*metav1.NewControllerRef(env, schema.GroupVersionKind{
|
||||||
|
Group: "fission.io",
|
||||||
|
Version: "v1",
|
||||||
|
Kind: "Environment",
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
service := apiv1.Service{
|
service := apiv1.Service{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Namespace: ns,
|
Namespace: ns,
|
||||||
Name: name,
|
Name: name,
|
||||||
Labels: sel,
|
Labels: sel,
|
||||||
|
OwnerReferences: ownerReferences,
|
||||||
},
|
},
|
||||||
Spec: apiv1.ServiceSpec{
|
Spec: apiv1.ServiceSpec{
|
||||||
Selector: sel,
|
Selector: sel,
|
||||||
@@ -367,7 +384,7 @@ func (envw *environmentWatcher) getBuilderDeploymentList(ctx context.Context, se
|
|||||||
LabelSelector: labels.Set(sel).AsSelector().String(),
|
LabelSelector: labels.Set(sel).AsSelector().String(),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error getting builder deployment list")
|
return nil, fmt.Errorf("error getting builder deployment list for namespace %s: %w", ns, err)
|
||||||
}
|
}
|
||||||
return deployList.Items, nil
|
return deployList.Items, nil
|
||||||
}
|
}
|
||||||
@@ -386,7 +403,7 @@ func (envw *environmentWatcher) createBuilderDeployment(ctx context.Context, env
|
|||||||
}
|
}
|
||||||
|
|
||||||
container, err := util.MergeContainer(&apiv1.Container{
|
container, err := util.MergeContainer(&apiv1.Container{
|
||||||
Name: "builder",
|
Name: fv1.BuilderContainerName,
|
||||||
Image: env.Spec.Builder.Image,
|
Image: env.Spec.Builder.Image,
|
||||||
ImagePullPolicy: envw.builderImagePullPolicy,
|
ImagePullPolicy: envw.builderImagePullPolicy,
|
||||||
TerminationMessagePath: "/dev/termination-log",
|
TerminationMessagePath: "/dev/termination-log",
|
||||||
@@ -432,11 +449,23 @@ func (envw *environmentWatcher) createBuilderDeployment(ctx context.Context, env
|
|||||||
|
|
||||||
pod.Spec = *(util.ApplyImagePullSecret(env.Spec.ImagePullSecret, pod.Spec))
|
pod.Spec = *(util.ApplyImagePullSecret(env.Spec.ImagePullSecret, pod.Spec))
|
||||||
|
|
||||||
|
var ownerReferences []metav1.OwnerReference
|
||||||
|
if envw.enableOwnerReferences {
|
||||||
|
ownerReferences = []metav1.OwnerReference{
|
||||||
|
*metav1.NewControllerRef(env, schema.GroupVersionKind{
|
||||||
|
Group: "fission.io",
|
||||||
|
Version: "v1",
|
||||||
|
Kind: "Environment",
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
deployment := &appsv1.Deployment{
|
deployment := &appsv1.Deployment{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Namespace: ns,
|
Namespace: ns,
|
||||||
Name: name,
|
Name: name,
|
||||||
Labels: sel,
|
Labels: sel,
|
||||||
|
OwnerReferences: ownerReferences,
|
||||||
},
|
},
|
||||||
Spec: appsv1.DeploymentSpec{
|
Spec: appsv1.DeploymentSpec{
|
||||||
Replicas: &replicas,
|
Replicas: &replicas,
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ import (
|
|||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
"github.com/fission/fission/pkg/cache"
|
"github.com/fission/fission/pkg/cache"
|
||||||
|
"github.com/fission/fission/pkg/crd"
|
||||||
"github.com/fission/fission/pkg/generated/clientset/versioned"
|
"github.com/fission/fission/pkg/generated/clientset/versioned"
|
||||||
"github.com/fission/fission/pkg/utils"
|
"github.com/fission/fission/pkg/utils"
|
||||||
|
"github.com/fission/fission/pkg/utils/manager"
|
||||||
"github.com/fission/fission/pkg/utils/metrics"
|
"github.com/fission/fission/pkg/utils/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -44,7 +46,7 @@ type (
|
|||||||
podInformer map[string]k8sCache.SharedIndexInformer
|
podInformer map[string]k8sCache.SharedIndexInformer
|
||||||
pkgInformer map[string]k8sCache.SharedIndexInformer
|
pkgInformer map[string]k8sCache.SharedIndexInformer
|
||||||
storageSvcUrl string
|
storageSvcUrl string
|
||||||
buildCache *cache.Cache
|
buildCache *cache.Cache[crd.CacheKeyUR, *fv1.Package]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -59,13 +61,13 @@ func makePackageWatcher(logger *zap.Logger, fissionClient versioned.Interface, k
|
|||||||
podInformer: podInformer,
|
podInformer: podInformer,
|
||||||
pkgInformer: pkgInformer,
|
pkgInformer: pkgInformer,
|
||||||
storageSvcUrl: storageSvcUrl,
|
storageSvcUrl: storageSvcUrl,
|
||||||
buildCache: cache.MakeCache(0, 0),
|
buildCache: cache.MakeCache[crd.CacheKeyUR, *fv1.Package](0, 0),
|
||||||
}
|
}
|
||||||
return pkgw
|
return pkgw
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pkgw *packageWatcher) buildCacheKey(obj metav1.ObjectMeta) string {
|
func (pkgw *packageWatcher) buildCacheKey(obj metav1.ObjectMeta) crd.CacheKeyUR {
|
||||||
return fmt.Sprintf("%s-%s-%s", obj.Namespace, obj.Name, obj.ResourceVersion)
|
return crd.CacheKeyURFromMeta(&obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pkgw *packageWatcher) buildWithCache(ctx context.Context, srcpkg *fv1.Package) {
|
func (pkgw *packageWatcher) buildWithCache(ctx context.Context, srcpkg *fv1.Package) {
|
||||||
@@ -89,33 +91,33 @@ func (pkgw *packageWatcher) buildWithCache(ctx context.Context, srcpkg *fv1.Pack
|
|||||||
// 6. Update package status to succeed state
|
// 6. Update package status to succeed state
|
||||||
// *. Update package status to failed state,if any one of steps above failed/time out
|
// *. Update package status to failed state,if any one of steps above failed/time out
|
||||||
func (pkgw *packageWatcher) build(ctx context.Context, srcpkg *fv1.Package) {
|
func (pkgw *packageWatcher) build(ctx context.Context, srcpkg *fv1.Package) {
|
||||||
|
key := pkgw.buildCacheKey(srcpkg.ObjectMeta)
|
||||||
|
logger := pkgw.logger.With(zap.String("package", srcpkg.Name), zap.String("namespace", srcpkg.Namespace), zap.String("resource_version", srcpkg.ResourceVersion), zap.String("key", key.String()))
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
key := pkgw.buildCacheKey(srcpkg.ObjectMeta)
|
|
||||||
err := pkgw.buildCache.Delete(key)
|
err := pkgw.buildCache.Delete(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pkgw.logger.Error("error deleting key from cache", zap.String("key", key), zap.Error(err))
|
logger.Error("error deleting key from cache", zap.Any("key", key), zap.Error(err))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
pkgw.logger.Info("starting build for package", zap.String("package_name", srcpkg.ObjectMeta.Name), zap.String("resource_version", srcpkg.ObjectMeta.ResourceVersion))
|
logger.Info("starting build for package")
|
||||||
|
|
||||||
pkg, err := updatePackage(ctx, pkgw.logger, pkgw.fissionClient, srcpkg, fv1.BuildStatusRunning, "", nil)
|
pkg, err := updatePackage(ctx, logger, pkgw.fissionClient, srcpkg, fv1.BuildStatusRunning, "", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pkgw.logger.Error("error setting package pending state", zap.Error(err))
|
logger.Error("error setting package pending state", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
env, err := pkgw.fissionClient.CoreV1().Environments(pkg.Spec.Environment.Namespace).Get(ctx, pkg.Spec.Environment.Name, metav1.GetOptions{})
|
env, err := pkgw.fissionClient.CoreV1().Environments(pkg.Spec.Environment.Namespace).Get(ctx, pkg.Spec.Environment.Name, metav1.GetOptions{})
|
||||||
if k8serrors.IsNotFound(err) {
|
if k8serrors.IsNotFound(err) {
|
||||||
e := "environment does not exist"
|
e := "environment does not exist"
|
||||||
pkgw.logger.Error(e, zap.String("environment", pkg.Spec.Environment.Name))
|
logger.Error(e, zap.String("environment", pkg.Spec.Environment.Name))
|
||||||
_, er := updatePackage(ctx, pkgw.logger, pkgw.fissionClient, pkg,
|
_, er := updatePackage(ctx, logger, pkgw.fissionClient, pkg,
|
||||||
fv1.BuildStatusFailed, fmt.Sprintf("%s: %q", e, pkg.Spec.Environment.Name), nil)
|
fv1.BuildStatusFailed, fmt.Sprintf("%s: %q", e, pkg.Spec.Environment.Name), nil)
|
||||||
if er != nil {
|
if er != nil {
|
||||||
pkgw.logger.Error(
|
logger.Error(
|
||||||
"error updating package",
|
"error updating package",
|
||||||
zap.String("package_name", pkg.ObjectMeta.Name),
|
|
||||||
zap.String("resource_version", pkg.ObjectMeta.ResourceVersion),
|
|
||||||
zap.Error(er),
|
zap.Error(er),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -126,7 +128,9 @@ func (pkgw *packageWatcher) build(ctx context.Context, srcpkg *fv1.Package) {
|
|||||||
healthCheckBackOff := utils.NewDefaultBackOff()
|
healthCheckBackOff := utils.NewDefaultBackOff()
|
||||||
builderNs := pkgw.nsResolver.GetBuilderNS(env.ObjectMeta.Namespace)
|
builderNs := pkgw.nsResolver.GetBuilderNS(env.ObjectMeta.Namespace)
|
||||||
|
|
||||||
//if err != nil {
|
logger = logger.With(zap.String("environment", env.Name), zap.String("builder_namespace", builderNs), zap.String("environment_namespace", env.Namespace))
|
||||||
|
|
||||||
|
// if err != nil {
|
||||||
// pkgw.logger.Error("Unable to create BackOff for Health Check", zap.Error(err))
|
// pkgw.logger.Error("Unable to create BackOff for Health Check", zap.Error(err))
|
||||||
//}
|
//}
|
||||||
// Do health check for environment builder pod
|
// Do health check for environment builder pod
|
||||||
@@ -135,12 +139,12 @@ func (pkgw *packageWatcher) build(ctx context.Context, srcpkg *fv1.Package) {
|
|||||||
// iterate all available environment builders.
|
// iterate all available environment builders.
|
||||||
items := pkgw.podInformer[builderNs].GetStore().List()
|
items := pkgw.podInformer[builderNs].GetStore().List()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pkgw.logger.Error("error retrieving pod information for environment", zap.Error(err), zap.String("environment", env.ObjectMeta.Name))
|
logger.Error("error retrieving pod information for environment", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(items) == 0 {
|
if len(items) == 0 {
|
||||||
pkgw.logger.Info("builder pod does not exist for environment, will retry again later", zap.String("environment", pkg.Spec.Environment.Name))
|
logger.Info("builder pod does not exist for environment, will retry again later")
|
||||||
time.Sleep(healthCheckBackOff.GetCurrentBackoffDuration())
|
time.Sleep(healthCheckBackOff.GetCurrentBackoffDuration())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -164,27 +168,22 @@ func (pkgw *packageWatcher) build(ctx context.Context, srcpkg *fv1.Package) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !podIsReady {
|
if !podIsReady {
|
||||||
pkgw.logger.Info("builder pod is not ready for environment, will retry again later", zap.String("environment", pkg.Spec.Environment.Name))
|
logger.Info("builder pod is not ready for environment, will retry again later")
|
||||||
time.Sleep(healthCheckBackOff.GetCurrentBackoffDuration())
|
time.Sleep(healthCheckBackOff.GetCurrentBackoffDuration())
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadResp, buildLogs, err := buildPackage(ctx, pkgw.logger, pkgw.fissionClient, builderNs, pkgw.storageSvcUrl, pkg)
|
uploadResp, buildLogs, err := buildPackage(ctx, pkgw.logger, pkgw.fissionClient, builderNs, pkgw.storageSvcUrl, pkg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pkgw.logger.Error("error building package", zap.Error(err), zap.String("package_name", pkg.ObjectMeta.Name))
|
logger.Error("error building package", zap.Error(err))
|
||||||
_, er := updatePackage(ctx, pkgw.logger, pkgw.fissionClient, pkg, fv1.BuildStatusFailed, buildLogs, nil)
|
_, er := updatePackage(ctx, logger, pkgw.fissionClient, pkg, fv1.BuildStatusFailed, buildLogs, nil)
|
||||||
if er != nil {
|
if er != nil {
|
||||||
pkgw.logger.Error(
|
logger.Error("error updating package", zap.Error(er))
|
||||||
"error updating package",
|
|
||||||
zap.String("package_name", pkg.ObjectMeta.Name),
|
|
||||||
zap.String("resource_version", pkg.ObjectMeta.ResourceVersion),
|
|
||||||
zap.Error(er),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgw.logger.Info("starting package info update", zap.String("package_name", pkg.ObjectMeta.Name))
|
logger.Info("starting package info update")
|
||||||
|
|
||||||
fnList, err := pkgw.fissionClient.CoreV1().
|
fnList, err := pkgw.fissionClient.CoreV1().
|
||||||
Functions(pkg.Namespace).List(ctx, metav1.ListOptions{})
|
Functions(pkg.Namespace).List(ctx, metav1.ListOptions{})
|
||||||
@@ -196,8 +195,6 @@ func (pkgw *packageWatcher) build(ctx context.Context, srcpkg *fv1.Package) {
|
|||||||
if er != nil {
|
if er != nil {
|
||||||
pkgw.logger.Error(
|
pkgw.logger.Error(
|
||||||
"error updating package",
|
"error updating package",
|
||||||
zap.String("package_name", pkg.ObjectMeta.Name),
|
|
||||||
zap.String("resource_version", pkg.ObjectMeta.ResourceVersion),
|
|
||||||
zap.Error(er),
|
zap.Error(er),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -214,57 +211,41 @@ func (pkgw *packageWatcher) build(ctx context.Context, srcpkg *fv1.Package) {
|
|||||||
_, err = pkgw.fissionClient.CoreV1().Functions(fn.ObjectMeta.Namespace).Update(ctx, &fn, metav1.UpdateOptions{})
|
_, err = pkgw.fissionClient.CoreV1().Functions(fn.ObjectMeta.Namespace).Update(ctx, &fn, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e := "error updating function package resource version"
|
e := "error updating function package resource version"
|
||||||
pkgw.logger.Error(e, zap.Error(err))
|
logger.Error(e, zap.Error(err))
|
||||||
buildLogs += fmt.Sprintf("%s: %v\n", e, err)
|
buildLogs += fmt.Sprintf("%s: %v\n", e, err)
|
||||||
_, er := updatePackage(ctx, pkgw.logger, pkgw.fissionClient, pkg, fv1.BuildStatusFailed, buildLogs, nil)
|
_, er := updatePackage(ctx, logger, pkgw.fissionClient, pkg, fv1.BuildStatusFailed, buildLogs, nil)
|
||||||
if er != nil {
|
if er != nil {
|
||||||
pkgw.logger.Error(
|
logger.Error("error updating package", zap.Error(er))
|
||||||
"error updating package",
|
|
||||||
zap.String("package_name", pkg.ObjectMeta.Name),
|
|
||||||
zap.String("resource_version", pkg.ObjectMeta.ResourceVersion),
|
|
||||||
zap.Error(er),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = updatePackage(ctx, pkgw.logger, pkgw.fissionClient, pkg,
|
_, err = updatePackage(ctx, logger, pkgw.fissionClient, pkg,
|
||||||
fv1.BuildStatusSucceeded, buildLogs, uploadResp)
|
fv1.BuildStatusSucceeded, buildLogs, uploadResp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pkgw.logger.Error("error updating package info", zap.Error(err), zap.String("package_name", pkg.ObjectMeta.Name))
|
logger.Error("error updating package info", zap.Error(err))
|
||||||
_, er := updatePackage(ctx, pkgw.logger, pkgw.fissionClient, pkg, fv1.BuildStatusFailed, buildLogs, nil)
|
_, er := updatePackage(ctx, logger, pkgw.fissionClient, pkg, fv1.BuildStatusFailed, buildLogs, nil)
|
||||||
if er != nil {
|
if er != nil {
|
||||||
pkgw.logger.Error(
|
logger.Error("error updating package", zap.Error(er))
|
||||||
"error updating package",
|
|
||||||
zap.String("package_name", pkg.ObjectMeta.Name),
|
|
||||||
zap.String("resource_version", pkg.ObjectMeta.ResourceVersion),
|
|
||||||
zap.Error(er),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgw.logger.Info("completed package build request", zap.String("package_name", pkg.ObjectMeta.Name))
|
logger.Info("completed package build request")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
time.Sleep(healthCheckBackOff.GetNext())
|
time.Sleep(healthCheckBackOff.GetNext())
|
||||||
}
|
}
|
||||||
// build timeout
|
// build timeout
|
||||||
_, err = updatePackage(ctx, pkgw.logger, pkgw.fissionClient, pkg,
|
_, err = updatePackage(ctx, logger, pkgw.fissionClient, pkg,
|
||||||
fv1.BuildStatusFailed, "Build timeout due to environment builder not ready", nil)
|
fv1.BuildStatusFailed, "Build timeout due to environment builder not ready", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pkgw.logger.Error(
|
logger.Error("error updating package", zap.Error(err))
|
||||||
"error updating package",
|
|
||||||
zap.String("package_name", pkg.ObjectMeta.Name),
|
|
||||||
zap.String("resource_version", pkg.ObjectMeta.ResourceVersion),
|
|
||||||
zap.Error(err),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgw.logger.Error("max retries exceeded in building source package, timeout due to environment builder not ready",
|
logger.Error("max retries exceeded in building source package, timeout due to environment builder not ready")
|
||||||
zap.String("package", fmt.Sprintf("%s.%s", pkg.ObjectMeta.Name, pkg.ObjectMeta.Namespace)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pkgw *packageWatcher) packageInformerHandler(ctx context.Context) k8sCache.ResourceEventHandlerFuncs {
|
func (pkgw *packageWatcher) packageInformerHandler(ctx context.Context) k8sCache.ResourceEventHandlerFuncs {
|
||||||
@@ -308,15 +289,21 @@ func (pkgw *packageWatcher) packageInformerHandler(ctx context.Context) k8sCache
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pkgw *packageWatcher) Run(ctx context.Context) {
|
func (pkgw *packageWatcher) Run(ctx context.Context, mgr manager.Interface) error {
|
||||||
go metrics.ServeMetrics(ctx, pkgw.logger)
|
|
||||||
for _, podInformer := range pkgw.podInformer {
|
mgr.Add(ctx, func(ctx context.Context) {
|
||||||
go podInformer.Run(ctx.Done())
|
metrics.ServeMetrics(ctx, "buildermgr", pkgw.logger, mgr)
|
||||||
}
|
})
|
||||||
|
mgr.AddInformers(ctx, pkgw.podInformer)
|
||||||
for _, pkgInformer := range pkgw.pkgInformer {
|
for _, pkgInformer := range pkgw.pkgInformer {
|
||||||
pkgInformer.AddEventHandler(pkgw.packageInformerHandler(ctx))
|
_, err := pkgInformer.AddEventHandler(pkgw.packageInformerHandler(ctx))
|
||||||
go pkgInformer.Run(ctx.Done())
|
if err != nil {
|
||||||
|
pkgw.logger.Fatal("error adding package informer handler", zap.Error(err))
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
mgr.AddInformers(ctx, pkgw.pkgInformer)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// setInitialBuildStatus sets initial build status to a package if it is empty.
|
// setInitialBuildStatus sets initial build status to a package if it is empty.
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user