Compare commits
103
Commits
v1.20.1
...
v1.21.0-rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -0,0 +1,36 @@
|
||||
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
|
||||
groups:
|
||||
docker-images:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: gomod
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
open-pull-requests-limit: 5
|
||||
groups:
|
||||
go-dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
@@ -4,39 +4,43 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**.go'
|
||||
- go.mod
|
||||
- go.sum
|
||||
- '!dependabot/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**.go'
|
||||
- go.mod
|
||||
- go.sum
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
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') }}
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: setup go
|
||||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
cache: true
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
|
||||
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
|
||||
with:
|
||||
languages: go
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
|
||||
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# 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
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: 'Checkout Repository'
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
|
||||
@@ -11,18 +11,25 @@ on:
|
||||
- main
|
||||
paths:
|
||||
- 'charts/fission-all/dashboards/**.json'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint-dashboards:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
|
||||
|
||||
@@ -15,22 +15,32 @@ on:
|
||||
- "**.go"
|
||||
- go.mod
|
||||
- go.sum
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
GOLANGCI_LINT_VERSION: v1.55.2
|
||||
GOLANGCI_LINT_VERSION: v1.63.4
|
||||
GOLANGCI_LINT_TIMEOUT: 5m
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
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:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
cache: true
|
||||
@@ -41,8 +51,9 @@ jobs:
|
||||
go mod download
|
||||
|
||||
- name: Run golangci-lint
|
||||
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
|
||||
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
|
||||
with:
|
||||
skip-cache: true
|
||||
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
||||
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}
|
||||
|
||||
@@ -61,8 +72,8 @@ jobs:
|
||||
run: ./hack/runtests.sh
|
||||
|
||||
- name: Upload Coverage report to CodeCov
|
||||
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
|
||||
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
|
||||
with:
|
||||
token: ${{secrets.CODECOV_TOKEN}}
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
flags: unittests
|
||||
file: ./coverage.txt
|
||||
|
||||
@@ -4,6 +4,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- '!dependabot/**'
|
||||
paths:
|
||||
- "**.go"
|
||||
- "charts/**"
|
||||
@@ -19,13 +20,15 @@ on:
|
||||
- "test/**"
|
||||
- go.mod
|
||||
- go.sum
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
HELM_VERSION: v3.13.0
|
||||
KIND_VERSION: v0.20.0
|
||||
HELM_VERSION: v3.16.4
|
||||
KIND_VERSION: v0.26.0
|
||||
KIND_CLUSTER_NAME: kind
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# Job to run change detection
|
||||
integration-test:
|
||||
@@ -34,31 +37,36 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
kindversion: ["v1.23.17", "v1.25.11", "v1.27.3"]
|
||||
os: [ubuntu-latest]
|
||||
kindversion: ["v1.28.15", "v1.30.8", "v1.32.0"]
|
||||
os: [ubuntu-24.04]
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: setup go
|
||||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
cache: true
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
repository: fission/examples
|
||||
path: examples
|
||||
|
||||
- name: Helm installation
|
||||
uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
||||
uses: Azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
||||
with:
|
||||
version: ${{ env.HELM_VERSION }}
|
||||
|
||||
- name: Kind Cluster
|
||||
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
||||
with:
|
||||
node_image: kindest/node:${{ matrix.kindversion }}
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
@@ -79,14 +87,15 @@ jobs:
|
||||
|
||||
- name: Install Skaffold
|
||||
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/v2.13.2/skaffold-linux-amd64
|
||||
sudo install skaffold /usr/local/bin/
|
||||
skaffold version
|
||||
|
||||
- name: Install GoReleaser
|
||||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
|
||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
||||
with:
|
||||
install-only: true
|
||||
version: "~> v2"
|
||||
|
||||
- name: Setup Prometheus Stack
|
||||
run: |
|
||||
@@ -144,7 +153,7 @@ jobs:
|
||||
- name: Archive fission dump
|
||||
timeout-minutes: 10
|
||||
if: ${{ failure() || cancelled() }}
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||
path: fission-dump/*.zip
|
||||
@@ -153,7 +162,7 @@ jobs:
|
||||
- name: Archive prometheus dump
|
||||
timeout-minutes: 10
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||
path: /tmp/prometheus/*
|
||||
@@ -162,7 +171,7 @@ jobs:
|
||||
- name: Archive kind logs
|
||||
timeout-minutes: 10
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||
path: kind-logs/*
|
||||
@@ -177,30 +186,35 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
kindversion: ["v1.19.16"]
|
||||
os: [ubuntu-latest]
|
||||
os: [ubuntu-24.04]
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: setup go
|
||||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
cache: true
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
repository: fission/examples
|
||||
path: examples
|
||||
|
||||
- name: Helm installation
|
||||
uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
||||
uses: Azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
||||
with:
|
||||
version: ${{ env.HELM_VERSION }}
|
||||
|
||||
- name: Kind Cluster
|
||||
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
||||
with:
|
||||
node_image: kindest/node:${{ matrix.kindversion }}
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
@@ -221,14 +235,15 @@ jobs:
|
||||
|
||||
- name: Install Skaffold
|
||||
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/v2.13.2/skaffold-linux-amd64
|
||||
sudo install skaffold /usr/local/bin/
|
||||
skaffold version
|
||||
|
||||
- name: Install GoReleaser
|
||||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
|
||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
||||
with:
|
||||
install-only: true
|
||||
version: "~> v2"
|
||||
|
||||
- name: Setup Prometheus Stack
|
||||
run: |
|
||||
@@ -289,26 +304,26 @@ jobs:
|
||||
- name: Archive fission dump
|
||||
timeout-minutes: 10
|
||||
if: ${{ failure() || cancelled() }}
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: fission-dump-${{ github.run_id }}-${{ github.job_id }}-${{ matrix.kindversion }}
|
||||
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||
path: fission-dump/*.zip
|
||||
retention-days: 5
|
||||
|
||||
- name: Archive prometheus dump
|
||||
timeout-minutes: 10
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: prom-dump-${{ github.run_id }}-${{ github.job_id }}-${{ matrix.kindversion }}
|
||||
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||
path: /tmp/prometheus/*
|
||||
retention-days: 5
|
||||
|
||||
- name: Archive kind logs
|
||||
timeout-minutes: 10
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: kind-logs-${{ github.run_id }}-${{ github.job_id }}-${{ matrix.kindversion }}
|
||||
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||
path: kind-logs/*
|
||||
retention-days: 5
|
||||
+211
-28
@@ -6,36 +6,52 @@ on:
|
||||
- v2.**
|
||||
|
||||
env:
|
||||
KIND_VERSION: v0.20.0
|
||||
KIND_NODE_IMAGE_TAG: v1.23.17
|
||||
KIND_VERSION: v0.26.0
|
||||
KIND_NODE_IMAGE_TAG: v1.28.15
|
||||
KIND_CLUSTER_NAME: kind
|
||||
COSIGN_VERSION: v2.4.1
|
||||
|
||||
jobs:
|
||||
create-draft-release:
|
||||
runs-on: ubuntu-latest
|
||||
name: Create Draft Release with Goreleaser
|
||||
outputs:
|
||||
hashes: ${{ steps.binary.outputs.hashes }}
|
||||
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
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
cache: true
|
||||
|
||||
- name: Get the 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
|
||||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
|
||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
||||
with:
|
||||
install-only: true
|
||||
version: "~> v2"
|
||||
|
||||
- name: Kind Clutser
|
||||
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
||||
- name: Kind Cluster
|
||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
||||
with:
|
||||
node_image: kindest/node:${{ env.KIND_NODE_IMAGE_TAG }}
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
@@ -43,34 +59,24 @@ jobs:
|
||||
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
|
||||
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
|
||||
|
||||
- name: Login to ghcr.io
|
||||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Login to docker.io
|
||||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Install Cosign
|
||||
uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0
|
||||
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
|
||||
with:
|
||||
cosign-release: "v2.2.1"
|
||||
cosign-release: ${{ env.COSIGN_VERSION }}
|
||||
|
||||
- name: Check cosign install!
|
||||
run: cosign version
|
||||
|
||||
- name: Write cosign signing key to disk
|
||||
run: 'echo "$KEY" > cosign.key'
|
||||
shell: bash
|
||||
env:
|
||||
KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
|
||||
- uses: anchore/sbom-action/download-syft@df80a981bc6edbc4e220a492d3cbe9f5547a6e75 #v0.17.9
|
||||
|
||||
- name: Generate yaml for manifest, Minikube and Openshift installation
|
||||
run: ${GITHUB_WORKSPACE}/hack/build-yaml.sh $VERSION
|
||||
@@ -79,14 +85,191 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
|
||||
id: goreleaser
|
||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
||||
with:
|
||||
version: latest
|
||||
version: "~> v2"
|
||||
args: release
|
||||
env:
|
||||
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
|
||||
GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.VERSION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
|
||||
#ToDo - Verify and upload releases
|
||||
- name: Generate binary hashes
|
||||
id: binary
|
||||
env:
|
||||
ARTIFACTS: "${{ steps.goreleaser.outputs.artifacts }}"
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
|
||||
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- 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 Manifest") | {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"
|
||||
|
||||
binary-provenance:
|
||||
name: Create Binary Provenance
|
||||
needs: [create-draft-release]
|
||||
permissions:
|
||||
actions: read # To read the workflow path.
|
||||
id-token: write # To sign the provenance.
|
||||
contents: write # To add assets to a release.
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0 # Do not use commit hash
|
||||
with:
|
||||
base64-subjects: "${{ needs.create-draft-release.outputs.hashes }}"
|
||||
provenance-name: "fission_${{ needs.create-draft-release.outputs.version }}.intoto.jsonl"
|
||||
upload-assets: true # upload to a new release
|
||||
draft-release: true # create a draft release
|
||||
|
||||
image-provenance-ghcr:
|
||||
name: Create Image Provenance
|
||||
needs: [create-draft-release]
|
||||
strategy:
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.create-draft-release.outputs.ghcr_images) }}
|
||||
permissions:
|
||||
actions: read
|
||||
id-token: write
|
||||
packages: write
|
||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0 # Do not use commit hash
|
||||
with:
|
||||
image: ${{ fromJson(toJson(matrix)).image }}
|
||||
digest: ${{ fromJson(toJson(matrix)).checksum }}
|
||||
registry-username: ${{ github.actor }}
|
||||
secrets:
|
||||
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
image-sbom-ghcr:
|
||||
name: Create SBOM 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
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.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@18f2510ee396bbf400402947b394f2dd8c87dbb0 # v0.29.0
|
||||
with:
|
||||
scan-type: "fs"
|
||||
format: "spdx-json"
|
||||
output: "spdx.sbom.json"
|
||||
- name: Install Cosign
|
||||
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
|
||||
with:
|
||||
cosign-release: ${{ env.COSIGN_VERSION }}
|
||||
- name: Sign image and sbom
|
||||
env:
|
||||
IMAGE: ${{ fromJson(toJson(matrix)).image }}
|
||||
DIGEST: ${{ fromJson(toJson(matrix)).checksum }}
|
||||
run: |
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cosign attach sbom --sbom spdx.sbom.json $IMAGE@$DIGEST
|
||||
cosign sign -a git_sha=$GITHUB_SHA --attachment sbom $IMAGE@$DIGEST --yes
|
||||
|
||||
binary-provenance-verification-with-slsa-verifier:
|
||||
name : Verify Binary Provenance
|
||||
needs: [create-draft-release, binary-provenance]
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
contents: write # To download the assets from draft release.
|
||||
steps:
|
||||
- name: Install the verifier
|
||||
uses: slsa-framework/slsa-verifier/actions/installer@3714a2a4684014deb874a0e737dffa0ee02dd647 # v2.6.0
|
||||
|
||||
- name: Download assets
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PROVENANCE: ${{ needs.binary-provenance.outputs.provenance-name }}
|
||||
VERSION: ${{ needs.create-draft-release.outputs.version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "repo=$GITHUB_REPOSITORY"
|
||||
echo "ref=$VERSION"
|
||||
gh -R "$GITHUB_REPOSITORY" release download "$VERSION" -p "$PROVENANCE"
|
||||
|
||||
- name: Verify assets
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CHECKSUMS: ${{ needs.create-draft-release.outputs.hashes }}
|
||||
PROVENANCE: ${{ needs.binary-provenance.outputs.provenance-name }}
|
||||
VERSION: ${{ needs.create-draft-release.outputs.version }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "CHECKSUMS=$CHECKSUMS"
|
||||
echo "PROVENANCE=$PROVENANCE"
|
||||
checksums=$(echo "$CHECKSUMS" | base64 -d)
|
||||
while read -r line; do
|
||||
fn=$(echo $line | cut -d ' ' -f2)
|
||||
echo "Verifying $fn"
|
||||
gh -R "$GITHUB_REPOSITORY" release download "$VERSION" -p "$fn"
|
||||
slsa-verifier verify-artifact --provenance-path "$PROVENANCE" \
|
||||
--source-uri "github.com/$GITHUB_REPOSITORY" \
|
||||
--source-tag "$VERSION" \
|
||||
"$fn"
|
||||
done <<<"$checksums"
|
||||
|
||||
image-provenance-verification-with-cosign:
|
||||
name: Verify Image Provenance
|
||||
needs: [create-draft-release, image-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@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install Cosign
|
||||
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.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 slsaprovenance \
|
||||
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
||||
--certificate-identity-regexp '^https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@refs/tags/v[0-9]+.[0-9]+.[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@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
|
||||
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@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 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@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -4,6 +4,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- '!dependabot/**'
|
||||
paths:
|
||||
- "**.go"
|
||||
- "charts/**"
|
||||
@@ -19,13 +20,15 @@ on:
|
||||
- "test/**"
|
||||
- go.mod
|
||||
- go.sum
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
HELM_VERSION: v3.13.0
|
||||
KIND_VERSION: v0.20.0
|
||||
HELM_VERSION: v3.16.4
|
||||
KIND_VERSION: v0.26.0
|
||||
KIND_CLUSTER_NAME: kind
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
upgrade-test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -33,34 +36,40 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
kindimage: ["kindest/node:v1.23.17"]
|
||||
os: [ubuntu-latest]
|
||||
kindversion: ["v1.28.15"]
|
||||
os: [ubuntu-24.04]
|
||||
steps:
|
||||
- name: Harden Runner
|
||||
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: Checkout action sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
cache: true
|
||||
|
||||
- name: Setup Helm
|
||||
uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
||||
uses: Azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
||||
with:
|
||||
version: ${{ env.HELM_VERSION }}
|
||||
|
||||
- name: Setup Kind Clutser
|
||||
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
||||
- name: Setup Kind Cluster
|
||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
||||
with:
|
||||
node_image: ${{ matrix.kindimage }}
|
||||
node_image: kindest/node:${{ matrix.kindversion }}
|
||||
version: ${{ env.KIND_VERSION }}
|
||||
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
||||
|
||||
- name: Install GoReleaser
|
||||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
|
||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
||||
with:
|
||||
install-only: true
|
||||
version: "~> v2"
|
||||
|
||||
- name: Setup kubectl & fetch node information
|
||||
run: |
|
||||
@@ -105,7 +114,7 @@ jobs:
|
||||
|
||||
- name: Archive fission dump
|
||||
if: ${{ failure() || cancelled() }}
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||
path: fission-dump/*.zip
|
||||
@@ -113,7 +122,7 @@ jobs:
|
||||
|
||||
- name: Archive kind logs
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||
path: kind-logs/*
|
||||
|
||||
+128
-241
@@ -1,9 +1,14 @@
|
||||
version: 2
|
||||
|
||||
env:
|
||||
- GHCR_REPO=ghcr.io/fission
|
||||
|
||||
project_name: fission
|
||||
release:
|
||||
github:
|
||||
owner: fission
|
||||
name: fission
|
||||
prerelease: true
|
||||
prerelease: "true"
|
||||
draft: true
|
||||
header: |
|
||||
Release Highlights: https://fission.io/docs/releases/{{ .Tag }}/
|
||||
@@ -16,7 +21,7 @@ before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
snapshot:
|
||||
name_template: "{{ .Tag }}"
|
||||
version_template: "{{ .Tag }}"
|
||||
builds:
|
||||
- &build-linux
|
||||
id: builder
|
||||
@@ -36,9 +41,6 @@ builds:
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
- arm
|
||||
goarm:
|
||||
- 7
|
||||
binary: builder
|
||||
dir: ./cmd/builder
|
||||
- <<: *build-linux
|
||||
@@ -60,12 +62,6 @@ builds:
|
||||
ignore:
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
goarm: 7
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
goarm: 7
|
||||
- <<: *build-linux
|
||||
id: pre-upgrade-checks
|
||||
binary: pre-upgrade-checks
|
||||
@@ -82,77 +78,87 @@ dockers:
|
||||
ids:
|
||||
- builder
|
||||
image_templates:
|
||||
- "fission/builder:latest-amd64"
|
||||
- "fission/builder:{{ .Tag }}-amd64"
|
||||
- "ghcr.io/fission/builder:latest-amd64"
|
||||
- "ghcr.io/fission/builder:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/builder:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/builder:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/builder/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=org.opencontainers.image.description=The builder assists in building the fission function source code for deployment."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- <<: *docker-amd64
|
||||
ids:
|
||||
- fetcher
|
||||
image_templates:
|
||||
- "fission/fetcher:latest-amd64"
|
||||
- "fission/fetcher:{{ .Tag }}-amd64"
|
||||
- "ghcr.io/fission/fetcher:latest-amd64"
|
||||
- "ghcr.io/fission/fetcher:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/fetcher:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/fetcher/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=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."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- <<: *docker-amd64
|
||||
ids:
|
||||
- fission-bundle
|
||||
image_templates:
|
||||
- "fission/fission-bundle:latest-amd64"
|
||||
- "fission/fission-bundle:{{ .Tag }}-amd64"
|
||||
- "ghcr.io/fission/fission-bundle:latest-amd64"
|
||||
- "ghcr.io/fission/fission-bundle:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/fission-bundle/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=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."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- <<: *docker-amd64
|
||||
ids:
|
||||
- pre-upgrade-checks
|
||||
image_templates:
|
||||
- "fission/pre-upgrade-checks:latest-amd64"
|
||||
- "fission/pre-upgrade-checks:{{ .Tag }}-amd64"
|
||||
- "ghcr.io/fission/pre-upgrade-checks:latest-amd64"
|
||||
- "ghcr.io/fission/pre-upgrade-checks:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/preupgradechecks/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=org.opencontainers.image.description=Preupgradechecks ensures that Fission is ready for the targeted version upgrade by performing checks beforehand."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- <<: *docker-amd64
|
||||
ids:
|
||||
- reporter
|
||||
image_templates:
|
||||
- "fission/reporter:latest-amd64"
|
||||
- "fission/reporter:{{ .Tag }}-amd64"
|
||||
- "ghcr.io/fission/reporter:latest-amd64"
|
||||
- "ghcr.io/fission/reporter:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/reporter:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/reporter:{{ .Tag }}-amd64"
|
||||
dockerfile: cmd/reporter/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=org.opencontainers.image.description=The reporter gathers information that assists in improving fission."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- &docker-arm64
|
||||
use: buildx
|
||||
goos: linux
|
||||
@@ -160,259 +166,130 @@ dockers:
|
||||
ids:
|
||||
- builder
|
||||
image_templates:
|
||||
- "fission/builder:latest-arm64"
|
||||
- "fission/builder:{{ .Tag }}-arm64"
|
||||
- "ghcr.io/fission/builder:latest-arm64"
|
||||
- "ghcr.io/fission/builder:{{ .Tag }}-arm64"
|
||||
- "{{ .Env.GHCR_REPO }}/builder:latest-arm64"
|
||||
- "{{ .Env.GHCR_REPO }}/builder:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/builder/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=org.opencontainers.image.description=The builder assists in building the fission function source code for deployment."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- <<: *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"
|
||||
- "{{ .Env.GHCR_REPO }}/fetcher:latest-arm64"
|
||||
- "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/fetcher/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=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."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- <<: *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"
|
||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:latest-arm64"
|
||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/fission-bundle/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=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."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- <<: *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"
|
||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:latest-arm64"
|
||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/preupgradechecks/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=org.opencontainers.image.description=Preupgradechecks ensures that Fission is ready for the targeted version upgrade by performing checks beforehand."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
- <<: *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"
|
||||
- "{{ .Env.GHCR_REPO }}/reporter:latest-arm64"
|
||||
- "{{ .Env.GHCR_REPO }}/reporter:{{ .Tag }}-arm64"
|
||||
dockerfile: cmd/reporter/Dockerfile
|
||||
build_flag_templates:
|
||||
- "--label=org.opencontainers.image.description=The reporter gathers information that assists in improving fission."
|
||||
- "--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}}"
|
||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
||||
- "--label=org.opencontainers.image.vendor=Fission"
|
||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
||||
docker_manifests:
|
||||
- name_template: ghcr.io/fission/builder:{{ .Tag }}
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/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 }}
|
||||
- "{{ .Env.GHCR_REPO }}/builder:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/builder:{{ .Tag }}-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}"
|
||||
image_templates:
|
||||
- fission/builder:{{ .Tag }}-amd64
|
||||
- fission/builder:{{ .Tag }}-arm64
|
||||
- fission/builder:{{ .Tag }}-armv7
|
||||
- name_template: ghcr.io/fission/fetcher:{{ .Tag }}
|
||||
- "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/fission-bundle:{{ .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 }}
|
||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:{{ .Tag }}-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:{{ .Tag }}"
|
||||
image_templates:
|
||||
- fission/fetcher:{{ .Tag }}-amd64
|
||||
- fission/fetcher:{{ .Tag }}-arm64
|
||||
- fission/fetcher:{{ .Tag }}-armv7
|
||||
- name_template: ghcr.io/fission/fission-bundle:{{ .Tag }}
|
||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:{{ .Tag }}-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/reporter:{{ .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 }}
|
||||
- "{{ .Env.GHCR_REPO }}/reporter:{{ .Tag }}-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/reporter:{{ .Tag }}-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/builder:latest"
|
||||
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 }}
|
||||
- "{{ .Env.GHCR_REPO }}/builder:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/builder:latest-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/fetcher:latest"
|
||||
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 }}
|
||||
- "{{ .Env.GHCR_REPO }}/fetcher:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/fetcher:latest-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/fission-bundle:latest"
|
||||
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 }}
|
||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:latest-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:latest"
|
||||
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 }}
|
||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:latest-arm64"
|
||||
- name_template: "{{ .Env.GHCR_REPO }}/reporter:latest"
|
||||
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
|
||||
- "{{ .Env.GHCR_REPO }}/reporter:latest-amd64"
|
||||
- "{{ .Env.GHCR_REPO }}/reporter:latest-arm64"
|
||||
changelog:
|
||||
skip: false
|
||||
disable: true
|
||||
archives:
|
||||
- id: fission
|
||||
builds:
|
||||
@@ -426,27 +303,37 @@ checksum:
|
||||
# signs the checksum file
|
||||
# https://goreleaser.com/customization/sign
|
||||
signs:
|
||||
- cmd: cosign
|
||||
artifacts: all
|
||||
stdin: '{{ .Env.COSIGN_PWD }}'
|
||||
output: true
|
||||
args:
|
||||
- sign-blob
|
||||
- '--key=cosign.key'
|
||||
- '--output-certificate=${certificate}'
|
||||
- '--output-signature=${signature}'
|
||||
- '${artifact}'
|
||||
- '--yes' # needed for cosign 2.0.0+
|
||||
- id: cosign-binary
|
||||
env:
|
||||
- COSIGN_EXPERIMENTAL=1
|
||||
certificate: "${artifact}.pem"
|
||||
cmd: cosign
|
||||
artifacts: binary
|
||||
args:
|
||||
- sign-blob
|
||||
- "--output-signature=${signature}"
|
||||
- "--output-certificate=${certificate}"
|
||||
- "${artifact}"
|
||||
- "--yes" # needed for cosign 2.0.0+
|
||||
|
||||
# signs our docker image
|
||||
# https://goreleaser.com/customization/docker_sign
|
||||
docker_signs:
|
||||
- cmd: cosign
|
||||
artifacts: all
|
||||
stdin: '{{ .Env.COSIGN_PWD }}'
|
||||
output: true
|
||||
args:
|
||||
- 'sign'
|
||||
- '--key=cosign.key'
|
||||
- '${artifact}'
|
||||
- '--yes' # needed for cosign 2.0.0+
|
||||
- cmd: cosign
|
||||
env:
|
||||
- COSIGN_EXPERIMENTAL=1
|
||||
artifacts: all
|
||||
args:
|
||||
- sign
|
||||
- "${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
|
||||
|
||||
@@ -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)
|
||||
GOARCH ?= $(shell go env GOARCH)
|
||||
GOAMD64 ?= $(shell go env GOAMD64)
|
||||
GOPATH ?= $(shell go env GOPATH)
|
||||
|
||||
FISSION-CLI-SUFFIX :=
|
||||
ifeq ($(GOOS), windows)
|
||||
@@ -58,22 +59,19 @@ install-fission-cli:
|
||||
mv dist/fission-cli_$(GOOS)_$(GOARCH)_v1/fission$(FISSION-CLI-SUFFIX) /usr/local/bin/fission
|
||||
|
||||
### Codegen
|
||||
codegen: controller-gen-install
|
||||
@controller-gen object:headerFile="hack/boilerplate.txt" paths="./..."
|
||||
codegen:
|
||||
@./hack/update-codegen.sh
|
||||
go run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile="hack/boilerplate.txt" paths="./..."
|
||||
|
||||
### CRDs
|
||||
controller-gen-install:
|
||||
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0
|
||||
|
||||
generate-crds: controller-gen-install
|
||||
controller-gen crd \
|
||||
generate-crds:
|
||||
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd \
|
||||
paths=./pkg/apis/core/v1 \
|
||||
output:crd:artifacts:config=crds/v1
|
||||
|
||||
### Webhook generation: it generates webhook configs with help of kubebuilder:webhook tag
|
||||
generate-webhooks: controller-gen-install
|
||||
controller-gen webhook \
|
||||
generate-webhooks:
|
||||
go run sigs.k8s.io/controller-tools/cmd/controller-gen webhook \
|
||||
paths=./pkg/apis/core/v1 \
|
||||
output:dir=charts/fission-all/templates/webhook-server
|
||||
|
||||
@@ -98,12 +96,9 @@ generate-swagger-doc:
|
||||
generate-cli-docs:
|
||||
go run tools/cmd-docs/main.go -o "../fission.io/content/en/docs/reference/fission-cli"
|
||||
|
||||
install-crd-ref-docs:
|
||||
go install github.com/elastic/crd-ref-docs@v0.0.10
|
||||
|
||||
generate-crd-ref-docs: install-crd-ref-docs
|
||||
generate-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 run github.com/elastic/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
|
||||
cat out.md >> crd_docs.md && rm out.md
|
||||
mv crd_docs.md ../fission.io/content/en/docs/reference/crd-reference.md
|
||||
@@ -133,4 +128,4 @@ install-envtest:
|
||||
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
|
||||
|
||||
setup-envtest:
|
||||
setup-envtest -p path use 1.23.x
|
||||
setup-envtest -p path use 1.30.x
|
||||
|
||||
@@ -36,12 +36,16 @@
|
||||
<a href="https://github.com/fission/fission">
|
||||
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/fission/fission?style=social">
|
||||
</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>
|
||||
</p>
|
||||
|
||||
--------------
|
||||
|
||||
Fission is a fast serverless framework for Kubernetes with a focus on
|
||||
developer productivity and high performance.
|
||||
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.
|
||||
|
||||
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
|
||||
abstracted away under normal operation, though you can use both to
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
apiVersion: v2
|
||||
name: fission-all
|
||||
version: v1.20.1
|
||||
appVersion: v1.20.1
|
||||
version: v1.21.0-rc1
|
||||
appVersion: v1.21.0-rc1
|
||||
description: Fission is a fast serverless framework for Kubernetes.
|
||||
kubeVersion: ">=1.23.0-0"
|
||||
kubeVersion: ">=1.27.0-0"
|
||||
home: https://fission.io/
|
||||
icon: https://fission.io/images/fission-logo-white.svg
|
||||
sources:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{{ template "deprecationWarnings" . }}
|
||||
|
||||
1. Install the client CLI.
|
||||
|
||||
Mac:
|
||||
|
||||
@@ -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 -}}
|
||||
@@ -50,6 +50,24 @@ rules:
|
||||
- patch
|
||||
- delete
|
||||
{{- end }}
|
||||
{{- define "kafka-rules" }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- fission.io
|
||||
resources:
|
||||
- environments
|
||||
- functions
|
||||
- messagequeuetriggers
|
||||
- packages
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
{{- end }}
|
||||
{{- define "keda-rules" }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
|
||||
@@ -204,6 +204,54 @@ rules:
|
||||
- list
|
||||
- watch
|
||||
{{- end }}
|
||||
{{- define "kafka-kuberules" }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
- pods
|
||||
- secrets
|
||||
- services
|
||||
- replicationcontrollers
|
||||
- events
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- patch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
- secrets
|
||||
verbs:
|
||||
- get
|
||||
- apiGroups:
|
||||
- apps
|
||||
resources:
|
||||
- deployments
|
||||
- deployments/scale
|
||||
- replicasets
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- apiextensions.k8s.io
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- end }}
|
||||
{{- define "keda-kuberules" }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
@@ -306,6 +354,8 @@ rules:
|
||||
# TODO: Kept for future in case preupgrade needs any permissions in the future
|
||||
rules: []
|
||||
{{- 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" }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
|
||||
@@ -26,6 +26,9 @@ metadata:
|
||||
{{- if eq "kubewatcher" .component }}
|
||||
{{- include "kubewatcher-kuberules" . }}
|
||||
{{- end }}
|
||||
{{- if eq "kafka" .component }}
|
||||
{{- include "kafka-kuberules" . }}
|
||||
{{- end }}
|
||||
{{- if eq "keda" .component }}
|
||||
{{- include "keda-kuberules" . }}
|
||||
{{- end }}
|
||||
|
||||
@@ -20,6 +20,9 @@ metadata:
|
||||
{{- if eq "kubewatcher" .component }}
|
||||
{{- include "kubewatcher-rules" . }}
|
||||
{{- end }}
|
||||
{{- if eq "kafka" .component }}
|
||||
{{- include "kafka-rules" . }}
|
||||
{{- end }}
|
||||
{{- if eq "keda" .component }}
|
||||
{{- include "keda-rules" . }}
|
||||
{{- end }}
|
||||
|
||||
@@ -51,6 +51,8 @@ spec:
|
||||
value: {{ .Values.fetcher.resource.mem.limits | quote }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: DISABLE_OWNER_REFERENCES
|
||||
value: {{ .Values.disableOwnerReference | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
- name: HELM_RELEASE_NAME
|
||||
|
||||
@@ -76,6 +76,8 @@ spec:
|
||||
value: {{ .Values.executor.serviceAccountCheck.enabled | quote }}
|
||||
- name: SERVICEACCOUNT_CHECK_INTERVAL
|
||||
value: {{ .Values.executor.serviceAccountCheck.interval | quote }}
|
||||
- name: DISABLE_OWNER_REFERENCES
|
||||
value: {{ .Values.disableOwnerReference | quote }}
|
||||
{{- end}}
|
||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||
{{- include "kube_client.envs" . | indent 8 }}
|
||||
|
||||
@@ -118,6 +118,7 @@ spec:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
{{- include "fission-resource-namespace.envs" . | indent 12 }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--logger"]
|
||||
volumeMounts:
|
||||
@@ -127,10 +128,8 @@ spec:
|
||||
- name: docker-log
|
||||
mountPath: /var/lib/docker/containers
|
||||
readOnly: true
|
||||
{{- if .Values.logger.enableSecurityContext }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
{{- end }}
|
||||
{{- toYaml .Values.logger.securityContext | nindent 12 }}
|
||||
- name: fluentbit
|
||||
{{- if .Values.repository }}
|
||||
image: "{{ .Values.logger.fluentdImageRepository }}/{{ .Values.logger.fluentdImage }}:{{ .Values.logger.fluentdImageTag }}"
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
{{- if .Values.kafka.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mqtrigger-kafka
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
svc: mqtrigger
|
||||
messagequeue: kafka
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
svc: mqtrigger
|
||||
messagequeue: kafka
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
svc: mqtrigger
|
||||
messagequeue: kafka
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/path: "/metrics"
|
||||
prometheus.io/port: "8080"
|
||||
spec:
|
||||
containers:
|
||||
- name: mqtrigger
|
||||
image: {{ include "fission-bundleImage" . | quote }}
|
||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||
command: ["/fission-bundle"]
|
||||
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: metrics
|
||||
env:
|
||||
- name: MESSAGE_QUEUE_TYPE
|
||||
value: kafka
|
||||
- name: MESSAGE_QUEUE_URL
|
||||
value: "{{.Values.kafka.brokers}}"
|
||||
- name: MESSAGE_QUEUE_KAFKA_VERSION
|
||||
value: "{{.Values.kafka.version}}"
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
value: {{ .Values.pprof.enabled | quote }}
|
||||
{{- include "fission-resource-namespace.envs" . | indent 8 }}
|
||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||
# TLS authentication is TLS with authentication (2 way)
|
||||
# More info: https://docs.confluent.io/current/kafka/authentication_ssl.html#ssl-overview
|
||||
{{- if .Values.kafka.authentication.tls.enabled }}
|
||||
- name: TLS_ENABLED
|
||||
value: "true"
|
||||
- name: MESSAGE_QUEUE_SECRETS
|
||||
value: /etc/fission/secrets
|
||||
- name: INSECURE_SKIP_VERIFY
|
||||
value: "{{ .Values.kafka.authentication.tls.insecureSkipVerify }}"
|
||||
volumeMounts:
|
||||
- name: kafka-secrets
|
||||
mountPath: /etc/fission/secrets
|
||||
{{- end }}
|
||||
{{- if .Values.terminationMessagePath }}
|
||||
terminationMessagePath: {{ .Values.terminationMessagePath }}
|
||||
{{- end }}
|
||||
{{- if .Values.terminationMessagePolicy }}
|
||||
terminationMessagePolicy: {{ .Values.terminationMessagePolicy }}
|
||||
{{- end }}
|
||||
serviceAccountName: fission-kafka
|
||||
{{- if .Values.kafka.authentication.tls.enabled }}
|
||||
volumes:
|
||||
- name: kafka-secrets
|
||||
secret:
|
||||
secretName: mqtrigger-kafka-secrets
|
||||
{{- end }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
---
|
||||
{{- if .Values.kafka.authentication.tls.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mqtrigger-kafka-secrets
|
||||
labels:
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
data:
|
||||
{{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.caCert) }}
|
||||
caCert: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.caCert) | b64enc }}
|
||||
{{- else }}
|
||||
{{ fail "Invalid chart. CA Certificate not found." }}
|
||||
{{- end }}
|
||||
{{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.userCert) }}
|
||||
userCert: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.userCert) | b64enc }}
|
||||
{{- else }}
|
||||
{{ fail "Invalid chart. User Certificate not found." }}
|
||||
{{- end }}
|
||||
{{- if .Files.Get (printf "%s" .Values.kafka.authentication.tls.userKey) }}
|
||||
userKey: {{ .Files.Get (printf "%s" .Values.kafka.authentication.tls.userKey) | b64enc }}
|
||||
{{- else }}
|
||||
{{ fail "Invalid chart. User Key not found." }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraCoreComponentPodConfig }}
|
||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,23 @@
|
||||
{{- if .Values.podMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PodMonitor
|
||||
metadata:
|
||||
name: mqt-fission-kafka-monitor
|
||||
{{- if .Values.podMonitor.namespace }}
|
||||
namespace: {{ .Values.podMonitor.namespace }}
|
||||
{{- end }}
|
||||
{{- with .Values.podMonitor.additionalPodMonitorLabels }}
|
||||
labels:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
svc: mqtrigger
|
||||
podMetricsEndpoints:
|
||||
- port: "metrics"
|
||||
path: "/metrics"
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,7 @@
|
||||
{{- include "fission-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "kafka") .) }}
|
||||
|
||||
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
||||
{{- range $namespace := $.Values.additionalFissionNamespaces }}
|
||||
{{ include "fission-role-generator" (merge (dict "namespace" $namespace "component" "kafka") $) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,7 @@
|
||||
{{- include "kubernetes-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "kafka") .) }}
|
||||
|
||||
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
||||
{{- range $namespace := $.Values.additionalFissionNamespaces }}
|
||||
{{ include "kubernetes-role-generator" (merge (dict "namespace" $namespace "component" "kafka") $) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: fission-kafka
|
||||
namespace: {{ .Release.Namespace }}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- include "kubernetes-role-generator" (merge (dict "namespace" .Values.defaultNamespace "component" "router") .) }}
|
||||
{{- include "kubernetes-role-generator" (merge (dict "namespace" .Release.Namespace "component" "router") .) }}
|
||||
|
||||
{{- if gt (len .Values.additionalFissionNamespaces) 0 }}
|
||||
{{- range $namespace := $.Values.additionalFissionNamespaces }}
|
||||
|
||||
@@ -38,6 +38,8 @@ spec:
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: metrics
|
||||
resources:
|
||||
{{- toYaml .Values.webhook.resources | nindent 10 }}
|
||||
volumes:
|
||||
- name: serving-certs
|
||||
secret:
|
||||
|
||||
@@ -16,7 +16,7 @@ apiVersion: admissionregistration.k8s.io/v1
|
||||
kind: MutatingWebhookConfiguration
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
name: mutating-webhook-configuration
|
||||
name: fission-mutating-webhooks
|
||||
{{- if $certManagerEnabled }}
|
||||
annotations:
|
||||
cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/fission-webhook-cert"
|
||||
@@ -49,7 +49,7 @@ apiVersion: admissionregistration.k8s.io/v1
|
||||
kind: ValidatingWebhookConfiguration
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
name: validating-webhook-configuration
|
||||
name: fission-validating-webhooks
|
||||
{{- if $certManagerEnabled }}
|
||||
annotations:
|
||||
cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/fission-webhook-cert"
|
||||
|
||||
@@ -25,7 +25,7 @@ image: fission/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.
|
||||
##
|
||||
imageTag: v1.20.0
|
||||
imageTag: v1.21.0-rc1
|
||||
|
||||
## pullPolicy represents the pull policy to use for images in the chart.
|
||||
##
|
||||
@@ -67,12 +67,16 @@ defaultNamespace: default
|
||||
## 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.
|
||||
##
|
||||
## Note: This parameter is deprecated and will be removed in future fission releases.
|
||||
##
|
||||
builderNamespace: ""
|
||||
|
||||
## 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.
|
||||
## This is different from the release namespace.
|
||||
##
|
||||
## Note: This parameter is deprecated and will be removed in future fission releases.
|
||||
##
|
||||
functionNamespace: ""
|
||||
|
||||
## Fission will watch the following namespaces along with the `defaultNamespace` for fission custom resources.
|
||||
@@ -88,6 +92,16 @@ additionalFissionNamespaces: []
|
||||
##
|
||||
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: false
|
||||
@@ -106,7 +120,7 @@ fetcher:
|
||||
## image represents the image of the fetcher component.
|
||||
image: fission/fetcher
|
||||
## imageTag represents the tag of the image of the fetcher component.
|
||||
imageTag: v1.20.0
|
||||
imageTag: v1.21.0-rc1
|
||||
|
||||
## Fetcher is only for to downloading or uploading archive.
|
||||
## Normally, you don't need to change the value here, unless necessary.
|
||||
@@ -466,6 +480,48 @@ timer:
|
||||
runAsUser: 10001
|
||||
runAsGroup: 10001
|
||||
|
||||
## Kafka: enable and configure the details
|
||||
##
|
||||
kafka:
|
||||
enabled: false
|
||||
## note: below link is only for reference.
|
||||
## Please use the brokers link for your kafka here.
|
||||
##
|
||||
brokers: "broker.kafka:9092" # or your-bootstrap-server.kafka:9092/9093
|
||||
## Sample config for authentication
|
||||
## authentication:
|
||||
## tls:
|
||||
## enabled: true
|
||||
## caCert: 'auth/kafka/ca.crt'
|
||||
## userCert: 'auth/kafka/user.crt'
|
||||
## userKey: 'auth/kafka/user.key'
|
||||
##
|
||||
authentication:
|
||||
tls:
|
||||
enabled: false
|
||||
## InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
|
||||
## Warning: Setting this to true, makes TLS susceptible to man-in-the-middle attacks
|
||||
##
|
||||
insecureSkipVerify: false
|
||||
## path to certificate containing public key of CA authority
|
||||
##
|
||||
caCert: ""
|
||||
## path to certificate containing public key of the user signed by CA authority
|
||||
##
|
||||
userCert: ""
|
||||
## path to private key of the user
|
||||
##
|
||||
userKey: ""
|
||||
|
||||
## version of Kafka broker
|
||||
## For 0.x it must be a string in the format
|
||||
## "major.minor.veryMinor.patch" example: 0.8.2.0
|
||||
## For 1.x it must be a string in the format
|
||||
## "major.major.veryMinor" example: 2.0.1
|
||||
## Should be >= 0.11.2.0 to enable Kafka record headers support
|
||||
##
|
||||
# version: "0.11.2.0"
|
||||
|
||||
# The following components expose Prometheus metrics and have servicemonitors in this chart (disabled by default)
|
||||
# router, executor, storage svc
|
||||
serviceMonitor:
|
||||
@@ -578,11 +634,22 @@ logger:
|
||||
|
||||
## 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-
|
||||
## 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
|
||||
## 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
|
||||
## Only required in some clusters and when enableSecurityContext is true
|
||||
@@ -621,7 +688,7 @@ preUpgradeChecks:
|
||||
image: fission/pre-upgrade-checks
|
||||
## pre-install/pre-upgrade checks image version
|
||||
##
|
||||
imageTag: v1.20.0
|
||||
imageTag: v1.21.0-rc1
|
||||
|
||||
## Fission post-install/post-upgrade reporting live in this image
|
||||
##
|
||||
@@ -753,28 +820,28 @@ mqt_keda:
|
||||
connector_images:
|
||||
kafka:
|
||||
image: ghcr.io/fission/keda-kafka-http-connector
|
||||
tag: v0.13
|
||||
tag: v0.17
|
||||
rabbitmq:
|
||||
image: ghcr.io/fission/keda-rabbitmq-http-connector
|
||||
tag: v0.11
|
||||
tag: v0.15
|
||||
awskinesis:
|
||||
image: ghcr.io/fission/keda-aws-kinesis-http-connector
|
||||
tag: v0.11
|
||||
tag: v0.15
|
||||
aws_sqs:
|
||||
image: ghcr.io/fission/keda-aws-sqs-http-connector
|
||||
tag: v0.12
|
||||
tag: v0.16
|
||||
nats_steaming:
|
||||
image: ghcr.io/fission/keda-nats-streaming-http-connector
|
||||
tag: v0.14
|
||||
tag: v0.18
|
||||
nats_jetstream:
|
||||
image: ghcr.io/fission/keda-nats-jetstream-http-connector
|
||||
tag: v0.5
|
||||
tag: v0.9
|
||||
gcp_pubsub:
|
||||
image: ghcr.io/fission/keda-gcp-pubsub-http-connector
|
||||
tag: v0.7
|
||||
tag: v0.11
|
||||
redis:
|
||||
image: ghcr.io/fission/keda-redis-http-connector
|
||||
tag: v0.4
|
||||
tag: v0.8
|
||||
|
||||
## Pod resources as:
|
||||
## resources:
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM cgr.dev/chainguard/static:latest
|
||||
FROM cgr.dev/chainguard/static:latest@sha256:f96b5a60658dfee0cae426972afecad6ea6930fa28e6d8ef7096a7bdf35d6498
|
||||
COPY builder /builder
|
||||
ENTRYPOINT ["/builder"]
|
||||
|
||||
@@ -32,6 +32,7 @@ func Run(ctx context.Context, logger *zap.Logger, mgr manager.Interface, shareVo
|
||||
builder := builder.MakeBuilder(logger, shareVolume)
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/", builder.Handler)
|
||||
mux.HandleFunc("/clean", builder.Clean)
|
||||
mux.HandleFunc("/version", builder.VersionHandler)
|
||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM cgr.dev/chainguard/static:latest
|
||||
FROM cgr.dev/chainguard/static:latest@sha256:f96b5a60658dfee0cae426972afecad6ea6930fa28e6d8ef7096a7bdf35d6498
|
||||
COPY fetcher /
|
||||
ENTRYPOINT ["/fetcher"]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM cgr.dev/chainguard/static:latest
|
||||
FROM cgr.dev/chainguard/static:latest@sha256:f96b5a60658dfee0cae426972afecad6ea6930fa28e6d8ef7096a7bdf35d6498
|
||||
COPY fission-bundle /
|
||||
ENTRYPOINT ["/fission-bundle"]
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
"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/pkg/buildermgr"
|
||||
"github.com/fission/fission/pkg/canaryconfigmgr"
|
||||
"github.com/fission/fission/pkg/crd"
|
||||
@@ -74,6 +75,10 @@ func runTimer(ctx context.Context, clientGen crd.ClientGeneratorInterface, logge
|
||||
return timer.Start(ctx, clientGen, logger, mgr, routerUrl)
|
||||
}
|
||||
|
||||
func runMessageQueueMgr(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, routerUrl string) error {
|
||||
return mqtrigger.Start(ctx, clientGen, logger, mgr, routerUrl)
|
||||
}
|
||||
|
||||
// KEDA based MessageQueue Trigger Manager
|
||||
func runMQManager(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, routerURL string) error {
|
||||
return mqt.StartScalerManager(ctx, clientGen, logger, mgr, routerURL)
|
||||
@@ -119,6 +124,8 @@ func getServiceName(arguments map[string]interface{}) string {
|
||||
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 {
|
||||
@@ -154,7 +161,6 @@ func main() {
|
||||
|
||||
Use it to start one or more of the fission servers:
|
||||
|
||||
|
||||
Pool manager maintains a pool of generalized function containers, and
|
||||
specializes them on-demand. Executor must be run from a pod in a
|
||||
Kubernetes cluster.
|
||||
@@ -178,6 +184,7 @@ Usage:
|
||||
fission-bundle --storageServicePort=<port> --storageType=<storateType>
|
||||
fission-bundle --builderMgr [--storageSvcUrl=<url>] [--envbuilder-namespace=<namespace>]
|
||||
fission-bundle --timer [--routerUrl=<url>]
|
||||
fission-bundle --mqt [--routerUrl=<url>]
|
||||
fission-bundle --mqt_keda [--routerUrl=<url>]
|
||||
fission-bundle --webhookPort=<port>
|
||||
fission-bundle --logger
|
||||
@@ -196,6 +203,7 @@ Options:
|
||||
--namespace=<namespace> Kubernetes namespace in which to run function containers. Defaults to 'fission-function'.
|
||||
--kubewatcher Start Kubernetes events watcher.
|
||||
--timer Start Timer.
|
||||
--mqt Start message queue trigger.
|
||||
--mqt_keda Start message queue trigger of kind KEDA
|
||||
--builderMgr Start builder manager.
|
||||
--version Print version information
|
||||
@@ -276,6 +284,14 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
if arguments["--mqt"] == true {
|
||||
err = runMessageQueueMgr(ctx, clientGen, logger, mgr, routerUrl)
|
||||
if err != nil {
|
||||
logger.Error("message queue manager exited", zap.Error(err))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if arguments["--mqt_keda"] == true {
|
||||
err = runMQManager(ctx, clientGen, logger, mgr, routerUrl)
|
||||
if err != nil {
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
package mqtrigger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"go.uber.org/zap"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"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/factory"
|
||||
"github.com/fission/fission/pkg/mqtrigger/messageQueue"
|
||||
_ "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, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, routerUrl string) error {
|
||||
fissionClient, err := clientGen.GetFissionClient()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to get fission client")
|
||||
}
|
||||
|
||||
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error waiting for CRDs")
|
||||
}
|
||||
|
||||
mqType := (fv1.MessageQueueType)(os.Getenv("MESSAGE_QUEUE_TYPE"))
|
||||
mqUrl := os.Getenv("MESSAGE_QUEUE_URL")
|
||||
|
||||
secretsPath := strings.TrimSpace(os.Getenv("MESSAGE_QUEUE_SECRETS"))
|
||||
|
||||
var secrets map[string][]byte
|
||||
if len(secretsPath) > 0 {
|
||||
// For authentication with message queue
|
||||
secrets, err = readSecrets(logger, secretsPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
mq, err := factory.Create(
|
||||
logger,
|
||||
mqType,
|
||||
messageQueue.Config{
|
||||
MQType: (string)(mqType),
|
||||
Url: mqUrl,
|
||||
Secrets: secrets,
|
||||
},
|
||||
routerUrl,
|
||||
)
|
||||
if err != nil {
|
||||
logger.Fatal("failed to connect to remote message queue server", zap.Error(err))
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
func readSecrets(logger *zap.Logger, secretsPath string) (map[string][]byte, error) {
|
||||
// return if no secrets exist
|
||||
if _, err := os.Stat(secretsPath); os.IsNotExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
secretFiles, err := os.ReadDir(secretsPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
secrets := make(map[string][]byte)
|
||||
for _, secretFile := range secretFiles {
|
||||
|
||||
fileName := secretFile.Name()
|
||||
// /etc/secrets contain some hidden directories (like .data)
|
||||
// ignore them
|
||||
if !secretFile.IsDir() && !strings.HasPrefix(fileName, ".") {
|
||||
logger.Info(fmt.Sprintf("Reading secret from %s", fileName))
|
||||
|
||||
filePath := path.Join(secretsPath, fileName)
|
||||
secret, fileReadErr := os.ReadFile(filePath)
|
||||
if fileReadErr != nil {
|
||||
return nil, fileReadErr
|
||||
}
|
||||
|
||||
secrets[fileName] = secret
|
||||
}
|
||||
}
|
||||
|
||||
return secrets, nil
|
||||
}
|
||||
@@ -38,6 +38,7 @@ import (
|
||||
"github.com/fission/fission/pkg/fission-cli/console"
|
||||
"github.com/fission/fission/pkg/fission-cli/flag"
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
_ "github.com/fission/fission/pkg/mqtrigger/messageQueue/kafka"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM cgr.dev/chainguard/static:latest
|
||||
FROM cgr.dev/chainguard/static:latest@sha256:f96b5a60658dfee0cae426972afecad6ea6930fa28e6d8ef7096a7bdf35d6498
|
||||
COPY pre-upgrade-checks /
|
||||
ENTRYPOINT ["/pre-upgrade-checks"]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM cgr.dev/chainguard/static:latest
|
||||
FROM cgr.dev/chainguard/static:latest@sha256:f96b5a60658dfee0cae426972afecad6ea6930fa28e6d8ef7096a7bdf35d6498
|
||||
COPY reporter /
|
||||
ENTRYPOINT ["/reporter"]
|
||||
|
||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
controller-gen.kubebuilder.io/version: v0.17.0
|
||||
name: canaryconfigs.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
|
||||
+1887
-622
File diff suppressed because it is too large
Load Diff
+837
-281
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
controller-gen.kubebuilder.io/version: v0.17.0
|
||||
name: httptriggers.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
@@ -76,14 +76,11 @@ spec:
|
||||
type: object
|
||||
host:
|
||||
description: |-
|
||||
TODO: remove this field since we have IngressConfig already
|
||||
Deprecated: the original idea of this field is not for setting Ingress.
|
||||
Since we have IngressConfig now, remove Host after couple releases.
|
||||
type: string
|
||||
ingressconfig:
|
||||
description: |-
|
||||
TODO: make IngressConfig an independent Fission resource
|
||||
IngressConfig for router to set up Ingress.
|
||||
description: IngressConfig for router to set up Ingress.
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
|
||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
controller-gen.kubebuilder.io/version: v0.17.0
|
||||
name: kuberneteswatchtriggers.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
controller-gen.kubebuilder.io/version: v0.17.0
|
||||
name: packages.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
|
||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
controller-gen.kubebuilder.io/version: v0.17.0
|
||||
name: timetriggers.fission.io
|
||||
spec:
|
||||
group: fission.io
|
||||
@@ -73,6 +73,17 @@ spec:
|
||||
- name
|
||||
- type
|
||||
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:
|
||||
- cron
|
||||
- functionref
|
||||
|
||||
@@ -1,178 +1,203 @@
|
||||
module github.com/fission/fission
|
||||
|
||||
go 1.21
|
||||
go 1.23.4
|
||||
|
||||
require (
|
||||
dario.cat/mergo v1.0.0
|
||||
dario.cat/mergo v1.0.1
|
||||
github.com/IBM/sarama v1.45.0
|
||||
github.com/bep/debounce v1.2.1
|
||||
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/elastic/crd-ref-docs v0.0.10
|
||||
github.com/fatih/color v1.16.0
|
||||
github.com/fsnotify/fsnotify v1.7.0
|
||||
github.com/go-git/go-git/v5 v5.11.0
|
||||
github.com/elastic/crd-ref-docs v0.1.0
|
||||
github.com/fatih/color v1.18.0
|
||||
github.com/fsnotify/fsnotify v1.8.0
|
||||
github.com/go-git/go-git/v5 v5.13.1
|
||||
github.com/go-logr/zapr v1.3.0
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||
github.com/golang-jwt/jwt/v4 v4.5.1
|
||||
github.com/google/go-cmp v0.6.0
|
||||
github.com/google/uuid v1.5.0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/graymeta/stow v0.2.8
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/hashicorp/go-retryablehttp v0.7.5
|
||||
github.com/influxdata/influxdb v1.11.4
|
||||
github.com/mholt/archiver/v3 v3.5.1
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7
|
||||
github.com/influxdata/influxdb v1.11.8
|
||||
github.com/kedacore/keda/v2 v2.16.1
|
||||
github.com/mholt/archives v0.1.0
|
||||
github.com/minio/minio-go v6.0.14+incompatible
|
||||
github.com/ory/dockertest v3.3.5+incompatible
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/prometheus/client_golang v1.18.0
|
||||
github.com/prometheus/common v0.45.0
|
||||
github.com/prometheus/client_golang v1.20.5
|
||||
github.com/prometheus/common v0.61.0
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/spf13/cobra v1.8.1
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/wcharczuk/go-chart v2.0.1+incompatible
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
|
||||
go.opentelemetry.io/contrib/propagators/autoprop v0.46.1
|
||||
go.opentelemetry.io/otel v1.21.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
|
||||
go.opentelemetry.io/otel/sdk v1.21.0
|
||||
go.opentelemetry.io/otel/trace v1.21.0
|
||||
go.uber.org/zap v1.26.0
|
||||
golang.org/x/net v0.20.0
|
||||
google.golang.org/grpc v1.60.1
|
||||
k8s.io/api v0.29.0
|
||||
k8s.io/apiextensions-apiserver v0.29.0
|
||||
k8s.io/apimachinery v0.29.0
|
||||
k8s.io/client-go v0.29.0
|
||||
k8s.io/metrics v0.29.0
|
||||
sigs.k8s.io/controller-runtime v0.16.3
|
||||
sigs.k8s.io/controller-tools v0.14.0
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0
|
||||
go.opentelemetry.io/contrib/propagators/autoprop v0.58.0
|
||||
go.opentelemetry.io/otel v1.33.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0
|
||||
go.opentelemetry.io/otel/sdk v1.33.0
|
||||
go.opentelemetry.io/otel/trace v1.33.0
|
||||
go.uber.org/zap v1.27.0
|
||||
golang.org/x/net v0.34.0
|
||||
google.golang.org/grpc v1.69.2
|
||||
k8s.io/api v0.32.0
|
||||
k8s.io/apiextensions-apiserver v0.32.0
|
||||
k8s.io/apimachinery v0.32.0
|
||||
k8s.io/client-go v0.32.0
|
||||
k8s.io/code-generator v0.32.0
|
||||
k8s.io/metrics v0.32.0
|
||||
sigs.k8s.io/controller-runtime v0.19.4
|
||||
sigs.k8s.io/controller-tools v0.17.0
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.5.0
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/semver v1.5.0 // indirect
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
|
||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
|
||||
github.com/andybalholm/brotli v1.0.1 // indirect
|
||||
github.com/ProtonMail/go-crypto v1.1.3 // indirect
|
||||
github.com/STARRY-S/zip v0.2.1 // indirect
|
||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
||||
github.com/aws/aws-sdk-go v1.42.34 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/blend/go-sdk v1.20220112.5 // indirect
|
||||
github.com/bodgit/plumbing v1.3.0 // indirect
|
||||
github.com/bodgit/sevenzip v1.6.0 // indirect
|
||||
github.com/bodgit/windows v1.0.1 // indirect
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cloudflare/circl v1.3.7 // indirect
|
||||
github.com/containerd/continuity v0.2.2 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
github.com/docker/go-units v0.4.0 // indirect
|
||||
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.11.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/emicklei/go-restful/v3 v3.12.1 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
|
||||
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
|
||||
github.com/expr-lang/expr v1.16.9 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.6.1 // indirect
|
||||
github.com/go-ini/ini v1.66.4 // indirect
|
||||
github.com/go-logr/logr v1.3.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.22.3 // indirect
|
||||
github.com/gobuffalo/flect v1.0.2 // indirect
|
||||
github.com/goccy/go-yaml v1.11.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/gobuffalo/flect v1.0.3 // indirect
|
||||
github.com/goccy/go-yaml v1.11.3 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/gnostic-models v0.6.8 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.1 // indirect
|
||||
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||
github.com/huandu/xstrings v1.3.3 // indirect
|
||||
github.com/imdario/mergo v0.3.11 // 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/jcmturner/aescts/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/gokrb5/v8 v8.4.4 // indirect
|
||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/klauspost/compress v1.16.7 // indirect
|
||||
github.com/klauspost/pgzip v1.2.5 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/klauspost/pgzip v1.2.6 // indirect
|
||||
github.com/lib/pq v1.10.4 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/moby/spdystream v0.2.0 // indirect
|
||||
github.com/moby/spdystream v0.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/nwaples/rardecode v1.1.0 // indirect
|
||||
github.com/nwaples/rardecode/v2 v2.0.0-beta.4.0.20241112120701-034e449c6e78 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.0.2 // indirect
|
||||
github.com/opencontainers/runc v1.1.5 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.18 // indirect
|
||||
github.com/opencontainers/runc v1.1.14 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_model v0.5.0 // indirect
|
||||
github.com/prometheus/procfs v0.12.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/sergi/go-diff v1.1.0 // indirect
|
||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||
github.com/skeema/knownhosts v1.2.1 // indirect
|
||||
github.com/ulikunitz/xz v0.5.9 // indirect
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/skeema/knownhosts v1.3.0 // indirect
|
||||
github.com/sorairolake/lzip-go v0.3.5 // indirect
|
||||
github.com/therootcompany/xz v1.0.1 // indirect
|
||||
github.com/ulikunitz/xz v0.5.12 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/aws v1.21.1 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/b3 v1.21.1 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.21.1 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/ot v1.21.1 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.21.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/aws v1.33.0 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/b3 v1.33.0 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.33.0 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/ot v1.33.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.33.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/crypto v0.18.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
|
||||
golang.org/x/image v0.10.0 // indirect
|
||||
golang.org/x/mod v0.14.0 // indirect
|
||||
golang.org/x/oauth2 v0.13.0 // indirect
|
||||
golang.org/x/sys v0.16.0 // indirect
|
||||
golang.org/x/term v0.16.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
golang.org/x/tools v0.16.1 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
|
||||
golang.org/x/crypto v0.32.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
|
||||
golang.org/x/image v0.18.0 // indirect
|
||||
golang.org/x/mod v0.22.0 // indirect
|
||||
golang.org/x/oauth2 v0.24.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/sys v0.29.0 // indirect
|
||||
golang.org/x/term v0.28.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/time v0.8.0 // indirect
|
||||
golang.org/x/tools v0.28.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
|
||||
google.golang.org/appengine v1.6.8 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
|
||||
google.golang.org/protobuf v1.31.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
|
||||
google.golang.org/protobuf v1.36.0 // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
gotest.tools v2.2.0+incompatible // indirect
|
||||
k8s.io/component-base v0.29.0 // indirect
|
||||
k8s.io/klog/v2 v2.110.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
|
||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
|
||||
knative.dev/pkg v0.0.0-20241218051509-40afb7c5436e // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
|
||||
)
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ set +x
|
||||
echo "" > coverage.txt
|
||||
|
||||
make install-envtest
|
||||
KUBEBUILDER_ASSETS=$(setup-envtest -p path use 1.23.x)
|
||||
KUBEBUILDER_ASSETS=$(setup-envtest -p path use 1.30.x)
|
||||
export KUBEBUILDER_ASSETS
|
||||
|
||||
# The executor unit test only works with NodePort-type services for
|
||||
|
||||
+22
-12
@@ -3,17 +3,27 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
if [ ! -d "../code-generator" ]; then
|
||||
echo "Please get code-generator from fission org"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GOPATH=$(go env GOPATH)
|
||||
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}"
|
||||
ls -d -1 ${SCRIPT_ROOT}/../code-generator 2>/dev/null || echo $GOPATH/pkg/mod/k8s.io/code-generator@v0.32.0
|
||||
)}
|
||||
OUTDIR="${SCRIPT_ROOT}/pkg/generated"
|
||||
|
||||
bash "${CODEGEN_PKG}"/generate-groups.sh "client,informer,lister" \
|
||||
github.com/fission/fission/pkg/generated \
|
||||
github.com/fission/fission/pkg/apis \
|
||||
"core:v1" \
|
||||
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../../.." \
|
||||
--go-header-file "$(dirname "${BASH_SOURCE[0]}")/boilerplate.txt"
|
||||
echo "Generating code under ${OUTDIR} using ${CODEGEN_PKG} ..."
|
||||
|
||||
source "${CODEGEN_PKG}/kube_codegen.sh"
|
||||
|
||||
# kube::codegen::gen_helpers \
|
||||
# --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" \
|
||||
|
||||
@@ -80,6 +80,10 @@ const (
|
||||
PodInfoMount = "/etc/podinfo"
|
||||
)
|
||||
|
||||
const (
|
||||
MessageQueueTypeKafka = "kafka"
|
||||
)
|
||||
|
||||
const (
|
||||
// FunctionReferenceFunctionName means that the function
|
||||
// reference is simply by function name.
|
||||
@@ -163,3 +167,7 @@ const (
|
||||
ConfigMaps = "configmaps"
|
||||
Secrets = "secrets"
|
||||
)
|
||||
|
||||
const (
|
||||
BuilderContainerName = "builder"
|
||||
)
|
||||
|
||||
@@ -751,7 +751,7 @@ type (
|
||||
// +optional
|
||||
FunctionReference FunctionReference `json:"functionref"`
|
||||
|
||||
// Type of message queue
|
||||
// Type of message queue (NATS, Kafka, AzureQueue)
|
||||
// +optional
|
||||
MessageQueueType MessageQueueType `json:"messageQueueType"`
|
||||
|
||||
@@ -821,6 +821,17 @@ type (
|
||||
|
||||
// The reference to function
|
||||
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 string
|
||||
|
||||
@@ -523,11 +523,11 @@ func (spec MessageQueueTriggerSpec) Validate() error {
|
||||
if !validator.IsValidMessageQueue((string)(spec.MessageQueueType), spec.MqtKind) {
|
||||
result = multierror.Append(result, MakeValidationErr(ErrorUnsupportedType, "MessageQueueTriggerSpec.MessageQueueType", spec.MessageQueueType, "not a supported message queue type"))
|
||||
} else {
|
||||
if !validator.IsValidTopic(spec.MqtKind) {
|
||||
if !validator.IsValidTopic((string)(spec.MessageQueueType), spec.Topic, spec.MqtKind) {
|
||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "MessageQueueTriggerSpec.Topic", spec.Topic, "not a valid topic"))
|
||||
}
|
||||
|
||||
if len(spec.ResponseTopic) > 0 && !validator.IsValidTopic(spec.MqtKind) {
|
||||
if len(spec.ResponseTopic) > 0 && !validator.IsValidTopic((string)(spec.MessageQueueType), spec.ResponseTopic, spec.MqtKind) {
|
||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "MessageQueueTriggerSpec.ResponseTopic", spec.ResponseTopic, "not a valid topic"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -312,7 +312,7 @@ func (MessageQueueTriggerList) SwaggerDoc() map[string]string {
|
||||
var map_MessageQueueTriggerSpec = map[string]string{
|
||||
"": "MessageQueueTriggerSpec defines a binding from a topic in a message queue to a function.",
|
||||
"functionref": "The reference to a function for message queue trigger to invoke with when receiving messages from subscribed topic.",
|
||||
"messageQueueType": "Type of message queue",
|
||||
"messageQueueType": "Type of message queue (NATS, Kafka, AzureQueue)",
|
||||
"topic": "Subscribed topic",
|
||||
"respTopic": "Topic for message queue trigger to sent response from function.",
|
||||
"errorTopic": "Topic to collect error response sent from function",
|
||||
@@ -428,6 +428,8 @@ var map_TimeTriggerSpec = map[string]string{
|
||||
"": "TimeTriggerSpec invokes the specific function at a time or times specified by a cron string.",
|
||||
"cron": "Cron schedule",
|
||||
"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 {
|
||||
|
||||
+45
-2
@@ -35,6 +35,7 @@ import (
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/fission/fission/pkg/info"
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
||||
)
|
||||
|
||||
@@ -121,9 +122,19 @@ func (builder *Builder) Handler(w http.ResponseWriter, r *http.Request) {
|
||||
logger.Info("builder received request", zap.Any("request", req))
|
||||
|
||||
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)))
|
||||
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
|
||||
buildCmd := req.BuildCommand
|
||||
@@ -154,6 +165,38 @@ func (builder *Builder) Handler(w http.ResponseWriter, r *http.Request) {
|
||||
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) {
|
||||
logger := otelUtils.LoggerWithTraceID(ctx, builder.logger)
|
||||
resp := PackageBuildResponse{
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/go-retryablehttp"
|
||||
@@ -37,6 +38,7 @@ import (
|
||||
type (
|
||||
ClientInterface interface {
|
||||
Build(context.Context, *builder.PackageBuildRequest) (*builder.PackageBuildResponse, error)
|
||||
Clean(context.Context, string) error
|
||||
}
|
||||
|
||||
client struct {
|
||||
@@ -57,6 +59,10 @@ func MakeClient(logger *zap.Logger, builderUrl string) ClientInterface {
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
@@ -86,3 +92,29 @@ func (c *client) Build(ctx context.Context, req *builder.PackageBuildRequest) (*
|
||||
|
||||
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 errors.Wrap(err, "failed to create http request for clean api")
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -60,6 +60,15 @@ func buildPackage(ctx context.Context, logger *zap.Logger, fissionClient version
|
||||
fetcherC := fetcherClient.MakeClient(logger, fmt.Sprintf("http://%v:8000", svcName))
|
||||
builderC := builderClient.MakeClient(logger, fmt.Sprintf("http://%v: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{
|
||||
FetchType: fv1.FETCH_SOURCE,
|
||||
Package: pkg.ObjectMeta,
|
||||
@@ -121,6 +130,15 @@ func buildPackage(ctx context.Context, logger *zap.Logger, fissionClient version
|
||||
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,
|
||||
pkg *fv1.Package, status fv1.BuildStatus, buildLogs string,
|
||||
uploadResp *fetcher.ArchiveUploadResponse) (*fv1.Package, error) {
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
@@ -73,6 +74,7 @@ type (
|
||||
useIstio bool
|
||||
podSpecPatch *apiv1.PodSpec
|
||||
envWatchInformer map[string]k8sCache.SharedIndexInformer
|
||||
enableOwnerReferences bool
|
||||
}
|
||||
)
|
||||
|
||||
@@ -107,6 +109,7 @@ func makeEnvironmentWatcher(
|
||||
fetcherConfig: fetcherConfig,
|
||||
podSpecPatch: podSpecPatch,
|
||||
envWatchInformer: utils.GetInformersForNamespaces(fissionClient, time.Minute*30, fv1.EnvironmentResource),
|
||||
enableOwnerReferences: utils.IsOwnerReferencesEnabled(),
|
||||
}
|
||||
|
||||
err := envWatcher.EnvWatchEventHandlers(ctx)
|
||||
@@ -324,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) {
|
||||
name := fmt.Sprintf("%v-%v", env.ObjectMeta.Name, 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{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: ns,
|
||||
Name: name,
|
||||
Labels: sel,
|
||||
Namespace: ns,
|
||||
Name: name,
|
||||
Labels: sel,
|
||||
OwnerReferences: ownerReferences,
|
||||
},
|
||||
Spec: apiv1.ServiceSpec{
|
||||
Selector: sel,
|
||||
@@ -389,7 +403,7 @@ func (envw *environmentWatcher) createBuilderDeployment(ctx context.Context, env
|
||||
}
|
||||
|
||||
container, err := util.MergeContainer(&apiv1.Container{
|
||||
Name: "builder",
|
||||
Name: fv1.BuilderContainerName,
|
||||
Image: env.Spec.Builder.Image,
|
||||
ImagePullPolicy: envw.builderImagePullPolicy,
|
||||
TerminationMessagePath: "/dev/termination-log",
|
||||
@@ -435,11 +449,23 @@ func (envw *environmentWatcher) createBuilderDeployment(ctx context.Context, env
|
||||
|
||||
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{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: ns,
|
||||
Name: name,
|
||||
Labels: sel,
|
||||
Namespace: ns,
|
||||
Name: name,
|
||||
Labels: sel,
|
||||
OwnerReferences: ownerReferences,
|
||||
},
|
||||
Spec: appsv1.DeploymentSpec{
|
||||
Replicas: &replicas,
|
||||
|
||||
@@ -63,7 +63,7 @@ func (promApiClient *PrometheusApiClient) GetFunctionFailurePercentage(ctx conte
|
||||
}
|
||||
|
||||
if reqs <= 0 {
|
||||
return -1, fmt.Errorf("no requests to this url %v and method %v in the window: %v", path, methods, window)
|
||||
return -1, fmt.Errorf("no requests to this url %s and method %v in the window: %s", path, methods, window)
|
||||
}
|
||||
|
||||
// next, get a total count of errored out requests to this function in the same window
|
||||
|
||||
+4
-4
@@ -24,7 +24,6 @@ import (
|
||||
"go.uber.org/zap"
|
||||
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
||||
"k8s.io/client-go/rest"
|
||||
@@ -33,6 +32,7 @@ import (
|
||||
|
||||
"github.com/fission/fission/pkg/generated/clientset/versioned"
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
kedaClient "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -47,7 +47,7 @@ type (
|
||||
GetKubernetesClient() (kubernetes.Interface, error)
|
||||
GetApiExtensionsClient() (apiextensionsclient.Interface, error)
|
||||
GetMetricsClient() (metricsclient.Interface, error)
|
||||
GetDynamicClient() (dynamic.Interface, error)
|
||||
GetKedaClient() (kedaClient.Interface, error)
|
||||
}
|
||||
|
||||
ClientGenerator struct {
|
||||
@@ -118,12 +118,12 @@ func (cg *ClientGenerator) GetMetricsClient() (metricsclient.Interface, error) {
|
||||
return metricsclient.NewForConfig(config)
|
||||
}
|
||||
|
||||
func (cg *ClientGenerator) GetDynamicClient() (dynamic.Interface, error) {
|
||||
func (cg *ClientGenerator) GetKedaClient() (kedaClient.Interface, error) {
|
||||
config, err := cg.getRestConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dynamic.NewForConfig(config)
|
||||
return kedaClient.NewForConfig(config)
|
||||
}
|
||||
|
||||
func NewClientGenerator() *ClientGenerator {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ func (ck CacheKeyURG) String() string {
|
||||
return fmt.Sprintf("%v_%v_%v", ck.UID, ck.ResourceVersion, ck.Generation)
|
||||
}
|
||||
|
||||
// CacheKeyForUID create a key that uniquely identifies the
|
||||
// CacheKeyUIDFromMeta create a key that uniquely identifies the
|
||||
// of the object. Since resourceVersion changes on every update and
|
||||
// UIDs are unique, we don't use resource version here
|
||||
func CacheKeyUIDFromMeta(metadata *metav1.ObjectMeta) types.UID {
|
||||
|
||||
@@ -58,13 +58,18 @@ func ConfigMapEventHandlers(ctx context.Context, logger *zap.Logger, fissionClie
|
||||
oldCm := oldObj.(*apiv1.ConfigMap)
|
||||
newCm := newObj.(*apiv1.ConfigMap)
|
||||
if oldCm.ObjectMeta.ResourceVersion != newCm.ObjectMeta.ResourceVersion {
|
||||
logger.Debug("Configmap changed",
|
||||
zap.String("configmap_name", newCm.ObjectMeta.Name),
|
||||
zap.String("configmap_namespace", newCm.ObjectMeta.Namespace))
|
||||
funcs, err := getConfigmapRelatedFuncs(ctx, logger, &newCm.ObjectMeta, fissionClient)
|
||||
if err != nil {
|
||||
logger.Error("Failed to get functions related to configmap", zap.String("configmap_name", newCm.ObjectMeta.Name), zap.String("configmap_namespace", newCm.ObjectMeta.Namespace))
|
||||
}
|
||||
|
||||
if len(funcs) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Debug("Configmap changed",
|
||||
zap.String("configmap_name", newCm.ObjectMeta.Name),
|
||||
zap.String("configmap_namespace", newCm.ObjectMeta.Namespace))
|
||||
refreshPods(ctx, logger, funcs, types)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -57,13 +57,18 @@ func SecretEventHandlers(ctx context.Context, logger *zap.Logger, fissionClient
|
||||
oldS := oldObj.(*apiv1.Secret)
|
||||
newS := newObj.(*apiv1.Secret)
|
||||
if oldS.ObjectMeta.ResourceVersion != newS.ObjectMeta.ResourceVersion {
|
||||
logger.Debug("Secret changed",
|
||||
zap.String("configmap_name", newS.ObjectMeta.Name),
|
||||
zap.String("configmap_namespace", newS.ObjectMeta.Namespace))
|
||||
funcs, err := getSecretRelatedFuncs(ctx, logger, &newS.ObjectMeta, fissionClient)
|
||||
if err != nil {
|
||||
logger.Error("Failed to get functions related to secret", zap.String("secret_name", newS.ObjectMeta.Name), zap.String("secret_namespace", newS.ObjectMeta.Namespace))
|
||||
}
|
||||
|
||||
if len(funcs) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Debug("Secret changed",
|
||||
zap.String("secret_name", newS.ObjectMeta.Name),
|
||||
zap.String("secret_namespace", newS.ObjectMeta.Namespace))
|
||||
refreshPods(ctx, logger, funcs, types)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -88,6 +88,8 @@ type (
|
||||
|
||||
hpaops *hpautils.HpaOperations
|
||||
objectReaperIntervalSecond time.Duration
|
||||
|
||||
enableOwnerReferences bool
|
||||
}
|
||||
)
|
||||
|
||||
@@ -131,6 +133,8 @@ func MakeContainer(
|
||||
deplListerSynced: make(map[string]k8sCache.InformerSynced),
|
||||
svcLister: make(map[string]corelisters.ServiceLister),
|
||||
svcListerSynced: make(map[string]k8sCache.InformerSynced),
|
||||
|
||||
enableOwnerReferences: utils.IsOwnerReferencesEnabled(),
|
||||
}
|
||||
|
||||
for ns, informerFactory := range cnmInformerFactory {
|
||||
@@ -421,7 +425,7 @@ func (caaf *Container) fnCreate(ctx context.Context, fn *fv1.Function) (*fscache
|
||||
return nil, fmt.Errorf("error creating deployment %s: %w", objName, err)
|
||||
}
|
||||
|
||||
hpa, err := caaf.hpaops.CreateOrGetHpa(ctx, objName, &fn.Spec.InvokeStrategy.ExecutionStrategy, depl, deployLabels, deployAnnotations)
|
||||
hpa, err := caaf.hpaops.CreateOrGetHpa(ctx, fn, objName, &fn.Spec.InvokeStrategy.ExecutionStrategy, depl, deployLabels, deployAnnotations)
|
||||
if err != nil {
|
||||
caaf.logger.Error("error creating HPA", zap.Error(err), zap.String("hpa", objName))
|
||||
go cleanupFunc(ns, objName)
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
k8s_err "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
@@ -86,6 +87,7 @@ func (cn *Container) createOrGetDeployment(ctx context.Context, fn *fv1.Function
|
||||
if existingDepl.Annotations[fv1.EXECUTOR_INSTANCEID_LABEL] != cn.instanceID {
|
||||
existingDepl.Annotations = deployment.Annotations
|
||||
existingDepl.Labels = deployment.Labels
|
||||
existingDepl.OwnerReferences = deployment.OwnerReferences
|
||||
existingDepl.Spec.Template.Spec.Containers = deployment.Spec.Template.Spec.Containers
|
||||
existingDepl.Spec.Template.Spec.ServiceAccountName = deployment.Spec.Template.Spec.ServiceAccountName
|
||||
existingDepl.Spec.Template.Spec.TerminationGracePeriodSeconds = deployment.Spec.Template.Spec.TerminationGracePeriodSeconds
|
||||
@@ -263,11 +265,22 @@ func (cn *Container) getDeploymentSpec(ctx context.Context, fn *fv1.Function, ta
|
||||
|
||||
pod.Spec = *(util.ApplyImagePullSecret("", pod.Spec))
|
||||
|
||||
var ownerReferences []metav1.OwnerReference
|
||||
if cn.enableOwnerReferences {
|
||||
ownerReferences = []metav1.OwnerReference{
|
||||
*metav1.NewControllerRef(fn, schema.GroupVersionKind{
|
||||
Group: "fission.io",
|
||||
Version: "v1",
|
||||
Kind: "Function",
|
||||
}),
|
||||
}
|
||||
}
|
||||
deployment := &appsv1.Deployment{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: deployName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
Name: deployName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
OwnerReferences: ownerReferences,
|
||||
},
|
||||
Spec: appsv1.DeploymentSpec{
|
||||
Replicas: &replicas,
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
k8s_err "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
@@ -49,11 +50,23 @@ func (cn *Container) createOrGetSvc(ctx context.Context, fn *fv1.Function, deplo
|
||||
return nil, err
|
||||
}
|
||||
logger := otelUtils.LoggerWithTraceID(ctx, cn.logger)
|
||||
var ownerReferences []metav1.OwnerReference
|
||||
if cn.enableOwnerReferences {
|
||||
ownerReferences = []metav1.OwnerReference{
|
||||
*metav1.NewControllerRef(fn, schema.GroupVersionKind{
|
||||
Group: "fission.io",
|
||||
Version: "v1",
|
||||
Kind: "Function",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
service := &apiv1.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: svcName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
Name: svcName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
OwnerReferences: ownerReferences,
|
||||
},
|
||||
Spec: apiv1.ServiceSpec{
|
||||
Ports: []apiv1.ServicePort{
|
||||
@@ -74,6 +87,7 @@ func (cn *Container) createOrGetSvc(ctx context.Context, fn *fv1.Function, deplo
|
||||
if existingSvc.Annotations[fv1.EXECUTOR_INSTANCEID_LABEL] != cn.instanceID {
|
||||
existingSvc.Annotations = service.Annotations
|
||||
existingSvc.Labels = service.Labels
|
||||
existingSvc.OwnerReferences = service.OwnerReferences
|
||||
existingSvc.Spec.Ports = service.Spec.Ports
|
||||
existingSvc.Spec.Selector = service.Spec.Selector
|
||||
existingSvc.Spec.Type = service.Spec.Type
|
||||
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
k8s_err "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
@@ -61,6 +62,7 @@ func (deploy *NewDeploy) createOrGetDeployment(ctx context.Context, fn *fv1.Func
|
||||
if existingDepl.Annotations[fv1.EXECUTOR_INSTANCEID_LABEL] != deploy.instanceID {
|
||||
existingDepl.Annotations = deployment.Annotations
|
||||
existingDepl.Labels = deployment.Labels
|
||||
existingDepl.OwnerReferences = deployment.OwnerReferences
|
||||
existingDepl.Spec.Template.Spec.Containers = deployment.Spec.Template.Spec.Containers
|
||||
existingDepl.Spec.Template.Spec.ServiceAccountName = deployment.Spec.Template.Spec.ServiceAccountName
|
||||
existingDepl.Spec.Template.Spec.TerminationGracePeriodSeconds = deployment.Spec.Template.Spec.TerminationGracePeriodSeconds
|
||||
@@ -244,11 +246,23 @@ func (deploy *NewDeploy) getDeploymentSpec(ctx context.Context, fn *fv1.Function
|
||||
|
||||
pod.Spec = *(util.ApplyImagePullSecret(env.Spec.ImagePullSecret, pod.Spec))
|
||||
|
||||
var ownerReferences []metav1.OwnerReference
|
||||
if deploy.enableOwnerReferences {
|
||||
ownerReferences = []metav1.OwnerReference{
|
||||
*metav1.NewControllerRef(fn, schema.GroupVersionKind{
|
||||
Group: "fission.io",
|
||||
Version: "v1",
|
||||
Kind: "Function",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
deployment := &appsv1.Deployment{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: deployName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
Name: deployName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
OwnerReferences: ownerReferences,
|
||||
},
|
||||
Spec: appsv1.DeploymentSpec{
|
||||
Replicas: &replicas,
|
||||
@@ -323,13 +337,25 @@ func (deploy *NewDeploy) getResources(env *fv1.Environment, fn *fv1.Function) ap
|
||||
return resources
|
||||
}
|
||||
|
||||
func (deploy *NewDeploy) createOrGetSvc(ctx context.Context, deployLabels map[string]string, deployAnnotations map[string]string, svcName string, svcNamespace string) (*apiv1.Service, error) {
|
||||
func (deploy *NewDeploy) createOrGetSvc(ctx context.Context, fn *fv1.Function, deployLabels map[string]string, deployAnnotations map[string]string, svcName string, svcNamespace string) (*apiv1.Service, error) {
|
||||
logger := otelUtils.LoggerWithTraceID(ctx, deploy.logger)
|
||||
var ownerReferences []metav1.OwnerReference
|
||||
if deploy.enableOwnerReferences {
|
||||
ownerReferences = []metav1.OwnerReference{
|
||||
*metav1.NewControllerRef(fn, schema.GroupVersionKind{
|
||||
Group: "fission.io",
|
||||
Version: "v1",
|
||||
Kind: "Function",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
service := &apiv1.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: svcName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
Name: svcName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
OwnerReferences: ownerReferences,
|
||||
},
|
||||
Spec: apiv1.ServiceSpec{
|
||||
Ports: []apiv1.ServicePort{
|
||||
@@ -351,6 +377,7 @@ func (deploy *NewDeploy) createOrGetSvc(ctx context.Context, deployLabels map[st
|
||||
if existingSvc.Annotations[fv1.EXECUTOR_INSTANCEID_LABEL] != deploy.instanceID {
|
||||
existingSvc.Annotations = service.Annotations
|
||||
existingSvc.Labels = service.Labels
|
||||
existingSvc.OwnerReferences = service.OwnerReferences
|
||||
existingSvc.Spec.Ports = service.Spec.Ports
|
||||
existingSvc.Spec.Selector = service.Spec.Selector
|
||||
existingSvc.Spec.Type = service.Spec.Type
|
||||
|
||||
@@ -92,6 +92,8 @@ type (
|
||||
|
||||
podSpecPatch *apiv1.PodSpec
|
||||
objectReaperIntervalSecond time.Duration
|
||||
|
||||
enableOwnerReferences bool
|
||||
}
|
||||
)
|
||||
|
||||
@@ -139,6 +141,8 @@ func MakeNewDeploy(
|
||||
deplListerSynced: make(map[string]k8sCache.InformerSynced),
|
||||
svcLister: make(map[string]corelisters.ServiceLister),
|
||||
svcListerSynced: make(map[string]k8sCache.InformerSynced),
|
||||
|
||||
enableOwnerReferences: utils.IsOwnerReferencesEnabled(),
|
||||
}
|
||||
|
||||
for ns, informerFactory := range ndmInformerFactory {
|
||||
@@ -451,7 +455,7 @@ func (deploy *NewDeploy) fnCreate(ctx context.Context, fn *fv1.Function) (*fscac
|
||||
// Since newdeploy waits for pods of deployment to be ready,
|
||||
// change the order of kubeObject creation (create service first,
|
||||
// then deployment) to take advantage of waiting time.
|
||||
svc, err := deploy.createOrGetSvc(ctx, deployLabels, deployAnnotations, objName, ns)
|
||||
svc, err := deploy.createOrGetSvc(ctx, fn, deployLabels, deployAnnotations, objName, ns)
|
||||
if err != nil {
|
||||
deploy.logger.Error("error creating service", zap.Error(err), zap.String("service", objName))
|
||||
go cleanupFunc(context.Background(), ns, objName)
|
||||
@@ -466,7 +470,7 @@ func (deploy *NewDeploy) fnCreate(ctx context.Context, fn *fv1.Function) (*fscac
|
||||
return nil, fmt.Errorf("error creating deployment %s: %w", objName, err)
|
||||
}
|
||||
|
||||
hpa, err := deploy.hpaops.CreateOrGetHpa(ctx, objName, &fn.Spec.InvokeStrategy.ExecutionStrategy, depl, deployLabels, deployAnnotations)
|
||||
hpa, err := deploy.hpaops.CreateOrGetHpa(ctx, fn, objName, &fn.Spec.InvokeStrategy.ExecutionStrategy, depl, deployLabels, deployAnnotations)
|
||||
if err != nil {
|
||||
deploy.logger.Error("error creating HPA", zap.Error(err), zap.String("hpa", objName))
|
||||
go cleanupFunc(context.Background(), ns, objName)
|
||||
|
||||
@@ -75,10 +75,11 @@ type (
|
||||
stopReadyPodControllerCh chan struct{}
|
||||
readyPodLister corelisters.PodLister
|
||||
readyPodListerSynced cache.InformerSynced
|
||||
readyPodQueue workqueue.DelayingInterface
|
||||
readyPodQueue workqueue.TypedDelayingInterface[string]
|
||||
poolInstanceID string // small random string to uniquify pod names
|
||||
instanceID string // poolmgr instance id
|
||||
podSpecPatch *apiv1.PodSpec
|
||||
enableOwnerReferences bool
|
||||
// TODO: move this field into fsCache
|
||||
podFSVCMap sync.Map
|
||||
}
|
||||
@@ -131,6 +132,7 @@ func MakeGenericPool(
|
||||
instanceID: instanceID,
|
||||
podFSVCMap: sync.Map{},
|
||||
podSpecPatch: podSpecPatch,
|
||||
enableOwnerReferences: utils.IsOwnerReferencesEnabled(),
|
||||
lock: sync.Mutex{},
|
||||
}
|
||||
|
||||
@@ -263,15 +265,13 @@ func (gp *GenericPool) choosePod(ctx context.Context, newLabels map[string]strin
|
||||
}
|
||||
|
||||
var chosenPod *apiv1.Pod
|
||||
var key string
|
||||
|
||||
otelUtils.SpanTrackEvent(ctx, "waitForPod", otelUtils.MapToAttributes(newLabels)...)
|
||||
item, quit := gp.readyPodQueue.Get()
|
||||
key, quit := gp.readyPodQueue.Get()
|
||||
if quit {
|
||||
logger.Error("readypod controller is not running")
|
||||
return "", nil, errors.New("readypod controller is not running")
|
||||
}
|
||||
key = item.(string)
|
||||
logger.Debug("got key from the queue", zap.String("key", key))
|
||||
namespace, name, err := cache.SplitMetaNamespaceKey(key)
|
||||
if err != nil {
|
||||
@@ -304,16 +304,18 @@ func (gp *GenericPool) choosePod(ctx context.Context, newLabels map[string]strin
|
||||
// Relabel. If the pod already got picked and
|
||||
// modified, this should fail; in that case just
|
||||
// retry.
|
||||
labelPatch, _ := json.Marshal(newLabels)
|
||||
|
||||
// Append executor instance id to pod annotations to
|
||||
// indicate this pod is managed by this executor.
|
||||
annotations := gp.getDeployAnnotations(gp.env)
|
||||
annotationPatch, _ := json.Marshal(annotations)
|
||||
|
||||
patch := fmt.Sprintf(`{"metadata":{"annotations":%v, "labels":%v}}`, string(annotationPatch), string(labelPatch))
|
||||
logger.Info("relabel pod", zap.String("pod", patch))
|
||||
newPod, err := gp.kubernetesClient.CoreV1().Pods(chosenPod.Namespace).Patch(ctx, chosenPod.Name, k8sTypes.StrategicMergePatchType, []byte(patch), metav1.PatchOptions{})
|
||||
patch := map[string]interface{}{
|
||||
"metadata": map[string]interface{}{
|
||||
"annotations": annotations,
|
||||
"labels": newLabels,
|
||||
},
|
||||
}
|
||||
patchBytes, _ := json.Marshal(patch)
|
||||
logger.Info("relabel pod", zap.String("pod", string((patchBytes))))
|
||||
newPod, err := gp.kubernetesClient.CoreV1().Pods(chosenPod.Namespace).Patch(ctx, chosenPod.Name, k8sTypes.StrategicMergePatchType, patchBytes, metav1.PatchOptions{})
|
||||
if err != nil && errors.Is(err, context.Canceled) {
|
||||
// ending retry loop when the request canceled
|
||||
gp.readyPodQueue.Done(key)
|
||||
@@ -424,7 +426,7 @@ func (gp *GenericPool) specializePod(ctx context.Context, pod *apiv1.Pod, fn *fv
|
||||
zap.String("configmap_namespace", cm.Namespace),
|
||||
zap.String("function_name", fn.ObjectMeta.Name),
|
||||
zap.String("function_namespace", gp.fnNamespace))
|
||||
return fmt.Errorf(fmt.Sprintf("configmap %s must be in same namespace as function namespace", cm.Name))
|
||||
return fmt.Errorf("configmap %s must be in same namespace as function namespace", cm.Name)
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
@@ -439,7 +441,7 @@ func (gp *GenericPool) specializePod(ctx context.Context, pod *apiv1.Pod, fn *fv
|
||||
zap.String("secret_namespace", sec.Namespace),
|
||||
zap.String("function_name", fn.ObjectMeta.Name),
|
||||
zap.String("function_namespace", gp.fnNamespace))
|
||||
return fmt.Errorf(fmt.Sprintf("secret %s must be in same namespace as function namespace", sec.Name))
|
||||
return fmt.Errorf("secret %s must be in same namespace as function namespace", sec.Name)
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import (
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
k8sErrs "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/executor/util"
|
||||
@@ -58,10 +59,22 @@ func getPoolName(env *fv1.Environment) string {
|
||||
func (gp *GenericPool) genDeploymentMeta(env *fv1.Environment) metav1.ObjectMeta {
|
||||
deployLabels := gp.getEnvironmentPoolLabels(env)
|
||||
deployAnnotations := gp.getDeployAnnotations(env)
|
||||
|
||||
var ownerReferences []metav1.OwnerReference
|
||||
if gp.enableOwnerReferences {
|
||||
ownerReferences = []metav1.OwnerReference{
|
||||
*metav1.NewControllerRef(env, schema.GroupVersionKind{
|
||||
Group: "fission.io",
|
||||
Version: "v1",
|
||||
Kind: "Environment",
|
||||
}),
|
||||
}
|
||||
}
|
||||
return metav1.ObjectMeta{
|
||||
Name: getPoolName(env),
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
Name: getPoolName(env),
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
OwnerReferences: ownerReferences,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -548,7 +548,7 @@ func (gpm *GenericPoolManager) service() {
|
||||
pool, ok := gpm.pools[key]
|
||||
if !ok {
|
||||
gpm.logger.Error("Could not find pool", zap.String("environment", env.ObjectMeta.Name), zap.String("namespace", env.ObjectMeta.Namespace))
|
||||
return
|
||||
continue
|
||||
}
|
||||
delete(gpm.pools, key)
|
||||
if pool != nil {
|
||||
|
||||
@@ -60,10 +60,10 @@ type (
|
||||
// podListerSynced returns true if the pod store has been synced at least once.
|
||||
podListerSynced map[string]k8sCache.InformerSynced
|
||||
|
||||
envCreateUpdateQueue workqueue.RateLimitingInterface
|
||||
envDeleteQueue workqueue.RateLimitingInterface
|
||||
envCreateUpdateQueue workqueue.TypedRateLimitingInterface[string]
|
||||
envDeleteQueue workqueue.TypedRateLimitingInterface[*fv1.Environment]
|
||||
|
||||
spCleanupPodQueue workqueue.RateLimitingInterface
|
||||
spCleanupPodQueue workqueue.TypedRateLimitingInterface[string]
|
||||
|
||||
gpm *GenericPoolManager
|
||||
}
|
||||
@@ -84,9 +84,9 @@ func NewPoolPodController(ctx context.Context, logger *zap.Logger,
|
||||
envListerSynced: make(map[string]k8sCache.InformerSynced, 0),
|
||||
podLister: make(map[string]corelisters.PodLister),
|
||||
podListerSynced: make(map[string]k8sCache.InformerSynced),
|
||||
envCreateUpdateQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "EnvAddUpdateQueue"),
|
||||
envDeleteQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "EnvDeleteQueue"),
|
||||
spCleanupPodQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "SpecializedPodCleanupQueue"),
|
||||
envCreateUpdateQueue: workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[string](), workqueue.TypedRateLimitingQueueConfig[string]{Name: "EnvAddUpdateQueue"}),
|
||||
envDeleteQueue: workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[*fv1.Environment](), workqueue.TypedRateLimitingQueueConfig[*fv1.Environment]{Name: "EnvDeleteQueue"}),
|
||||
spCleanupPodQueue: workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[string](), workqueue.TypedRateLimitingQueueConfig[string]{Name: "SpecializedPodCleanupQueue"}),
|
||||
}
|
||||
if p.enableIstio {
|
||||
for _, factory := range finformerFactory {
|
||||
@@ -337,11 +337,10 @@ func (p *PoolPodController) envCreateUpdateQueueProcessFunc(ctx context.Context)
|
||||
return nil
|
||||
}
|
||||
|
||||
obj, quit := p.envCreateUpdateQueue.Get()
|
||||
key, quit := p.envCreateUpdateQueue.Get()
|
||||
if quit {
|
||||
return true
|
||||
}
|
||||
key := obj.(string)
|
||||
defer p.envCreateUpdateQueue.Done(key)
|
||||
|
||||
namespace, name, err := k8sCache.SplitMetaNamespaceKey(key)
|
||||
@@ -390,17 +389,11 @@ func (p *PoolPodController) envCreateUpdateQueueProcessFunc(ctx context.Context)
|
||||
}
|
||||
|
||||
func (p *PoolPodController) envDeleteQueueProcessFunc(ctx context.Context) bool {
|
||||
obj, quit := p.envDeleteQueue.Get()
|
||||
env, quit := p.envDeleteQueue.Get()
|
||||
if quit {
|
||||
return true
|
||||
}
|
||||
defer p.envDeleteQueue.Done(obj)
|
||||
env, ok := obj.(*fv1.Environment)
|
||||
if !ok {
|
||||
p.logger.Error("unexpected type when deleting env to pool pod controller", zap.Any("obj", obj))
|
||||
p.envDeleteQueue.Forget(obj)
|
||||
return false
|
||||
}
|
||||
defer p.envDeleteQueue.Done(env)
|
||||
p.logger.Debug("env delete request processing")
|
||||
p.gpm.cleanupPool(ctx, env)
|
||||
specializePodLables := getSpecializedPodLabels(env)
|
||||
@@ -408,17 +401,17 @@ func (p *PoolPodController) envDeleteQueueProcessFunc(ctx context.Context) bool
|
||||
podLister, ok := p.podLister[ns]
|
||||
if !ok {
|
||||
p.logger.Error("no pod lister found for namespace", zap.String("namespace", ns))
|
||||
p.envDeleteQueue.Forget(obj)
|
||||
p.envDeleteQueue.Forget(env)
|
||||
return false
|
||||
}
|
||||
specializedPods, err := podLister.Pods(ns).List(labels.SelectorFromSet(specializePodLables))
|
||||
if err != nil {
|
||||
p.logger.Error("failed to list specialized pods", zap.Error(err))
|
||||
p.envDeleteQueue.Forget(obj)
|
||||
p.envDeleteQueue.Forget(env)
|
||||
return false
|
||||
}
|
||||
if len(specializedPods) == 0 {
|
||||
p.envDeleteQueue.Forget(obj)
|
||||
p.envDeleteQueue.Forget(env)
|
||||
return false
|
||||
}
|
||||
p.logger.Info("specialized pods identified for cleanup after env delete", zap.String("env", env.ObjectMeta.Name), zap.String("namespace", env.ObjectMeta.Namespace), zap.Int("count", len(specializedPods)))
|
||||
@@ -433,17 +426,16 @@ func (p *PoolPodController) envDeleteQueueProcessFunc(ctx context.Context) bool
|
||||
}
|
||||
p.spCleanupPodQueue.Add(key)
|
||||
}
|
||||
p.envDeleteQueue.Forget(obj)
|
||||
p.envDeleteQueue.Forget(env)
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *PoolPodController) spCleanupPodQueueProcessFunc(ctx context.Context) bool {
|
||||
maxRetries := 3
|
||||
obj, quit := p.spCleanupPodQueue.Get()
|
||||
key, quit := p.spCleanupPodQueue.Get()
|
||||
if quit {
|
||||
return true
|
||||
}
|
||||
key := obj.(string)
|
||||
defer p.spCleanupPodQueue.Done(key)
|
||||
namespace, name, err := k8sCache.SplitMetaNamespaceKey(key)
|
||||
if err != nil {
|
||||
|
||||
@@ -33,7 +33,9 @@ func (gp *GenericPool) setupReadyPodController() error {
|
||||
// avoid concurrent access to gp.deployment
|
||||
gp.lock.Lock()
|
||||
defer gp.lock.Unlock()
|
||||
gp.readyPodQueue = workqueue.NewDelayingQueue()
|
||||
gp.readyPodQueue = workqueue.NewTypedDelayingQueueWithConfig(workqueue.TypedDelayingQueueConfig[string]{
|
||||
Name: "readyPodQueue",
|
||||
})
|
||||
informerFactory, err := utils.GetInformerFactoryByReadyPod(gp.kubernetesClient, gp.fnNamespace, gp.deployment.Spec.Selector)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -355,7 +355,7 @@ func (c *PoolCache) MarkFuncDeleted(function crd.CacheKeyURG) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetValue returns a function service with status in Active else return error
|
||||
// GetSvcValue returns a function service with status in Active else return error
|
||||
func (c *PoolCache) GetSvcValue(ctx context.Context, function crd.CacheKeyURG, requestsPerPod int, concurrency int) (*FuncSvc, error) {
|
||||
respChannel := make(chan *response)
|
||||
c.requestChannel <- &request{
|
||||
@@ -390,7 +390,7 @@ func (c *PoolCache) ListAvailableValue() []*FuncSvc {
|
||||
return resp.allValues
|
||||
}
|
||||
|
||||
// SetValue marks the value at key [function][address] as active(begin used)
|
||||
// SetSvcValue marks the value at key [function][address] as active(begin used)
|
||||
func (c *PoolCache) SetSvcValue(ctx context.Context, function crd.CacheKeyURG, address string, value *FuncSvc, cpuLimit resource.Quantity, requestsPerPod, svcsRetain int) {
|
||||
respChannel := make(chan *response)
|
||||
c.requestChannel <- &request{
|
||||
|
||||
@@ -25,9 +25,11 @@ import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
k8s_err "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
||||
)
|
||||
|
||||
@@ -38,16 +40,18 @@ const (
|
||||
)
|
||||
|
||||
type HpaOperations struct {
|
||||
logger *zap.Logger
|
||||
kubernetesClient kubernetes.Interface
|
||||
instanceID string
|
||||
logger *zap.Logger
|
||||
kubernetesClient kubernetes.Interface
|
||||
instanceID string
|
||||
enableOwnerReferences bool
|
||||
}
|
||||
|
||||
func NewHpaOperations(logger *zap.Logger, kubernetesClient kubernetes.Interface, instanceID string) *HpaOperations {
|
||||
return &HpaOperations{
|
||||
logger: logger,
|
||||
kubernetesClient: kubernetesClient,
|
||||
instanceID: instanceID,
|
||||
logger: logger,
|
||||
kubernetesClient: kubernetesClient,
|
||||
instanceID: instanceID,
|
||||
enableOwnerReferences: utils.IsOwnerReferencesEnabled(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +76,7 @@ func getScaleTargetRef(deployment *appsv1.Deployment) asv2.CrossVersionObjectRef
|
||||
}
|
||||
}
|
||||
|
||||
func (hpaops *HpaOperations) CreateOrGetHpa(ctx context.Context, hpaName string, execStrategy *fv1.ExecutionStrategy,
|
||||
func (hpaops *HpaOperations) CreateOrGetHpa(ctx context.Context, fn *fv1.Function, hpaName string, execStrategy *fv1.ExecutionStrategy,
|
||||
depl *appsv1.Deployment, deployLabels map[string]string, deployAnnotations map[string]string) (*asv2.HorizontalPodAutoscaler, error) {
|
||||
|
||||
if depl == nil {
|
||||
@@ -98,11 +102,23 @@ func (hpaops *HpaOperations) CreateOrGetHpa(ctx context.Context, hpaName string,
|
||||
hpaMetrics = append(hpaMetrics, execStrategy.Metrics...)
|
||||
}
|
||||
|
||||
var ownerReferences []metav1.OwnerReference
|
||||
if hpaops.enableOwnerReferences {
|
||||
ownerReferences = []metav1.OwnerReference{
|
||||
*metav1.NewControllerRef(fn, schema.GroupVersionKind{
|
||||
Group: "fission.io",
|
||||
Version: "v1",
|
||||
Kind: "Function",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
hpa := &asv2.HorizontalPodAutoscaler{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: hpaName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
Name: hpaName,
|
||||
Labels: deployLabels,
|
||||
Annotations: deployAnnotations,
|
||||
OwnerReferences: ownerReferences,
|
||||
},
|
||||
Spec: asv2.HorizontalPodAutoscalerSpec{
|
||||
ScaleTargetRef: getScaleTargetRef(depl),
|
||||
@@ -119,6 +135,7 @@ func (hpaops *HpaOperations) CreateOrGetHpa(ctx context.Context, hpaName string,
|
||||
if existingHpa.Annotations[fv1.EXECUTOR_INSTANCEID_LABEL] != hpaops.instanceID {
|
||||
existingHpa.Annotations = hpa.Annotations
|
||||
existingHpa.Labels = hpa.Labels
|
||||
existingHpa.OwnerReferences = hpa.OwnerReferences
|
||||
existingHpa.Spec = hpa.Spec
|
||||
existingHpa, err = hpaops.kubernetesClient.AutoscalingV2().HorizontalPodAutoscalers(depl.ObjectMeta.Namespace).Update(ctx, existingHpa, metav1.UpdateOptions{})
|
||||
if err != nil {
|
||||
|
||||
@@ -25,6 +25,7 @@ import (
|
||||
asv2 "k8s.io/api/autoscaling/v2"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
@@ -67,7 +68,14 @@ func TestHpaOps(t *testing.T) {
|
||||
"test-annotation": "test-annotation-value",
|
||||
}
|
||||
// Test CreateHPA
|
||||
hpa, err := hpaops.CreateOrGetHpa(ctx, "test-hpa",
|
||||
hpa, err := hpaops.CreateOrGetHpa(ctx,
|
||||
&fv1.Function{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "test-fn",
|
||||
UID: uuid.NewUUID(),
|
||||
},
|
||||
},
|
||||
"test-hpa",
|
||||
&fv1.ExecutionStrategy{
|
||||
ExecutorType: fv1.ExecutorTypeNewdeploy,
|
||||
MinScale: 1,
|
||||
|
||||
@@ -301,7 +301,7 @@ func (cfg *Config) addFetcherToPodSpecWithCommand(podSpec *apiv1.PodSpec, mainCo
|
||||
podSpec.Containers[ix] = container
|
||||
}
|
||||
if !found {
|
||||
existingContainerNames := make([]string, len(podSpec.Containers))
|
||||
existingContainerNames := make([]string, 0, len(podSpec.Containers))
|
||||
for _, existingContainer := range podSpec.Containers {
|
||||
existingContainerNames = append(existingContainerNames, existingContainer.Name)
|
||||
}
|
||||
|
||||
+51
-52
@@ -29,7 +29,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/mholt/archiver/v3"
|
||||
"github.com/pkg/errors"
|
||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||
"go.uber.org/zap"
|
||||
@@ -253,15 +252,14 @@ func (fetcher *Fetcher) SpecializeHandler(w http.ResponseWriter, r *http.Request
|
||||
func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req FunctionFetchRequest) (int, error) {
|
||||
logger := otelUtils.LoggerWithTraceID(ctx, fetcher.logger)
|
||||
|
||||
// check that the requested filename is not an empty string and error out if so
|
||||
if len(req.Filename) == 0 {
|
||||
e := "fetch request received for an empty file name"
|
||||
logger.Error(e, zap.Any("request", req))
|
||||
return http.StatusBadRequest, errors.New(fmt.Sprintf("%s, request: %v", e, req))
|
||||
storePath, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedVolumePath, req.Filename), fetcher.sharedVolumePath)
|
||||
if err != nil {
|
||||
logger.Error(err.Error(), zap.String("filename", req.Filename))
|
||||
return http.StatusBadRequest, errors.New(fmt.Sprintf("%s, request: %v", err, req))
|
||||
}
|
||||
|
||||
// verify first if the file already exists.
|
||||
if _, err := os.Stat(filepath.Join(fetcher.sharedVolumePath, req.Filename)); err == nil {
|
||||
if _, err := os.Stat(storePath); err == nil {
|
||||
logger.Info("requested file already exists at shared volume - skipping fetch",
|
||||
zap.String("requested_file", req.Filename),
|
||||
zap.String("shared_volume_path", fetcher.sharedVolumePath))
|
||||
@@ -269,8 +267,11 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
||||
return http.StatusOK, nil
|
||||
}
|
||||
|
||||
tmpFile := req.Filename + ".tmp"
|
||||
tmpPath := filepath.Join(fetcher.sharedVolumePath, tmpFile)
|
||||
tmpPath, err := utils.SanitizeFilePath(storePath+".tmp", fetcher.sharedVolumePath)
|
||||
if err != nil {
|
||||
logger.Error(err.Error(), zap.String("filename", req.Filename))
|
||||
return http.StatusBadRequest, errors.New(fmt.Sprintf("%s, request: %v", err, req))
|
||||
}
|
||||
|
||||
if req.FetchType == fv1.FETCH_URL {
|
||||
otelUtils.SpanTrackEvent(ctx, "fetch_url", otelUtils.MapToAttributes(map[string]string{
|
||||
@@ -350,10 +351,10 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
||||
}
|
||||
|
||||
// checking if file is a zip
|
||||
if match, _ := utils.IsZip(tmpPath); match && !req.KeepArchive {
|
||||
if match, _ := utils.IsZip(ctx, tmpPath); match && !req.KeepArchive {
|
||||
// unarchive tmp file to a tmp unarchive path
|
||||
tmpUnarchivePath := filepath.Join(fetcher.sharedVolumePath, uuid.NewString())
|
||||
err := fetcher.unarchive(tmpPath, tmpUnarchivePath)
|
||||
err := utils.Unarchive(ctx, tmpPath, tmpUnarchivePath)
|
||||
if err != nil {
|
||||
logger.Error("error unarchive",
|
||||
zap.Error(err),
|
||||
@@ -366,18 +367,17 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
||||
}
|
||||
|
||||
// move tmp file to requested filename
|
||||
renamePath := filepath.Join(fetcher.sharedVolumePath, req.Filename)
|
||||
err := fetcher.rename(tmpPath, renamePath)
|
||||
err = fetcher.rename(tmpPath, storePath)
|
||||
if err != nil {
|
||||
logger.Error("error renaming file",
|
||||
zap.Error(err),
|
||||
zap.String("original_path", tmpPath),
|
||||
zap.String("rename_path", renamePath))
|
||||
zap.String("rename_path", storePath))
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
|
||||
otelUtils.SpanTrackEvent(ctx, "packageFetched", otelUtils.GetAttributesForPackage(pkg)...)
|
||||
logger.Info("successfully placed", zap.String("location", renamePath))
|
||||
logger.Info("successfully placed", zap.String("location", storePath))
|
||||
return http.StatusOK, nil
|
||||
}
|
||||
|
||||
@@ -406,8 +406,12 @@ func (fetcher *Fetcher) FetchSecretsAndCfgMaps(ctx context.Context, secrets []fv
|
||||
return httpCode, errors.New(e)
|
||||
}
|
||||
|
||||
secretPath := filepath.Join(secret.Namespace, secret.Name)
|
||||
secretDir := filepath.Join(fetcher.sharedSecretPath, secretPath)
|
||||
secretDir, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedSecretPath, secret.Namespace, secret.Name), fetcher.sharedSecretPath)
|
||||
if err != nil {
|
||||
logger.Error(err.Error(), zap.String("directory", secretDir), zap.String("secret_name", secret.Name), zap.String("secret_namespace", secret.Namespace))
|
||||
return http.StatusBadRequest, errors.New(fmt.Sprintf("%s, request: %v", err, secret))
|
||||
}
|
||||
|
||||
err = os.MkdirAll(secretDir, os.ModeDir|0750)
|
||||
if err != nil {
|
||||
e := "failed to create directory for secret"
|
||||
@@ -454,8 +458,13 @@ func (fetcher *Fetcher) FetchSecretsAndCfgMaps(ctx context.Context, secrets []fv
|
||||
return httpCode, errors.New(e)
|
||||
}
|
||||
|
||||
configPath := filepath.Join(config.Namespace, config.Name)
|
||||
configDir := filepath.Join(fetcher.sharedConfigPath, configPath)
|
||||
configDir, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedConfigPath, config.Namespace, config.Name), fetcher.sharedConfigPath)
|
||||
if err != nil {
|
||||
logger.Error(err.Error(), zap.String("directory", configDir), zap.String("config_map_name", config.Name), zap.String("config_map_namespace", config.Namespace))
|
||||
return http.StatusBadRequest, errors.New(fmt.Sprintf("%s, request: %v", err,
|
||||
config))
|
||||
}
|
||||
|
||||
err = os.MkdirAll(configDir, os.ModeDir|0750)
|
||||
if err != nil {
|
||||
e := "failed to create directory for configmap"
|
||||
@@ -519,14 +528,32 @@ func (fetcher *Fetcher) UploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
logger.Info("fetcher received upload request", zap.Any("request", req))
|
||||
|
||||
zipFilename := req.Filename + ".zip"
|
||||
srcFilepath := filepath.Join(fetcher.sharedVolumePath, req.Filename)
|
||||
dstFilepath := filepath.Join(fetcher.sharedVolumePath, zipFilename)
|
||||
srcFilepath, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedVolumePath, req.Filename), fetcher.sharedVolumePath)
|
||||
if err != nil {
|
||||
logger.Error("error sanitizing file path", zap.Error(err))
|
||||
http.Error(w, fmt.Sprintf("%s: %v", err, req.Filename), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
dstFilepath, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedVolumePath, req.Filename+".zip"), fetcher.sharedVolumePath)
|
||||
if err != nil {
|
||||
logger.Error("error sanitizing file path", zap.Error(err))
|
||||
http.Error(w, fmt.Sprintf("%s: %v", err, req.Filename), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
defer func() {
|
||||
errC := utils.DeleteOldPackages(srcFilepath, "DEPLOY_PKG")
|
||||
if errC != nil {
|
||||
m := "error deleting deploy package after upload"
|
||||
logger.Error(m, zap.Error(errC))
|
||||
}
|
||||
}()
|
||||
|
||||
if req.ArchivePackage {
|
||||
err = fetcher.archive(srcFilepath, dstFilepath)
|
||||
err = utils.Archive(ctx, srcFilepath, dstFilepath)
|
||||
if err != nil {
|
||||
e := "error archiving zip file"
|
||||
logger.Error(e, zap.Error(err), zap.String("source", srcFilepath), zap.String("destination", dstFilepath))
|
||||
@@ -584,6 +611,7 @@ func (fetcher *Fetcher) UploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
logger.Error(e, zap.Error(err))
|
||||
http.Error(w, fmt.Sprintf("%s: %v", e, err), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (fetcher *Fetcher) rename(src string, dst string) error {
|
||||
@@ -594,35 +622,6 @@ func (fetcher *Fetcher) rename(src string, dst string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// archive zips the contents of directory at src into a new zip file
|
||||
// at dst (note that the contents are zipped, not the directory itself).
|
||||
func (fetcher *Fetcher) archive(src string, dst string) error {
|
||||
var files []string
|
||||
target, err := os.Stat(src)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to zip file")
|
||||
}
|
||||
if target.IsDir() {
|
||||
// list all
|
||||
fs, _ := os.ReadDir(src)
|
||||
for _, f := range fs {
|
||||
files = append(files, filepath.Join(src, f.Name()))
|
||||
}
|
||||
} else {
|
||||
files = append(files, src)
|
||||
}
|
||||
return archiver.DefaultZip.Archive(files, dst)
|
||||
}
|
||||
|
||||
// unarchive is a function that unzips a zip file to destination
|
||||
func (fetcher *Fetcher) unarchive(src string, dst string) error {
|
||||
err := archiver.DefaultZip.Unarchive(src, dst)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to unzip file: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// getPkgInformation gets package information from k8s api server.
|
||||
func (fetcher *Fetcher) getPkgInformation(ctx context.Context, req FunctionFetchRequest) (pkg *fv1.Package, err error) {
|
||||
logger := otelUtils.LoggerWithTraceID(ctx, fetcher.logger)
|
||||
|
||||
@@ -266,7 +266,7 @@ func (u Cli) Int64(key string) int64 {
|
||||
|
||||
func (u Cli) Int64Slice(key string) []int64 {
|
||||
v, _ := u.c.Flags().GetIntSlice(key)
|
||||
vals := make([]int64, len(v))
|
||||
vals := make([]int64, 0, len(v))
|
||||
for _, i := range v {
|
||||
vals = append(vals, int64(i))
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ limitations under the License.
|
||||
package check
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||
"github.com/fission/fission/pkg/fission-cli/cmd"
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
@@ -32,13 +34,18 @@ func (opts *CheckSubCommand) do(input cli.Input) error {
|
||||
|
||||
checks := []healthcheck.CategoryID{}
|
||||
|
||||
userProvidedNS, _, err := opts.GetResourceNamespace(input, flagkey.Namespace)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error retrieving user provided namespace: %w", err)
|
||||
}
|
||||
|
||||
if input.IsSet(flagkey.PreCheckOnly) {
|
||||
checks = append(checks, healthcheck.Kubernetes)
|
||||
} else {
|
||||
checks = append(checks, healthcheck.FissionServices, healthcheck.FissionVersion)
|
||||
}
|
||||
|
||||
hc := healthcheck.NewHealthChecker(opts.Client(), checks)
|
||||
hc := healthcheck.NewHealthChecker(opts.Client(), checks, userProvidedNS)
|
||||
|
||||
healthcheck.RunChecks(input.Context(), input, opts.Client(), hc)
|
||||
return nil
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/rest"
|
||||
@@ -99,32 +100,44 @@ func GetClientConfig(kubeContext string) (clientcmd.ClientConfig, error) {
|
||||
|
||||
func NewClient(opts ClientOptions) (*Client, error) {
|
||||
client := &Client{}
|
||||
var err error
|
||||
var err1 error
|
||||
var cmdConfig clientcmd.ClientConfig
|
||||
if len(opts.Namespace) > 0 {
|
||||
client.Namespace = opts.Namespace
|
||||
} else {
|
||||
cmdConfig, err = GetClientConfig(opts.KubeContext)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
cmdConfig, err1 = GetClientConfig(opts.KubeContext)
|
||||
if err1 != nil {
|
||||
console.Verbose(2, err1.Error())
|
||||
}
|
||||
namespace, _, err := cmdConfig.Namespace()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client.Namespace = namespace
|
||||
}
|
||||
|
||||
console.Verbose(2, "Kubeconfig default namespace %q", client.Namespace)
|
||||
if cmdConfig != nil {
|
||||
namespace, _, err := cmdConfig.Namespace()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client.Namespace = namespace
|
||||
console.Verbose(2, "Kubeconfig default namespace %q", namespace)
|
||||
}
|
||||
}
|
||||
|
||||
if opts.RestConfig != nil {
|
||||
client.RestConfig = opts.RestConfig
|
||||
} else {
|
||||
} else if cmdConfig != nil {
|
||||
restConfig, err := cmdConfig.ClientConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client.RestConfig = restConfig
|
||||
} else {
|
||||
console.Verbose(2, "Using in-cluster config")
|
||||
restConfig, err2 := rest.InClusterConfig()
|
||||
if err2 != nil {
|
||||
return nil, errors.Join(err1, err2)
|
||||
}
|
||||
|
||||
client.RestConfig = restConfig
|
||||
client.Namespace = getInClusterConfigNamespace()
|
||||
console.Verbose(2, "In-cluster config default namespace %q", client.Namespace)
|
||||
}
|
||||
|
||||
clientGen := crd.NewClientGeneratorWithRestConfig(client.RestConfig)
|
||||
@@ -142,3 +155,21 @@ func NewClient(opts ClientOptions) (*Client, error) {
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
||||
// Fetch default namespace for inClusterConfig
|
||||
func getInClusterConfigNamespace() string {
|
||||
// This way assumes you've set the POD_NAMESPACE environment variable using the downward API.
|
||||
// This check has to be done first for backwards compatibility with the way InClusterConfig was originally set up
|
||||
if ns, ok := os.LookupEnv("POD_NAMESPACE"); ok {
|
||||
return ns
|
||||
}
|
||||
|
||||
// Fall back to the namespace associated with the service account token, if available
|
||||
if data, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil {
|
||||
if ns := strings.TrimSpace(string(data)); len(ns) > 0 {
|
||||
return ns
|
||||
}
|
||||
}
|
||||
|
||||
return "default"
|
||||
}
|
||||
|
||||
@@ -64,16 +64,6 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
// run write the resource to a spec file or create a fission CRD with remote fission server.
|
||||
// It also prints warning/error if necessary.
|
||||
func (opts *CreateSubCommand) run(input cli.Input) (err error) {
|
||||
m := opts.env.ObjectMeta
|
||||
|
||||
envList, err := opts.Client().FissionClientSet.CoreV1().Environments(m.Namespace).List(input.Context(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
} else if len(envList.Items) > 0 {
|
||||
console.Verbose(2, "%d environment(s) are present in the %s namespace. "+
|
||||
"These environments are not isolated from each other; use separate namespaces if you need isolation.",
|
||||
len(envList.Items), m.Namespace)
|
||||
}
|
||||
|
||||
userDefinedNS, currentNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
||||
if err != nil {
|
||||
@@ -82,6 +72,15 @@ func (opts *CreateSubCommand) run(input cli.Input) (err error) {
|
||||
// we use user provided NS in spec. While creating actual record we use the current context's NS.
|
||||
opts.env.ObjectMeta.Namespace = userDefinedNS
|
||||
|
||||
envList, err := opts.Client().FissionClientSet.CoreV1().Environments(opts.env.ObjectMeta.Namespace).List(input.Context(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
} else if len(envList.Items) > 0 {
|
||||
console.Verbose(2, "%d environment(s) are present in the %s namespace. "+
|
||||
"These environments are not isolated from each other; use separate namespaces if you need isolation.",
|
||||
len(envList.Items), opts.env.ObjectMeta.Namespace)
|
||||
}
|
||||
|
||||
// if we're writing a spec, don't call the API
|
||||
// save to spec file or display the spec to console
|
||||
if input.Bool(flagkey.SpecDry) {
|
||||
@@ -99,7 +98,7 @@ func (opts *CreateSubCommand) run(input cli.Input) (err error) {
|
||||
return fv1.AggregateValidationErrors("Environment", err)
|
||||
}
|
||||
|
||||
specFile := fmt.Sprintf("env-%v.yaml", m.Name)
|
||||
specFile := fmt.Sprintf("env-%v.yaml", opts.env.ObjectMeta.Name)
|
||||
err = spec.SpecSave(*opts.env, specFile, false)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error saving environment spec")
|
||||
@@ -114,7 +113,7 @@ func (opts *CreateSubCommand) run(input cli.Input) (err error) {
|
||||
return errors.Wrap(err, "error creating resource")
|
||||
}
|
||||
|
||||
fmt.Printf("environment '%v' created\n", m.Name)
|
||||
fmt.Printf("environment '%v' created\n", opts.env.ObjectMeta.Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -132,17 +131,11 @@ func createEnvironmentFromCmd(input cli.Input) (*fv1.Environment, error) {
|
||||
pullSecret := input.String(flagkey.EnvImagePullSecret)
|
||||
|
||||
envVersion := input.Int(flagkey.EnvVersion)
|
||||
// Environment API interface version is not specified and
|
||||
// builder image is empty, set default interface version
|
||||
|
||||
if envVersion == 0 {
|
||||
envVersion = 1
|
||||
}
|
||||
|
||||
if input.IsSet(flagkey.EnvPoolsize) {
|
||||
// TODO: remove silently version 3 assignment, we need to warn user to set it explicitly.
|
||||
envVersion = 3
|
||||
}
|
||||
|
||||
if !input.IsSet(flagkey.EnvPoolsize) {
|
||||
console.Info("poolsize setting default to 3")
|
||||
}
|
||||
@@ -154,10 +147,6 @@ func createEnvironmentFromCmd(input cli.Input) (*fv1.Environment, error) {
|
||||
|
||||
envBuilderImg := input.String(flagkey.EnvBuilderImage)
|
||||
if len(envBuilderImg) > 0 {
|
||||
if !input.IsSet(flagkey.EnvVersion) {
|
||||
// TODO: remove set env version to 2 silently, we need to warn user to set it explicitly.
|
||||
envVersion = 2
|
||||
}
|
||||
if len(envBuildCmd) == 0 {
|
||||
envBuildCmd = "build"
|
||||
}
|
||||
@@ -191,14 +180,30 @@ func createEnvironmentFromCmd(input cli.Input) (*fv1.Environment, error) {
|
||||
Runtime: fv1.Runtime{
|
||||
Image: envImg,
|
||||
Container: &apiv1.Container{
|
||||
Env: runtimeEnvList,
|
||||
Name: envName,
|
||||
Env: runtimeEnvList,
|
||||
},
|
||||
PodSpec: &apiv1.PodSpec{
|
||||
Containers: []apiv1.Container{
|
||||
{
|
||||
Name: envName,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Builder: fv1.Builder{
|
||||
Image: envBuilderImg,
|
||||
Command: envBuildCmd,
|
||||
Container: &apiv1.Container{
|
||||
Env: builderEnvList,
|
||||
Name: fv1.BuilderContainerName,
|
||||
Env: builderEnvList,
|
||||
},
|
||||
PodSpec: &apiv1.PodSpec{
|
||||
Containers: []apiv1.Container{
|
||||
{
|
||||
Name: fv1.BuilderContainerName,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Poolsize: poolsize,
|
||||
|
||||
@@ -97,9 +97,6 @@ func (opts *UpdateSubCommand) run(input cli.Input) error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error updating environment")
|
||||
}
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error updating environment")
|
||||
}
|
||||
|
||||
fmt.Printf("environment '%v' updated\n", enew.ObjectMeta.Name)
|
||||
return nil
|
||||
|
||||
@@ -98,6 +98,11 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
|
||||
fnIdleTimeout := input.Int(flagkey.FnIdleTimeout)
|
||||
|
||||
err = checkExecutorPoolManager(input, fv1.ExecutorTypePoolmgr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fnConcurrency := DEFAULT_CONCURRENCY
|
||||
if input.IsSet(flagkey.FnConcurrency) {
|
||||
fnConcurrency = input.Int(flagkey.FnConcurrency)
|
||||
@@ -334,7 +339,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// generatePackgeName => will return package name by appending id in function name and will make sure that package name will never be more than length of 63 characters.
|
||||
// generatePackageName => will return package name by appending id in function name and will make sure that package name will never be more than length of 63 characters.
|
||||
func generatePackageName(fnName string, id string) string {
|
||||
var (
|
||||
lenFnName int = len(fnName)
|
||||
@@ -447,6 +452,33 @@ func getInvokeStrategy(input cli.Input, existingInvokeStrategy *fv1.InvokeStrate
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Show warning when --con, --rpp and --yolo flags are used with executortype other than `poolmgr`.
|
||||
// These flags are specifically introduced for executortype `poolmgr`.
|
||||
func checkExecutorPoolManager(input cli.Input, existingExecutorType fv1.ExecutorType) error {
|
||||
var isNotPoolManager bool
|
||||
if input.IsSet(flagkey.EnvExecutorType) {
|
||||
executorType, err := getExecutorType(input)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
isNotPoolManager = (string(executorType) != string(fv1.ExecutorTypePoolmgr))
|
||||
} else {
|
||||
isNotPoolManager = (string(existingExecutorType) != string(fv1.ExecutorTypePoolmgr))
|
||||
}
|
||||
|
||||
if input.IsSet(flagkey.FnConcurrency) && isNotPoolManager {
|
||||
console.Warn("--concurrency is only valid for executortype; `poolmgr`. Check `fission function create --help`")
|
||||
}
|
||||
if input.IsSet(flagkey.FnRequestsPerPod) && isNotPoolManager {
|
||||
console.Warn("--requestsperpod is only valid for executortype; `poolmgr`. Check `fission function create --help`")
|
||||
}
|
||||
if input.IsSet(flagkey.FnOnceOnly) && isNotPoolManager {
|
||||
console.Warn("--onceonly is only valid for executortype; `poolmgr`. Check `fission function create --help`")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func getExecutorType(input cli.Input) (executorType fv1.ExecutorType, err error) {
|
||||
switch input.String(flagkey.FnExecutorType) {
|
||||
case "":
|
||||
|
||||
@@ -108,7 +108,7 @@ func (opts *TestSubCommand) do(input cli.Input) error {
|
||||
)
|
||||
|
||||
fnTestTimeout := input.Duration(flagkey.FnTestTimeout)
|
||||
fnSpecTimeout := time.Duration(function.Spec.FunctionTimeout)
|
||||
fnSpecTimeout := time.Duration(function.Spec.FunctionTimeout) * time.Second
|
||||
|
||||
if input.IsSet(flagkey.FnTestTimeout) && (fnTestTimeout < fnSpecTimeout) {
|
||||
reqTimeout = fnTestTimeout
|
||||
@@ -121,7 +121,7 @@ func (opts *TestSubCommand) do(input cli.Input) error {
|
||||
ctx = input.Context()
|
||||
} else {
|
||||
var closeCtx context.CancelFunc
|
||||
ctx, closeCtx = context.WithTimeoutCause(input.Context(), reqTimeout*time.Second, fmt.Errorf("function request timeout (%d)s exceeded", reqTimeout))
|
||||
ctx, closeCtx = context.WithTimeoutCause(input.Context(), reqTimeout, fmt.Errorf("function request timeout (%d)s exceeded", reqTimeout))
|
||||
defer closeCtx()
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
||||
}
|
||||
|
||||
envName := input.String(flagkey.FnEnvironmentName)
|
||||
envNamespace := input.String(flagkey.NamespaceEnvironment)
|
||||
// if the new env specified is the same as the old one, no need to update package
|
||||
// same is true for all update parameters, but, for now, we don't check all of them - because, its ok to
|
||||
// re-write the object with same old values, we just end up getting a new resource version for the object.
|
||||
@@ -75,10 +74,6 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
||||
envName = ""
|
||||
}
|
||||
|
||||
if envNamespace == function.Spec.Environment.Namespace {
|
||||
envNamespace = ""
|
||||
}
|
||||
|
||||
pkgName := input.String(flagkey.FnPackageName)
|
||||
entrypoint := input.String(flagkey.FnEntrypoint)
|
||||
|
||||
@@ -133,10 +128,6 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
||||
function.Spec.Environment.Name = envName
|
||||
}
|
||||
|
||||
if len(envNamespace) > 0 {
|
||||
function.Spec.Environment.Namespace = envNamespace
|
||||
}
|
||||
|
||||
if len(entrypoint) > 0 {
|
||||
function.Spec.Package.FunctionName = entrypoint
|
||||
}
|
||||
@@ -154,6 +145,11 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
||||
function.Spec.IdleTimeout = &fnTimeout
|
||||
}
|
||||
|
||||
err = checkExecutorPoolManager(input, function.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if input.IsSet(flagkey.FnConcurrency) {
|
||||
function.Spec.Concurrency = input.Int(flagkey.FnConcurrency)
|
||||
}
|
||||
|
||||
@@ -107,9 +107,6 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
}
|
||||
|
||||
methods := input.StringSlice(flagkey.HtMethod)
|
||||
if len(methods) == 0 {
|
||||
return errors.New("HTTP methods not mentioned")
|
||||
}
|
||||
|
||||
for _, method := range methods {
|
||||
_, err := GetMethod(method)
|
||||
@@ -166,7 +163,6 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
}
|
||||
}
|
||||
|
||||
createIngress := input.Bool(flagkey.HtIngress)
|
||||
ingressConfig, err := GetIngressConfig(
|
||||
input.StringSlice(flagkey.HtIngressAnnotation), input.String(flagkey.HtIngressRule),
|
||||
input.String(flagkey.HtIngressTLS), fallbackURL, nil)
|
||||
@@ -174,26 +170,20 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
return errors.Wrap(err, "error parsing ingress configuration")
|
||||
}
|
||||
|
||||
host := input.String(flagkey.HtHost)
|
||||
|
||||
opts.trigger = &fv1.HTTPTrigger{
|
||||
ObjectMeta: m,
|
||||
Spec: fv1.HTTPTriggerSpec{
|
||||
Host: host,
|
||||
Host: input.String(flagkey.HtHost),
|
||||
RelativeURL: triggerUrl,
|
||||
Methods: methods,
|
||||
FunctionReference: *functionRef,
|
||||
CreateIngress: createIngress,
|
||||
CreateIngress: input.Bool(flagkey.HtIngress),
|
||||
IngressConfig: *ingressConfig,
|
||||
Prefix: &prefix,
|
||||
KeepPrefix: input.Bool(flagkey.HtKeepPrefix),
|
||||
},
|
||||
}
|
||||
|
||||
if input.IsSet(flagkey.HtKeepPrefix) {
|
||||
opts.trigger.Spec.KeepPrefix = input.Bool(flagkey.HtKeepPrefix)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ func (opts *CreateSubCommand) run(input cli.Input) error {
|
||||
|
||||
func checkMQTopicAvailability(mqType fv1.MessageQueueType, mqtKind string, topics ...string) error {
|
||||
for _, t := range topics {
|
||||
if len(t) > 0 && !validator.IsValidTopic(mqtKind) {
|
||||
if len(t) > 0 && !validator.IsValidTopic((string)(mqType), t, mqtKind) {
|
||||
return errors.Errorf("invalid topic for %s: %s", mqType, t)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,8 @@ func (opts *UpdateSubCommand) complete(input cli.Input) (err error) {
|
||||
}
|
||||
|
||||
if input.IsSet(flagkey.MqtMetadata) {
|
||||
updated = updated || util.UpdateMapFromStringSlice(&mqt.Spec.Metadata, metadataParams)
|
||||
_ = util.UpdateMapFromStringSlice(&mqt.Spec.Metadata, metadataParams)
|
||||
updated = true
|
||||
}
|
||||
if input.IsSet(flagkey.MqtSecret) {
|
||||
mqt.Spec.Secret = secret
|
||||
|
||||
@@ -155,7 +155,7 @@ func CreatePackage(input cli.Input, client cmd.Client, pkgName string, pkgNamesp
|
||||
}
|
||||
deployment, err := CreateArchive(client, input, deployArchiveFiles, noZip, insecure, deployChecksum, specDir, specFile)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error creating source archive")
|
||||
return nil, errors.Wrap(err, "error creating deploy archive")
|
||||
}
|
||||
pkgSpec.Deployment = *deployment
|
||||
if len(pkgName) == 0 {
|
||||
@@ -165,7 +165,7 @@ func CreatePackage(input cli.Input, client cmd.Client, pkgName string, pkgNamesp
|
||||
if len(srcArchiveFiles) > 0 {
|
||||
source, err := CreateArchive(client, input, srcArchiveFiles, false, insecure, srcChecksum, specDir, specFile)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error creating deploy archive")
|
||||
return nil, errors.Wrap(err, "error creating source archive")
|
||||
}
|
||||
pkgSpec.Source = *source
|
||||
pkgStatus = fv1.BuildStatusPending // set package build status to pending
|
||||
|
||||
@@ -29,10 +29,7 @@ import (
|
||||
"github.com/fission/fission/pkg/fission-cli/cmd"
|
||||
pkgutil "github.com/fission/fission/pkg/fission-cli/cmd/package/util"
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
)
|
||||
|
||||
const (
|
||||
deployArchive = iota
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
)
|
||||
|
||||
type GetSubCommand struct {
|
||||
@@ -40,15 +37,19 @@ type GetSubCommand struct {
|
||||
name string
|
||||
namespace string
|
||||
output string
|
||||
archiveType int
|
||||
archiveType string
|
||||
}
|
||||
|
||||
func GetSrc(input cli.Input) error {
|
||||
return (&GetSubCommand{}).do(input)
|
||||
opts := &GetSubCommand{}
|
||||
opts.archiveType = util.SOURCE_ARCHIVE
|
||||
return opts.do(input)
|
||||
}
|
||||
|
||||
func GetDeploy(input cli.Input) error {
|
||||
return (&GetSubCommand{}).do(input)
|
||||
opts := &GetSubCommand{}
|
||||
opts.archiveType = util.DEPLOY_ARCHIVE
|
||||
return opts.do(input)
|
||||
}
|
||||
|
||||
func (opts *GetSubCommand) do(input cli.Input) error {
|
||||
@@ -70,7 +71,6 @@ func (opts *GetSubCommand) complete(input cli.Input) (err error) {
|
||||
}
|
||||
|
||||
func (opts *GetSubCommand) run(input cli.Input) error {
|
||||
|
||||
pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(opts.namespace).Get(input.Context(), opts.name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -78,13 +78,13 @@ func (opts *GetSubCommand) run(input cli.Input) error {
|
||||
|
||||
var reader io.Reader
|
||||
archive := pkg.Spec.Source
|
||||
if opts.archiveType == deployArchive {
|
||||
if (opts.archiveType == util.DEPLOY_ARCHIVE || archive.Type == "") && (pkg.Spec.Deployment.Type != "") {
|
||||
archive = pkg.Spec.Deployment
|
||||
}
|
||||
|
||||
if pkg.Spec.Deployment.Type == fv1.ArchiveTypeLiteral {
|
||||
if archive.Type == fv1.ArchiveTypeLiteral {
|
||||
reader = bytes.NewReader(archive.Literal)
|
||||
} else if pkg.Spec.Deployment.Type == fv1.ArchiveTypeUrl {
|
||||
} else if archive.Type == fv1.ArchiveTypeUrl {
|
||||
|
||||
readCloser, err := pkgutil.DownloadStrorageURL(input.Context(), opts.Client(), archive.URL)
|
||||
if err != nil {
|
||||
|
||||
@@ -59,13 +59,10 @@ func (opts *InfoSubCommand) complete(input cli.Input) (err error) {
|
||||
|
||||
func (opts *InfoSubCommand) run(input cli.Input) error {
|
||||
pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(opts.namespace).Get(input.Context(), opts.name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error finding package %s", opts.name)
|
||||
}
|
||||
|
||||
pkgutil.PrintPackageSummary(os.Stdout, pkg)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ func CreateArchive(client cmd.Client, input cli.Input, includeFiles []string, no
|
||||
return &archive, nil
|
||||
}
|
||||
|
||||
archivePath, err := makeArchiveFile("", includeFiles, noZip)
|
||||
archivePath, err := makeArchiveFile(input.Context(), "", includeFiles, noZip)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -200,7 +200,7 @@ func CreateArchive(client cmd.Client, input cli.Input, includeFiles []string, no
|
||||
// returned as-is with no zipping. (This is used for compatibility
|
||||
// with v1 envs.) noZip is IGNORED if there is more than one input
|
||||
// file.
|
||||
func makeArchiveFile(archiveNameHint string, archiveInput []string, noZip bool) (string, error) {
|
||||
func makeArchiveFile(ctx context.Context, archiveNameHint string, archiveInput []string, noZip bool) (string, error) {
|
||||
|
||||
// Unique name for the archive
|
||||
archiveFileName := archiveName(archiveNameHint, archiveInput) + ".zip"
|
||||
@@ -219,7 +219,7 @@ func makeArchiveFile(archiveNameHint string, archiveInput []string, noZip bool)
|
||||
}
|
||||
|
||||
// if it's an existing zip file OR we're not supposed to zip it, don't do anything
|
||||
if match, _ := utils.IsZip(files[0]); match || noZip {
|
||||
if match, _ := utils.IsZip(ctx, files[0]); match || noZip {
|
||||
return files[0], nil
|
||||
}
|
||||
}
|
||||
@@ -230,7 +230,7 @@ func makeArchiveFile(archiveNameHint string, archiveInput []string, noZip bool)
|
||||
return "", errors.Wrap(err, "error create temporary archive directory")
|
||||
}
|
||||
|
||||
archivePath, err := utils.MakeZipArchive(filepath.Join(tmpDir, archiveFileName), archiveInput...)
|
||||
archivePath, err := utils.MakeZipArchiveWithGlobs(ctx, filepath.Join(tmpDir, archiveFileName), archiveInput...)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "create archive file")
|
||||
}
|
||||
|
||||
@@ -58,10 +58,7 @@ func (opts *RebuildSubCommand) complete(input cli.Input) (err error) {
|
||||
func (opts *RebuildSubCommand) run(input cli.Input) error {
|
||||
pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(opts.namespace).Get(input.Context(), opts.name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "find package")
|
||||
return errors.Wrapf(err, "package %s not found", opts.name)
|
||||
}
|
||||
|
||||
if pkg.Status.BuildStatus != fv1.BuildStatusFailed {
|
||||
|
||||
@@ -66,10 +66,7 @@ func (opts *UpdateSubCommand) run(input cli.Input) error {
|
||||
pkgName := input.String(flagkey.PkgName)
|
||||
pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(opts.pkgNamespace).Get(input.Context(), opts.pkgName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "get package")
|
||||
return errors.Wrap(err, "error getting package")
|
||||
}
|
||||
|
||||
forceUpdate := input.Bool(flagkey.PkgForce)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user