Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82e1ff76a5 | ||
|
|
e7cfb06afa | ||
|
|
d9d9d226d3 | ||
|
|
bcd1872ffa | ||
|
|
0bd3a5957b | ||
|
|
a450dfebc7 | ||
|
|
5f90095470 | ||
|
|
eb865e137f | ||
|
|
b7819fda76 | ||
|
|
0e2883d0c6 | ||
|
|
a8322b5ed2 | ||
|
|
43dc34ee8f | ||
|
|
0300051e7c | ||
|
|
b8cb98510f | ||
|
|
20e0f6af45 | ||
|
|
50b061527e | ||
|
|
22b30cf92f | ||
|
|
e0c7a80fe0 | ||
|
|
87cfb2fb20 | ||
|
|
ebdce4c0ed | ||
|
|
4ebdb077b5 | ||
|
|
2eb14db055 | ||
|
|
776dec14b7 | ||
|
|
320b1dd5a9 | ||
|
|
a6ecd0496f | ||
|
|
7f3a003200 | ||
|
|
8b1f0ba0b9 | ||
|
|
84631f03c5 | ||
|
|
e506ba2326 | ||
|
|
c5171cf014 | ||
|
|
757b84f952 | ||
|
|
0e89f8af41 | ||
|
|
7403598df9 | ||
|
|
322d3a21b0 | ||
|
|
aa9a2142b8 | ||
|
|
ed64644d10 | ||
|
|
45d6132ffd | ||
|
|
b26e28e733 | ||
|
|
2b13af0a5e | ||
|
|
6cc6498844 | ||
|
|
313ceef1ed | ||
|
|
9e275e7ced | ||
|
|
3ee30cf4f1 | ||
|
|
0ea24b399d | ||
|
|
aea8e0a470 | ||
|
|
ba13d1fd79 | ||
|
|
8ec6f313a4 | ||
|
|
0b4b78ff21 | ||
|
|
52f0b47273 | ||
|
|
df4a121d77 | ||
|
|
f839142530 | ||
|
|
b58525263e | ||
|
|
46c99e382f | ||
|
|
268fee7f94 | ||
|
|
caffed92f4 | ||
|
|
2fd44174ce | ||
|
|
7119380716 | ||
|
|
5eed09a8fc | ||
|
|
3e253c2ee4 | ||
|
|
8d70da4d8e |
@@ -20,6 +20,8 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
open-pull-requests-limit: 5
|
open-pull-requests-limit: 5
|
||||||
|
exclude-paths:
|
||||||
|
- "test/**"
|
||||||
groups:
|
groups:
|
||||||
docker-images:
|
docker-images:
|
||||||
patterns:
|
patterns:
|
||||||
@@ -30,7 +32,31 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
open-pull-requests-limit: 5
|
open-pull-requests-limit: 5
|
||||||
|
exclude-paths:
|
||||||
|
- "test/**"
|
||||||
groups:
|
groups:
|
||||||
go-dependencies:
|
go-dependencies:
|
||||||
patterns:
|
patterns:
|
||||||
- "*"
|
- "*"
|
||||||
|
|
||||||
|
- package-ecosystem: helm
|
||||||
|
directory: /charts/fission-all
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
groups:
|
||||||
|
helm-charts:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
exclude-paths:
|
||||||
|
- "test/**"
|
||||||
|
groups:
|
||||||
|
npm-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
@@ -14,6 +14,10 @@ on:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-codeql-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
CodeQL-Build:
|
CodeQL-Build:
|
||||||
permissions:
|
permissions:
|
||||||
@@ -24,23 +28,23 @@ jobs:
|
|||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: setup go
|
- name: setup go
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
|
uses: github/codeql-action/init@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
|
||||||
with:
|
with:
|
||||||
languages: go
|
languages: go
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
|
uses: github/codeql-action/analyze@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
|
||||||
|
|||||||
@@ -12,16 +12,20 @@ on: [pull_request]
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-dependency-review-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
dependency-review:
|
dependency-review:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: 'Checkout Repository'
|
- name: 'Checkout Repository'
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
- name: 'Dependency Review'
|
- name: 'Dependency Review'
|
||||||
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
|
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
|
||||||
|
|||||||
@@ -21,22 +21,17 @@ jobs:
|
|||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
|
|
||||||
- name: Install dashboard linter
|
|
||||||
run: |
|
|
||||||
go get github.com/grafana/dashboard-linter
|
|
||||||
go install github.com/grafana/dashboard-linter
|
|
||||||
|
|
||||||
- name: Run dashboard linter
|
- name: Run dashboard linter
|
||||||
run: ./hack/lint-dashboards.sh
|
run: ./hack/lint-dashboards.sh
|
||||||
|
|||||||
@@ -17,12 +17,16 @@ on:
|
|||||||
- go.sum
|
- go.sum
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GOLANGCI_LINT_VERSION: v1.63.4
|
GOLANGCI_LINT_VERSION: v2.6.2
|
||||||
GOLANGCI_LINT_TIMEOUT: 5m
|
GOLANGCI_LINT_TIMEOUT: 5m
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-lint-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
permissions:
|
permissions:
|
||||||
@@ -32,15 +36,15 @@ jobs:
|
|||||||
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
@@ -51,7 +55,7 @@ jobs:
|
|||||||
go mod download
|
go mod download
|
||||||
|
|
||||||
- name: Run golangci-lint
|
- name: Run golangci-lint
|
||||||
uses: golangci/golangci-lint-action@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0
|
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
|
||||||
with:
|
with:
|
||||||
skip-cache: true
|
skip-cache: true
|
||||||
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
||||||
@@ -72,7 +76,7 @@ jobs:
|
|||||||
run: ./hack/runtests.sh
|
run: ./hack/runtests.sh
|
||||||
|
|
||||||
- name: Upload Coverage report to CodeCov
|
- name: Upload Coverage report to CodeCov
|
||||||
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
|
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
flags: unittests
|
flags: unittests
|
||||||
|
|||||||
@@ -22,13 +22,18 @@ on:
|
|||||||
- go.sum
|
- go.sum
|
||||||
|
|
||||||
env:
|
env:
|
||||||
HELM_VERSION: v3.16.4
|
HELM_VERSION: v4.0.1
|
||||||
KIND_VERSION: v0.26.0
|
KIND_VERSION: v0.30.0
|
||||||
KIND_CLUSTER_NAME: kind
|
KIND_CLUSTER_NAME: kind
|
||||||
|
SKAFFOLD_VERSION: v2.17.0
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-ci-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Job to run change detection
|
# Job to run change detection
|
||||||
integration-test:
|
integration-test:
|
||||||
@@ -37,36 +42,36 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
kindversion: ["v1.28.15", "v1.30.8", "v1.32.0"]
|
kindversion: ["v1.28.15", "v1.32.8", "v1.34.0"]
|
||||||
os: [ubuntu-24.04]
|
os: [ubuntu-24.04]
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: setup go
|
- name: setup go
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
repository: fission/examples
|
repository: fission/examples
|
||||||
path: examples
|
path: examples
|
||||||
|
|
||||||
- name: Helm installation
|
- name: Helm installation
|
||||||
uses: Azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
uses: Azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
|
||||||
with:
|
with:
|
||||||
version: ${{ env.HELM_VERSION }}
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
- name: Kind Cluster
|
- name: Kind Cluster
|
||||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
|
||||||
with:
|
with:
|
||||||
node_image: kindest/node:${{ matrix.kindversion }}
|
node_image: kindest/node:${{ matrix.kindversion }}
|
||||||
version: ${{ env.KIND_VERSION }}
|
version: ${{ env.KIND_VERSION }}
|
||||||
@@ -87,12 +92,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Skaffold
|
- name: Install Skaffold
|
||||||
run: |
|
run: |
|
||||||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.13.2/skaffold-linux-amd64
|
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/${{ env.SKAFFOLD_VERSION }}/skaffold-linux-amd64
|
||||||
sudo install skaffold /usr/local/bin/
|
sudo install skaffold /usr/local/bin/
|
||||||
skaffold version
|
skaffold version
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
@@ -153,7 +158,7 @@ jobs:
|
|||||||
- name: Archive fission dump
|
- name: Archive fission dump
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ failure() || cancelled() }}
|
if: ${{ failure() || cancelled() }}
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: fission-dump/*.zip
|
path: fission-dump/*.zip
|
||||||
@@ -162,7 +167,7 @@ jobs:
|
|||||||
- name: Archive prometheus dump
|
- name: Archive prometheus dump
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: /tmp/prometheus/*
|
path: /tmp/prometheus/*
|
||||||
@@ -171,7 +176,7 @@ jobs:
|
|||||||
- name: Archive kind logs
|
- name: Archive kind logs
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: kind-logs/*
|
path: kind-logs/*
|
||||||
@@ -185,36 +190,36 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
kindversion: ["v1.19.16"]
|
kindversion: ["v1.31.12"]
|
||||||
os: [ubuntu-24.04]
|
os: [ubuntu-24.04]
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: setup go
|
- name: setup go
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
repository: fission/examples
|
repository: fission/examples
|
||||||
path: examples
|
path: examples
|
||||||
|
|
||||||
- name: Helm installation
|
- name: Helm installation
|
||||||
uses: Azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
uses: Azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
|
||||||
with:
|
with:
|
||||||
version: ${{ env.HELM_VERSION }}
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
- name: Kind Cluster
|
- name: Kind Cluster
|
||||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
|
||||||
with:
|
with:
|
||||||
node_image: kindest/node:${{ matrix.kindversion }}
|
node_image: kindest/node:${{ matrix.kindversion }}
|
||||||
version: ${{ env.KIND_VERSION }}
|
version: ${{ env.KIND_VERSION }}
|
||||||
@@ -235,12 +240,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Skaffold
|
- name: Install Skaffold
|
||||||
run: |
|
run: |
|
||||||
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.13.2/skaffold-linux-amd64
|
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/${{ env.SKAFFOLD_VERSION }}/skaffold-linux-amd64
|
||||||
sudo install skaffold /usr/local/bin/
|
sudo install skaffold /usr/local/bin/
|
||||||
skaffold version
|
skaffold version
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
@@ -304,7 +309,7 @@ jobs:
|
|||||||
- name: Archive fission dump
|
- name: Archive fission dump
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ failure() || cancelled() }}
|
if: ${{ failure() || cancelled() }}
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: fission-dump/*.zip
|
path: fission-dump/*.zip
|
||||||
@@ -313,7 +318,7 @@ jobs:
|
|||||||
- name: Archive prometheus dump
|
- name: Archive prometheus dump
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: prom-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: /tmp/prometheus/*
|
path: /tmp/prometheus/*
|
||||||
@@ -322,7 +327,7 @@ jobs:
|
|||||||
- name: Archive kind logs
|
- name: Archive kind logs
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: kind-logs/*
|
path: kind-logs/*
|
||||||
|
|||||||
+48
-121
@@ -6,36 +6,36 @@ on:
|
|||||||
- v2.**
|
- v2.**
|
||||||
|
|
||||||
env:
|
env:
|
||||||
KIND_VERSION: v0.26.0
|
KIND_VERSION: v0.30.0
|
||||||
KIND_NODE_IMAGE_TAG: v1.28.15
|
KIND_NODE_IMAGE_TAG: v1.28.15
|
||||||
KIND_CLUSTER_NAME: kind
|
KIND_CLUSTER_NAME: kind
|
||||||
COSIGN_VERSION: v2.4.1
|
COSIGN_VERSION: v3.0.3
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-draft-release:
|
create-draft-release:
|
||||||
name: Create Draft Release with Goreleaser
|
name: Create Draft Release with Goreleaser
|
||||||
outputs:
|
outputs:
|
||||||
hashes: ${{ steps.binary.outputs.hashes }}
|
|
||||||
ghcr_images: ${{ steps.image.outputs.ghcr_images }}
|
ghcr_images: ${{ steps.image.outputs.ghcr_images }}
|
||||||
version: ${{ steps.get_version.outputs.VERSION }}
|
version: ${{ steps.get_version.outputs.VERSION }}
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # for goreleaser/goreleaser-action to create a GitHub release
|
contents: write # for goreleaser/goreleaser-action to create a GitHub release
|
||||||
packages: write # for goreleaser/goreleaser-action to upload artifacts to GitHub Packages
|
packages: write # for goreleaser/goreleaser-action to upload artifacts to GitHub Packages
|
||||||
id-token: write # for cosign to sign the image and binary
|
id-token: write # for cosign to sign the image and binary
|
||||||
|
attestations: write # for goreleaser/goreleaser-action to upload attestations
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
@@ -45,13 +45,13 @@ jobs:
|
|||||||
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
|
|
||||||
- name: Kind Cluster
|
- name: Kind Cluster
|
||||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
|
||||||
with:
|
with:
|
||||||
node_image: kindest/node:${{ env.KIND_NODE_IMAGE_TAG }}
|
node_image: kindest/node:${{ env.KIND_NODE_IMAGE_TAG }}
|
||||||
version: ${{ env.KIND_VERSION }}
|
version: ${{ env.KIND_VERSION }}
|
||||||
@@ -59,24 +59,27 @@ jobs:
|
|||||||
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
|
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
||||||
|
|
||||||
- name: Login to ghcr.io
|
- name: Login to ghcr.io
|
||||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install Cosign
|
- name: Install Cosign
|
||||||
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
|
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
|
||||||
with:
|
with:
|
||||||
cosign-release: ${{ env.COSIGN_VERSION }}
|
cosign-release: ${{ env.COSIGN_VERSION }}
|
||||||
|
|
||||||
- name: Check cosign install!
|
- name: Check cosign install!
|
||||||
run: cosign version
|
run: cosign version
|
||||||
|
|
||||||
- uses: anchore/sbom-action/download-syft@df80a981bc6edbc4e220a492d3cbe9f5547a6e75 #v0.17.9
|
- uses: anchore/sbom-action/download-syft@43a17d6e7add2b5535efe4dcae9952337c479a93 #v0.20.11
|
||||||
|
|
||||||
- name: Generate yaml for manifest, Minikube and Openshift installation
|
- name: Generate yaml for manifest, Minikube and Openshift installation
|
||||||
run: ${GITHUB_WORKSPACE}/hack/build-yaml.sh $VERSION
|
run: ${GITHUB_WORKSPACE}/hack/build-yaml.sh $VERSION
|
||||||
@@ -86,7 +89,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
id: goreleaser
|
id: goreleaser
|
||||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
args: release
|
args: release
|
||||||
@@ -95,15 +98,12 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||||
|
|
||||||
- name: Generate binary hashes
|
# Attest binary artifacts
|
||||||
id: binary
|
# https://goreleaser.com/customization/attestations/
|
||||||
env:
|
- name: Attest binary artifacts
|
||||||
ARTIFACTS: "${{ steps.goreleaser.outputs.artifacts }}"
|
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
|
||||||
run: |
|
with:
|
||||||
set -euo pipefail
|
subject-checksums: ./dist/checksums.txt
|
||||||
|
|
||||||
checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
|
|
||||||
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
id: image
|
id: image
|
||||||
@@ -111,7 +111,7 @@ jobs:
|
|||||||
ARTIFACTS: "${{ steps.goreleaser.outputs.artifacts }}"
|
ARTIFACTS: "${{ steps.goreleaser.outputs.artifacts }}"
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
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)
|
image_and_digest=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Docker Image") | {name, "digest": (.extra.Digest // .extra.Checksum)} | select(.digest) | {name} + {digest} | join("@") | sub("^sha256:";"")' | grep -v latest)
|
||||||
ghcr_images=$(echo "${image_and_digest}" | grep ghcr.io | jq -R -s -c '
|
ghcr_images=$(echo "${image_and_digest}" | grep ghcr.io | jq -R -s -c '
|
||||||
split("\n")
|
split("\n")
|
||||||
| map(select(. != ""))
|
| map(select(. != ""))
|
||||||
@@ -124,40 +124,8 @@ jobs:
|
|||||||
)')
|
)')
|
||||||
echo "ghcr_images=$ghcr_images" >> "$GITHUB_OUTPUT"
|
echo "ghcr_images=$ghcr_images" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
binary-provenance:
|
image-sbom-provenance-ghcr:
|
||||||
name: Create Binary Provenance
|
name: Create SBOM & Provenance for container images
|
||||||
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.
|
# Goreleaser does not support generating SBOM for container images.
|
||||||
needs: [create-draft-release]
|
needs: [create-draft-release]
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@@ -168,82 +136,41 @@ jobs:
|
|||||||
actions: write
|
actions: write
|
||||||
id-token: write
|
id-token: write
|
||||||
packages: write
|
packages: write
|
||||||
|
attestations: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Run Trivy in fs mode to generate SBOM
|
- name: Run Trivy in fs mode to generate SBOM
|
||||||
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # v0.29.0
|
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # v0.33.1
|
||||||
with:
|
with:
|
||||||
scan-type: "fs"
|
scan-type: "fs"
|
||||||
format: "spdx-json"
|
format: "spdx-json"
|
||||||
output: "spdx.sbom.json"
|
output: "sbom.spdx.json"
|
||||||
- name: Install Cosign
|
- name: Attest SBOM for image
|
||||||
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
|
uses: actions/attest-sbom@4651f806c01d8637787e274ac3bdf724ef169f34 # v3.0.0
|
||||||
with:
|
with:
|
||||||
cosign-release: ${{ env.COSIGN_VERSION }}
|
sbom-path: sbom.spdx.json
|
||||||
- name: Sign image and sbom
|
subject-name: ${{ fromJson(toJson(matrix)).image }}
|
||||||
env:
|
subject-digest: ${{ fromJson(toJson(matrix)).checksum }}
|
||||||
IMAGE: ${{ fromJson(toJson(matrix)).image }}
|
push-to-registry: true
|
||||||
DIGEST: ${{ fromJson(toJson(matrix)).checksum }}
|
- name: Attest provenance for image
|
||||||
run: |
|
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
|
||||||
#!/usr/bin/env bash
|
with:
|
||||||
set -euo pipefail
|
subject-name: ${{ fromJson(toJson(matrix)).image }}
|
||||||
cosign attach sbom --sbom spdx.sbom.json $IMAGE@$DIGEST
|
subject-digest: ${{ fromJson(toJson(matrix)).checksum }}
|
||||||
cosign sign -a git_sha=$GITHUB_SHA --attachment sbom $IMAGE@$DIGEST --yes
|
push-to-registry: true
|
||||||
|
|
||||||
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:
|
image-provenance-verification-with-cosign:
|
||||||
name: Verify Image Provenance
|
name: Verify Image Provenance
|
||||||
needs: [create-draft-release, image-provenance-ghcr]
|
needs: [create-draft-release, image-sbom-provenance-ghcr]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include: ${{ fromJson(needs.create-draft-release.outputs.ghcr_images) }}
|
include: ${{ fromJson(needs.create-draft-release.outputs.ghcr_images) }}
|
||||||
@@ -251,14 +178,14 @@ jobs:
|
|||||||
permissions: read-all
|
permissions: read-all
|
||||||
steps:
|
steps:
|
||||||
- name: Login
|
- name: Login
|
||||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install Cosign
|
- name: Install Cosign
|
||||||
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
|
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
|
||||||
with:
|
with:
|
||||||
cosign-release: ${{ env.COSIGN_VERSION }}
|
cosign-release: ${{ env.COSIGN_VERSION }}
|
||||||
|
|
||||||
@@ -269,7 +196,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Verifying $IMAGE@$DIGEST"
|
echo "Verifying $IMAGE@$DIGEST"
|
||||||
cosign verify-attestation \
|
cosign verify-attestation \
|
||||||
--type slsaprovenance \
|
--type https://slsa.dev/provenance/v1 \
|
||||||
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
--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]+$' \
|
--certificate-identity-regexp '^https://github.com/fission/fission/.github/workflows/release.yaml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$' \
|
||||||
$IMAGE@$DIGEST
|
$IMAGE@$DIGEST
|
||||||
|
|||||||
@@ -32,17 +32,17 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: "Checkout code"
|
- name: "Checkout code"
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: "Run analysis"
|
- name: "Run analysis"
|
||||||
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
|
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||||
with:
|
with:
|
||||||
results_file: results.sarif
|
results_file: results.sarif
|
||||||
results_format: sarif
|
results_format: sarif
|
||||||
@@ -64,7 +64,7 @@ jobs:
|
|||||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||||
# format to the repository Actions tab.
|
# format to the repository Actions tab.
|
||||||
- name: "Upload artifact"
|
- name: "Upload artifact"
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v3.pre.node20
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v3.pre.node20
|
||||||
with:
|
with:
|
||||||
name: SARIF file
|
name: SARIF file
|
||||||
path: results.sarif
|
path: results.sarif
|
||||||
@@ -73,6 +73,6 @@ jobs:
|
|||||||
# Upload the results to GitHub's code scanning dashboard (optional).
|
# Upload the results to GitHub's code scanning dashboard (optional).
|
||||||
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
|
||||||
- name: "Upload to code-scanning"
|
- name: "Upload to code-scanning"
|
||||||
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
|
uses: github/codeql-action/upload-sarif@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
|
|||||||
@@ -22,13 +22,17 @@ on:
|
|||||||
- go.sum
|
- go.sum
|
||||||
|
|
||||||
env:
|
env:
|
||||||
HELM_VERSION: v3.16.4
|
HELM_VERSION: v3.19.0
|
||||||
KIND_VERSION: v0.26.0
|
KIND_VERSION: v0.30.0
|
||||||
KIND_CLUSTER_NAME: kind
|
KIND_CLUSTER_NAME: kind
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: fission-upgrade-test-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upgrade-test:
|
upgrade-test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -36,37 +40,37 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
kindversion: ["v1.28.15"]
|
kindversion: ["v1.31.12"]
|
||||||
os: [ubuntu-24.04]
|
os: [ubuntu-24.04]
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Checkout action sources
|
- name: Checkout action sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Setup Helm
|
- name: Setup Helm
|
||||||
uses: Azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
uses: Azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
|
||||||
with:
|
with:
|
||||||
version: ${{ env.HELM_VERSION }}
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
- name: Setup Kind Cluster
|
- name: Setup Kind Cluster
|
||||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0
|
||||||
with:
|
with:
|
||||||
node_image: kindest/node:${{ matrix.kindversion }}
|
node_image: kindest/node:${{ matrix.kindversion }}
|
||||||
version: ${{ env.KIND_VERSION }}
|
version: ${{ env.KIND_VERSION }}
|
||||||
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Install GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||||
with:
|
with:
|
||||||
install-only: true
|
install-only: true
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
@@ -114,7 +118,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Archive fission dump
|
- name: Archive fission dump
|
||||||
if: ${{ failure() || cancelled() }}
|
if: ${{ failure() || cancelled() }}
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: fission-dump-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: fission-dump/*.zip
|
path: fission-dump/*.zip
|
||||||
@@ -122,7 +126,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Archive kind logs
|
- name: Archive kind logs
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
name: kind-logs-${{ github.run_id }}-${{ matrix.kindversion }}
|
||||||
path: kind-logs/*
|
path: kind-logs/*
|
||||||
|
|||||||
+43
-27
@@ -1,35 +1,51 @@
|
|||||||
|
version: "2"
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
# Default linter
|
|
||||||
- errcheck
|
- errcheck
|
||||||
- gosimple
|
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- staticcheck
|
|
||||||
- typecheck
|
|
||||||
- unused
|
|
||||||
# Additional linters
|
|
||||||
- gofmt
|
|
||||||
- goimports
|
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- unconvert
|
|
||||||
- promlinter
|
- promlinter
|
||||||
# Enable in future
|
- unconvert
|
||||||
# - bodyclose
|
- unused
|
||||||
# - dogsled
|
- staticcheck
|
||||||
# - dupl
|
settings:
|
||||||
# - gosec
|
errcheck:
|
||||||
# - nilerr
|
exclude-functions:
|
||||||
# - prealloc
|
- (*go.uber.org/zap.Logger).Sync
|
||||||
# - revive
|
exclusions:
|
||||||
# - unparam
|
generated: lax
|
||||||
# - wrapcheck
|
presets:
|
||||||
# - gocritic
|
- comments
|
||||||
linters-settings:
|
- common-false-positives
|
||||||
errcheck:
|
- legacy
|
||||||
ignore: go.uber.org/zap:Sync
|
- std-error-handling
|
||||||
goimports:
|
paths:
|
||||||
# put imports beginning with prefix after 3rd-party packages;
|
- third_party$
|
||||||
# it's a comma-separated list of prefixes
|
- builtin$
|
||||||
local: github.com/fission/fission
|
- examples$
|
||||||
|
rules:
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
text: "QF1008"
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
text: "QF1001"
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
text: "QF1003"
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gofmt
|
||||||
|
- goimports
|
||||||
|
settings:
|
||||||
|
goimports:
|
||||||
|
local-prefixes:
|
||||||
|
- github.com/fission/fission
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
paths:
|
||||||
|
- third_party$
|
||||||
|
- builtin$
|
||||||
|
- examples$
|
||||||
|
|||||||
+84
-220
@@ -70,235 +70,100 @@ builds:
|
|||||||
id: reporter
|
id: reporter
|
||||||
binary: reporter
|
binary: reporter
|
||||||
dir: ./cmd/reporter
|
dir: ./cmd/reporter
|
||||||
dockers:
|
dockers_v2:
|
||||||
- &docker-amd64
|
- id: builder
|
||||||
use: buildx
|
tags:
|
||||||
goos: linux
|
- latest
|
||||||
goarch: amd64
|
- "{{ .Tag }}"
|
||||||
ids:
|
images:
|
||||||
- builder
|
- "{{ .Env.GHCR_REPO }}/builder"
|
||||||
image_templates:
|
labels:
|
||||||
- "{{ .Env.GHCR_REPO }}/builder:latest-amd64"
|
org.opencontainers.image.description: "The builder assists in building the fission function source code for deployment."
|
||||||
- "{{ .Env.GHCR_REPO }}/builder:{{ .Tag }}-amd64"
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
|
org.opencontainers.image.vendor: "Fission"
|
||||||
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
dockerfile: cmd/builder/Dockerfile
|
dockerfile: cmd/builder/Dockerfile
|
||||||
build_flag_templates:
|
- id: fetcher
|
||||||
- "--label=org.opencontainers.image.description=The builder assists in building the fission function source code for deployment."
|
tags:
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
- latest
|
||||||
- "--platform=linux/amd64"
|
- "{{ .Tag }}"
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
images:
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
- "{{ .Env.GHCR_REPO }}/fetcher"
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
labels:
|
||||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
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.vendor=Fission"
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- <<: *docker-amd64
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
ids:
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
- fetcher
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
image_templates:
|
org.opencontainers.image.vendor: "Fission"
|
||||||
- "{{ .Env.GHCR_REPO }}/fetcher:latest-amd64"
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
- "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}-amd64"
|
|
||||||
dockerfile: cmd/fetcher/Dockerfile
|
dockerfile: cmd/fetcher/Dockerfile
|
||||||
build_flag_templates:
|
- id: fission-bundle
|
||||||
- "--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."
|
tags:
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
- latest
|
||||||
- "--platform=linux/amd64"
|
- "{{ .Tag }}"
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
images:
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
- "{{ .Env.GHCR_REPO }}/fission-bundle"
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
labels:
|
||||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
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.vendor=Fission"
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- <<: *docker-amd64
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
ids:
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
- fission-bundle
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
image_templates:
|
org.opencontainers.image.vendor: "Fission"
|
||||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:latest-amd64"
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
- "{{ .Env.GHCR_REPO }}/fission-bundle:{{ .Tag }}-amd64"
|
|
||||||
dockerfile: cmd/fission-bundle/Dockerfile
|
dockerfile: cmd/fission-bundle/Dockerfile
|
||||||
build_flag_templates:
|
- id: pre-upgrade-checks
|
||||||
- "--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."
|
tags:
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
- latest
|
||||||
- "--platform=linux/amd64"
|
- "{{ .Tag }}"
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
images:
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks"
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
labels:
|
||||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
org.opencontainers.image.description: "Preupgradechecks ensures that Fission is ready for the targeted version upgrade by performing checks beforehand."
|
||||||
- "--label=org.opencontainers.image.vendor=Fission"
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- <<: *docker-amd64
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
ids:
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
- pre-upgrade-checks
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
image_templates:
|
org.opencontainers.image.vendor: "Fission"
|
||||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:latest-amd64"
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
- "{{ .Env.GHCR_REPO }}/pre-upgrade-checks:{{ .Tag }}-amd64"
|
|
||||||
dockerfile: cmd/preupgradechecks/Dockerfile
|
dockerfile: cmd/preupgradechecks/Dockerfile
|
||||||
build_flag_templates:
|
- id: reporter
|
||||||
- "--label=org.opencontainers.image.description=Preupgradechecks ensures that Fission is ready for the targeted version upgrade by performing checks beforehand."
|
tags:
|
||||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
- latest
|
||||||
- "--platform=linux/amd64"
|
- "{{ .Tag }}"
|
||||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
images:
|
||||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
- "{{ .Env.GHCR_REPO }}/reporter"
|
||||||
- "--label=org.opencontainers.image.version={{.Tag}}"
|
labels:
|
||||||
- "--label=org.opencontainers.image.authors=The Fission Authors https://fission.io/"
|
org.opencontainers.image.description: "The reporter gathers information that assists in improving fission."
|
||||||
- "--label=org.opencontainers.image.vendor=Fission"
|
org.opencontainers.image.source: "{{.GitURL}}"
|
||||||
- "--label=org.opencontainers.image.url=https://fission.io/"
|
org.opencontainers.image.created: "{{.Date}}"
|
||||||
- <<: *docker-amd64
|
org.opencontainers.image.revision: "{{.FullCommit}}"
|
||||||
ids:
|
org.opencontainers.image.version: "{{.Tag}}"
|
||||||
- reporter
|
org.opencontainers.image.authors: "The Fission Authors https://fission.io/"
|
||||||
image_templates:
|
org.opencontainers.image.vendor: "Fission"
|
||||||
- "{{ .Env.GHCR_REPO }}/reporter:latest-amd64"
|
org.opencontainers.image.url: "https://fission.io/"
|
||||||
- "{{ .Env.GHCR_REPO }}/reporter:{{ .Tag }}-amd64"
|
|
||||||
dockerfile: cmd/reporter/Dockerfile
|
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
|
|
||||||
goarch: arm64
|
|
||||||
ids:
|
|
||||||
- builder
|
|
||||||
image_templates:
|
|
||||||
- "{{ .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:
|
|
||||||
- "{{ .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:
|
|
||||||
- "{{ .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:
|
|
||||||
- "{{ .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:
|
|
||||||
- "{{ .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}}"
|
|
||||||
- "--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: "{{ .Env.GHCR_REPO }}/builder:{{ .Tag }}"
|
|
||||||
image_templates:
|
|
||||||
- "{{ .Env.GHCR_REPO }}/builder:{{ .Tag }}-amd64"
|
|
||||||
- "{{ .Env.GHCR_REPO }}/builder:{{ .Tag }}-arm64"
|
|
||||||
- name_template: "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}"
|
|
||||||
image_templates:
|
|
||||||
- "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}-amd64"
|
|
||||||
- "{{ .Env.GHCR_REPO }}/fetcher:{{ .Tag }}-arm64"
|
|
||||||
- name_template: "{{ .Env.GHCR_REPO }}/fission-bundle:{{ .Tag }}"
|
|
||||||
image_templates:
|
|
||||||
- "{{ .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:
|
|
||||||
- "{{ .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:
|
|
||||||
- "{{ .Env.GHCR_REPO }}/reporter:{{ .Tag }}-amd64"
|
|
||||||
- "{{ .Env.GHCR_REPO }}/reporter:{{ .Tag }}-arm64"
|
|
||||||
- name_template: "{{ .Env.GHCR_REPO }}/builder:latest"
|
|
||||||
image_templates:
|
|
||||||
- "{{ .Env.GHCR_REPO }}/builder:latest-amd64"
|
|
||||||
- "{{ .Env.GHCR_REPO }}/builder:latest-arm64"
|
|
||||||
- name_template: "{{ .Env.GHCR_REPO }}/fetcher:latest"
|
|
||||||
image_templates:
|
|
||||||
- "{{ .Env.GHCR_REPO }}/fetcher:latest-amd64"
|
|
||||||
- "{{ .Env.GHCR_REPO }}/fetcher:latest-arm64"
|
|
||||||
- name_template: "{{ .Env.GHCR_REPO }}/fission-bundle:latest"
|
|
||||||
image_templates:
|
|
||||||
- "{{ .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:
|
|
||||||
- "{{ .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:
|
|
||||||
- "{{ .Env.GHCR_REPO }}/reporter:latest-amd64"
|
|
||||||
- "{{ .Env.GHCR_REPO }}/reporter:latest-arm64"
|
|
||||||
changelog:
|
changelog:
|
||||||
disable: true
|
disable: true
|
||||||
archives:
|
archives:
|
||||||
- id: fission
|
- id: fission
|
||||||
builds:
|
ids:
|
||||||
- fission-cli
|
- fission-cli
|
||||||
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
||||||
format: binary
|
formats:
|
||||||
|
- binary
|
||||||
checksum:
|
checksum:
|
||||||
name_template: "checksums.txt"
|
name_template: "checksums.txt"
|
||||||
algorithm: sha256
|
docker_digest:
|
||||||
|
name_template: "docker-digests.txt"
|
||||||
|
|
||||||
# signs the checksum file
|
# signs the checksum file
|
||||||
# https://goreleaser.com/customization/sign
|
# https://goreleaser.com/customization/sign
|
||||||
@@ -306,13 +171,12 @@ signs:
|
|||||||
- id: cosign-binary
|
- id: cosign-binary
|
||||||
env:
|
env:
|
||||||
- COSIGN_EXPERIMENTAL=1
|
- COSIGN_EXPERIMENTAL=1
|
||||||
certificate: "${artifact}.pem"
|
signature: "${artifact}.sig.bundle"
|
||||||
cmd: cosign
|
cmd: cosign
|
||||||
artifacts: binary
|
artifacts: all
|
||||||
args:
|
args:
|
||||||
- sign-blob
|
- sign-blob
|
||||||
- "--output-signature=${signature}"
|
- "--bundle=${signature}"
|
||||||
- "--output-certificate=${certificate}"
|
|
||||||
- "${artifact}"
|
- "${artifact}"
|
||||||
- "--yes" # needed for cosign 2.0.0+
|
- "--yes" # needed for cosign 2.0.0+
|
||||||
|
|
||||||
|
|||||||
@@ -61,17 +61,17 @@ install-fission-cli:
|
|||||||
### Codegen
|
### Codegen
|
||||||
codegen:
|
codegen:
|
||||||
@./hack/update-codegen.sh
|
@./hack/update-codegen.sh
|
||||||
go run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile="hack/boilerplate.txt" paths="./..."
|
go tool controller-gen object:headerFile="hack/boilerplate.txt" paths="./..."
|
||||||
|
|
||||||
### CRDs
|
### CRDs
|
||||||
generate-crds:
|
generate-crds:
|
||||||
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd \
|
go tool controller-gen crd \
|
||||||
paths=./pkg/apis/core/v1 \
|
paths=./pkg/apis/core/v1 \
|
||||||
output:crd:artifacts:config=crds/v1
|
output:crd:artifacts:config=crds/v1
|
||||||
|
|
||||||
### Webhook generation: it generates webhook configs with help of kubebuilder:webhook tag
|
### Webhook generation: it generates webhook configs with help of kubebuilder:webhook tag
|
||||||
generate-webhooks:
|
generate-webhooks:
|
||||||
go run sigs.k8s.io/controller-tools/cmd/controller-gen webhook \
|
go tool controller-gen webhook \
|
||||||
paths=./pkg/webhook \
|
paths=./pkg/webhook \
|
||||||
output:dir=charts/fission-all/templates/webhook-server
|
output:dir=charts/fission-all/templates/webhook-server
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ generate-cli-docs:
|
|||||||
|
|
||||||
generate-crd-ref-docs:
|
generate-crd-ref-docs:
|
||||||
# crd-ref-docs: https://github.com/elastic/crd-ref-docs
|
# crd-ref-docs: https://github.com/elastic/crd-ref-docs
|
||||||
go run github.com/elastic/crd-ref-docs --source-path=pkg/apis/core/v1 --config=tools/crd-ref-docs/config.yaml --renderer markdown
|
go tool crd-ref-docs --source-path=pkg/apis/core/v1 --config=tools/crd-ref-docs/config.yaml --renderer markdown
|
||||||
cp tools/crd-ref-docs/header.md crd_docs.md
|
cp tools/crd-ref-docs/header.md crd_docs.md
|
||||||
cat out.md >> crd_docs.md && rm out.md
|
cat out.md >> crd_docs.md && rm out.md
|
||||||
mv crd_docs.md ../fission.io/content/en/docs/reference/crd-reference.md
|
mv crd_docs.md ../fission.io/content/en/docs/reference/crd-reference.md
|
||||||
@@ -112,6 +112,7 @@ skaffold-prebuild:
|
|||||||
@cp -v cmd/fission-bundle/Dockerfile dist/fission-bundle_linux_amd64_v1/Dockerfile
|
@cp -v cmd/fission-bundle/Dockerfile dist/fission-bundle_linux_amd64_v1/Dockerfile
|
||||||
@cp -v cmd/reporter/Dockerfile dist/reporter_linux_amd64_v1/Dockerfile
|
@cp -v cmd/reporter/Dockerfile dist/reporter_linux_amd64_v1/Dockerfile
|
||||||
@cp -v cmd/preupgradechecks/Dockerfile dist/pre-upgrade-checks_linux_amd64_v1/Dockerfile
|
@cp -v cmd/preupgradechecks/Dockerfile dist/pre-upgrade-checks_linux_amd64_v1/Dockerfile
|
||||||
|
@find dist/ -name 'Dockerfile' -exec sed -i.bak 's|$$TARGETPLATFORM/||g' {} +; find dist/ -name 'Dockerfile.bak' -delete
|
||||||
|
|
||||||
skaffold-deploy: skaffold-prebuild
|
skaffold-deploy: skaffold-prebuild
|
||||||
skaffold run -p $(SKAFFOLD_PROFILE)
|
skaffold run -p $(SKAFFOLD_PROFILE)
|
||||||
@@ -122,10 +123,3 @@ release:
|
|||||||
@./hack/release.sh $(VERSION)
|
@./hack/release.sh $(VERSION)
|
||||||
@./hack/release-tag.sh $(VERSION)
|
@./hack/release-tag.sh $(VERSION)
|
||||||
@./hack/changelog.sh
|
@./hack/changelog.sh
|
||||||
|
|
||||||
## Envtest
|
|
||||||
install-envtest:
|
|
||||||
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
|
|
||||||
|
|
||||||
setup-envtest:
|
|
||||||
setup-envtest -p path use 1.30.x
|
|
||||||
|
|||||||
@@ -39,6 +39,9 @@
|
|||||||
<a href="https://scorecard.dev/viewer/?uri=github.com/fission/fission">
|
<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">
|
<image alt="OpenSSF Scorecard" src="https://api.scorecard.dev/projects/github.com/fission/fission/badge">
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://www.bestpractices.dev/projects/4986">
|
||||||
|
<img src="https://www.bestpractices.dev/projects/4986/badge">
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: fission-all
|
name: fission-all
|
||||||
version: v1.21.0
|
version: 1.22.0
|
||||||
appVersion: v1.21.0
|
appVersion: v1.22.0
|
||||||
description: Fission is a fast serverless framework for Kubernetes.
|
description: Fission is a fast serverless framework for Kubernetes.
|
||||||
kubeVersion: ">=1.27.0-0"
|
kubeVersion: ">=1.28.0-0"
|
||||||
home: https://fission.io/
|
home: https://fission.io/
|
||||||
icon: https://fission.io/images/fission-logo-white.svg
|
icon: https://fission.io/images/fission-logo-white.svg
|
||||||
sources:
|
sources:
|
||||||
@@ -21,7 +21,6 @@ maintainers:
|
|||||||
email: vishal@infracloud.io
|
email: vishal@infracloud.io
|
||||||
- name: Sanket Sudake
|
- name: Sanket Sudake
|
||||||
email: sanket@infracloud.io
|
email: sanket@infracloud.io
|
||||||
engine: gotpl
|
|
||||||
type: application
|
type: application
|
||||||
annotations:
|
annotations:
|
||||||
artifacthub.io/signKey: |
|
artifacthub.io/signKey: |
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- Kubernetes 1.23+
|
- Kubernetes 1.28+
|
||||||
- Helm 3+
|
- Helm 3+
|
||||||
|
|
||||||
## Get Repo Info
|
## Get Repo Info
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
svc: storagesvc
|
svc: storagesvc
|
||||||
application: fission-storage
|
application: fission-storage
|
||||||
|
strategy:
|
||||||
|
type: {{ .Values.storagesvc.deploymentStrategy.type }}
|
||||||
|
{{- if eq .Values.storagesvc.deploymentStrategy.type "RollingUpdate" }}
|
||||||
|
rollingUpdate:
|
||||||
|
{{- toYaml .Values.storagesvc.deploymentStrategy.rollingUpdate | nindent 6}}
|
||||||
|
{{- end }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -113,7 +119,7 @@ spec:
|
|||||||
priorityClassName: {{ .Values.priorityClassName }}
|
priorityClassName: {{ .Values.priorityClassName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.imagePullSecrets }}
|
{{- with .Values.imagePullSecrets }}
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ image: fission/fission-bundle
|
|||||||
## It is also used by the chart to identify version of the few more images apart from fission-bundle.
|
## It is also used by the chart to identify version of the few more images apart from fission-bundle.
|
||||||
## Keep it empty for using latest tag.
|
## Keep it empty for using latest tag.
|
||||||
##
|
##
|
||||||
imageTag: v1.21.0
|
imageTag: v1.22.0
|
||||||
|
|
||||||
## pullPolicy represents the pull policy to use for images in the chart.
|
## pullPolicy represents the pull policy to use for images in the chart.
|
||||||
##
|
##
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
## imageppullsecrets
|
## imagepullsecrets
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
|
|
||||||
## priorityClassName represents the priority class name to use for Fission components.
|
## priorityClassName represents the priority class name to use for Fission components.
|
||||||
@@ -80,7 +80,7 @@ builderNamespace: ""
|
|||||||
functionNamespace: ""
|
functionNamespace: ""
|
||||||
|
|
||||||
## Fission will watch the following namespaces along with the `defaultNamespace` for fission custom resources.
|
## Fission will watch the following namespaces along with the `defaultNamespace` for fission custom resources.
|
||||||
## additionalFissionNamespaces:
|
## additionalFissionNamespaces:
|
||||||
## - namespace1
|
## - namespace1
|
||||||
## - namespace2
|
## - namespace2
|
||||||
## - namespace3
|
## - namespace3
|
||||||
@@ -124,7 +124,7 @@ fetcher:
|
|||||||
## image represents the image of the fetcher component.
|
## image represents the image of the fetcher component.
|
||||||
image: fission/fetcher
|
image: fission/fetcher
|
||||||
## imageTag represents the tag of the image of the fetcher component.
|
## imageTag represents the tag of the image of the fetcher component.
|
||||||
imageTag: v1.21.0
|
imageTag: v1.22.0
|
||||||
|
|
||||||
## Fetcher is only for to downloading or uploading archive.
|
## Fetcher is only for to downloading or uploading archive.
|
||||||
## Normally, you don't need to change the value here, unless necessary.
|
## Normally, you don't need to change the value here, unless necessary.
|
||||||
@@ -163,7 +163,7 @@ executor:
|
|||||||
## This is applicable to Pool Manager executor type only.
|
## This is applicable to Pool Manager executor type only.
|
||||||
##
|
##
|
||||||
podReadyTimeout: 300s
|
podReadyTimeout: 300s
|
||||||
|
|
||||||
## Pod resources as:
|
## Pod resources as:
|
||||||
## resources:
|
## resources:
|
||||||
## limits:
|
## limits:
|
||||||
@@ -336,7 +336,7 @@ router:
|
|||||||
runAsGroup: 10001
|
runAsGroup: 10001
|
||||||
|
|
||||||
## The builder manager watches the package & environments CRD changes and manages the builds of function source code.
|
## The builder manager watches the package & environments CRD changes and manages the builds of function source code.
|
||||||
##
|
##
|
||||||
buildermgr:
|
buildermgr:
|
||||||
## Pod resources as:
|
## Pod resources as:
|
||||||
## resources:
|
## resources:
|
||||||
@@ -362,7 +362,7 @@ buildermgr:
|
|||||||
runAsGroup: 10001
|
runAsGroup: 10001
|
||||||
|
|
||||||
## webhook is the component that validates API calls.
|
## webhook is the component that validates API calls.
|
||||||
## It contains validation and mutation for functions, triggers, environments, Kubernetes event watches, etc.
|
## It contains validation and mutation for functions, triggers, environments, Kubernetes event watches, etc.
|
||||||
##
|
##
|
||||||
webhook:
|
webhook:
|
||||||
## Pod resources as:
|
## Pod resources as:
|
||||||
@@ -439,6 +439,16 @@ storagesvc:
|
|||||||
##
|
##
|
||||||
resources: {}
|
resources: {}
|
||||||
|
|
||||||
|
## Deployment strategy defaults to RollingUpdate but use Recreate if new pods fail to
|
||||||
|
## attach to the volume until the old pod has released it.
|
||||||
|
## deploymentStrategy:
|
||||||
|
## type: Recreate
|
||||||
|
deploymentStrategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 25%
|
||||||
|
maxUnavailable: 25%
|
||||||
|
|
||||||
## Archive pruner removes archives from storage which are not referenced by any package.
|
## Archive pruner removes archives from storage which are not referenced by any package.
|
||||||
archivePruner:
|
archivePruner:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -541,7 +551,7 @@ serviceMonitor:
|
|||||||
# key: "value"
|
# key: "value"
|
||||||
|
|
||||||
# The following components expose Prometheus metrics and have podmonitors in this chart (disabled by default)
|
# The following components expose Prometheus metrics and have podmonitors in this chart (disabled by default)
|
||||||
#
|
#
|
||||||
podMonitor:
|
podMonitor:
|
||||||
enabled: false
|
enabled: false
|
||||||
##namespace in which you want to deploy podmonitor
|
##namespace in which you want to deploy podmonitor
|
||||||
@@ -577,7 +587,7 @@ persistence:
|
|||||||
# region: <awsRegion>
|
# region: <awsRegion>
|
||||||
## For Minio and other s3 compatible storage systems set endPoint property
|
## For Minio and other s3 compatible storage systems set endPoint property
|
||||||
# endPoint: <s3StorageUrl>
|
# endPoint: <s3StorageUrl>
|
||||||
|
|
||||||
## A manually managed Persistent Volume Claim name
|
## A manually managed Persistent Volume Claim name
|
||||||
## Requires persistence.enabled: true
|
## Requires persistence.enabled: true
|
||||||
## If defined, PVC must be created manually before volume will be bound
|
## If defined, PVC must be created manually before volume will be bound
|
||||||
@@ -696,7 +706,7 @@ preUpgradeChecks:
|
|||||||
image: fission/pre-upgrade-checks
|
image: fission/pre-upgrade-checks
|
||||||
## pre-install/pre-upgrade checks image version
|
## pre-install/pre-upgrade checks image version
|
||||||
##
|
##
|
||||||
imageTag: v1.21.0
|
imageTag: v1.22.0
|
||||||
|
|
||||||
## Fission post-install/post-upgrade reporting live in this image
|
## Fission post-install/post-upgrade reporting live in this image
|
||||||
##
|
##
|
||||||
@@ -764,12 +774,12 @@ authentication:
|
|||||||
## jwtSigningKey is the signing key used for
|
## jwtSigningKey is the signing key used for
|
||||||
## signing the JWT token
|
## signing the JWT token
|
||||||
##
|
##
|
||||||
jwtSigningKey:
|
jwtSigningKey:
|
||||||
## jwtExpiryTime is the JWT expiry time
|
## jwtExpiryTime is the JWT expiry time
|
||||||
## in seconds
|
## in seconds
|
||||||
## default '120'
|
## default '120'
|
||||||
##
|
##
|
||||||
jwtExpiryTime:
|
jwtExpiryTime:
|
||||||
## jwtIssuer is the issuer of JWT
|
## jwtIssuer is the issuer of JWT
|
||||||
## default 'fission'
|
## default 'fission'
|
||||||
##
|
##
|
||||||
@@ -874,7 +884,7 @@ runtimePodSpec:
|
|||||||
## Setting it false by default so that integration tests pass
|
## Setting it false by default so that integration tests pass
|
||||||
##
|
##
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
## Checkout PodSpec in https://fission.io/docs/reference/crd-reference/#runtime
|
## Checkout PodSpec in https://fission.io/docs/reference/crd-reference/#runtime
|
||||||
##
|
##
|
||||||
podSpec:
|
podSpec:
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
FROM cgr.dev/chainguard/static:latest@sha256:5497b01f36ef14a5198c0165e50ae6a0006d0c7457d4566f1110257e1c0812ed
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
COPY builder /builder
|
ARG TARGETPLATFORM
|
||||||
|
COPY $TARGETPLATFORM/builder /builder
|
||||||
ENTRYPOINT ["/builder"]
|
ENTRYPOINT ["/builder"]
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
FROM cgr.dev/chainguard/static:latest@sha256:5497b01f36ef14a5198c0165e50ae6a0006d0c7457d4566f1110257e1c0812ed
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
COPY fetcher /
|
ARG TARGETPLATFORM
|
||||||
|
COPY $TARGETPLATFORM/fetcher /
|
||||||
ENTRYPOINT ["/fetcher"]
|
ENTRYPOINT ["/fetcher"]
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
FROM cgr.dev/chainguard/static:latest@sha256:5497b01f36ef14a5198c0165e50ae6a0006d0c7457d4566f1110257e1c0812ed
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
COPY fission-bundle /
|
ARG TARGETPLATFORM
|
||||||
|
COPY $TARGETPLATFORM/fission-bundle /
|
||||||
ENTRYPOINT ["/fission-bundle"]
|
ENTRYPOINT ["/fission-bundle"]
|
||||||
|
|||||||
+181
-175
@@ -21,9 +21,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
docopt "github.com/docopt/docopt-go"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||||
cnwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"
|
cnwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"
|
||||||
@@ -48,116 +46,35 @@ import (
|
|||||||
"github.com/fission/fission/pkg/webhook"
|
"github.com/fission/fission/pkg/webhook"
|
||||||
)
|
)
|
||||||
|
|
||||||
// runWebhook starts admission webhook server
|
// Command line arguments
|
||||||
func runWebhook(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, port int) error {
|
type CommandLineArgs struct {
|
||||||
return webhook.Start(ctx, clientGen, logger, cnwebhook.Options{
|
// Flags
|
||||||
Port: port,
|
canaryConfig bool
|
||||||
})
|
kubewatcher bool
|
||||||
|
timer bool
|
||||||
|
mqt bool
|
||||||
|
mqt_keda bool
|
||||||
|
builderMgr bool
|
||||||
|
showVersion bool
|
||||||
|
logger bool
|
||||||
|
|
||||||
|
// Port values
|
||||||
|
webhookPort int
|
||||||
|
routerPort int
|
||||||
|
executorPort int
|
||||||
|
storageServicePort int
|
||||||
|
|
||||||
|
// URL values
|
||||||
|
executorUrl string
|
||||||
|
routerUrl string
|
||||||
|
storageSvcUrl string
|
||||||
|
|
||||||
|
// Other configurations
|
||||||
|
storageType string
|
||||||
}
|
}
|
||||||
|
|
||||||
func runCanaryConfigServer(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface) error {
|
// Usage information
|
||||||
return canaryconfigmgr.StartCanaryServer(ctx, clientGen, logger, mgr, false)
|
const usageText string = `fission-bundle: Package of all fission microservices: router, executor.
|
||||||
}
|
|
||||||
|
|
||||||
func runRouter(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, port int, executorUrl string) error {
|
|
||||||
return router.Start(ctx, clientGen, logger, mgr, port, eclient.MakeClient(logger, executorUrl))
|
|
||||||
}
|
|
||||||
|
|
||||||
func runExecutor(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, port int) error {
|
|
||||||
return executor.StartExecutor(ctx, clientGen, logger, mgr, port)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runKubeWatcher(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, routerUrl string) error {
|
|
||||||
return kubewatcher.Start(ctx, clientGen, logger, mgr, routerUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runTimer(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, routerUrl string) error {
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runStorageSvc(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, port int, storage storagesvc.Storage) error {
|
|
||||||
return storagesvc.Start(ctx, clientGen, logger, storage, mgr, port)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runBuilderMgr(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, storageSvcUrl string) error {
|
|
||||||
return buildermgr.Start(ctx, clientGen, logger, mgr, storageSvcUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runLogger(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger) error {
|
|
||||||
return functionLogger.Start(ctx, clientGen, logger)
|
|
||||||
}
|
|
||||||
|
|
||||||
func getPort(logger *zap.Logger, portArg interface{}) int {
|
|
||||||
portArgStr := portArg.(string)
|
|
||||||
port, err := strconv.Atoi(portArgStr)
|
|
||||||
if err != nil {
|
|
||||||
logger.Fatal("invalid port number", zap.Error(err), zap.String("port", portArgStr))
|
|
||||||
}
|
|
||||||
return port
|
|
||||||
}
|
|
||||||
|
|
||||||
func getStringArgWithDefault(arg interface{}, defaultValue string) string {
|
|
||||||
if arg != nil {
|
|
||||||
return arg.(string)
|
|
||||||
} else {
|
|
||||||
return defaultValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getServiceName(arguments map[string]interface{}) string {
|
|
||||||
serviceName := "Fission-Unknown"
|
|
||||||
|
|
||||||
if arguments["--routerPort"] != nil {
|
|
||||||
serviceName = "Fission-Router"
|
|
||||||
} else if arguments["--executorPort"] != nil {
|
|
||||||
serviceName = "Fission-Executor"
|
|
||||||
} else if arguments["--kubewatcher"] == true {
|
|
||||||
serviceName = "Fission-KubeWatcher"
|
|
||||||
} else if arguments["--timer"] == true {
|
|
||||||
serviceName = "Fission-Timer"
|
|
||||||
} else if arguments["--mqt"] == true {
|
|
||||||
serviceName = "Fission-MessageQueueTrigger"
|
|
||||||
} else if arguments["--builderMgr"] == true {
|
|
||||||
serviceName = "Fission-BuilderMgr"
|
|
||||||
} else if arguments["--storageServicePort"] != nil {
|
|
||||||
serviceName = "Fission-StorageSvc"
|
|
||||||
} else if arguments["--mqt_keda"] == true {
|
|
||||||
serviceName = "Fission-Keda-MQTrigger"
|
|
||||||
}
|
|
||||||
|
|
||||||
return serviceName
|
|
||||||
}
|
|
||||||
|
|
||||||
func exitWithSync(logger *zap.Logger) {
|
|
||||||
// Ignore error, safe to ignore as per https://github.com/uber-go/zap/issues/328
|
|
||||||
_ = logger.Sync()
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
mgr := manager.New()
|
|
||||||
defer mgr.Wait()
|
|
||||||
|
|
||||||
var err error
|
|
||||||
|
|
||||||
// From https://github.com/containous/traefik/pull/1817/files
|
|
||||||
// Tell glog to log into STDERR. Otherwise, we risk
|
|
||||||
// certain kinds of API errors getting logged into a directory not
|
|
||||||
// available in a `FROM scratch` Docker container, causing glog to abort
|
|
||||||
// hard with an exit code > 0.
|
|
||||||
// TODO: fix the lint error. Error checking here is causing all components to crash with error "logtostderr not found"
|
|
||||||
flag.Set("logtostderr", "true") //nolint: errcheck
|
|
||||||
|
|
||||||
usage := `fission-bundle: Package of all fission microservices: router, executor.
|
|
||||||
|
|
||||||
Use it to start one or more of the fission servers:
|
Use it to start one or more of the fission servers:
|
||||||
|
|
||||||
@@ -197,142 +114,231 @@ Options:
|
|||||||
--storageServicePort=<port> Port that the storage service should listen on.
|
--storageServicePort=<port> Port that the storage service should listen on.
|
||||||
--executorUrl=<url> Executor URL. Not required if --executorPort is specified.
|
--executorUrl=<url> Executor URL. Not required if --executorPort is specified.
|
||||||
--routerUrl=<url> Router URL.
|
--routerUrl=<url> Router URL.
|
||||||
--etcdUrl=<etcdUrl> Etcd URL.
|
|
||||||
--storageSvcUrl=<url> StorageService URL.
|
--storageSvcUrl=<url> StorageService URL.
|
||||||
--filePath=<filePath> Directory to store functions in.
|
|
||||||
--namespace=<namespace> Kubernetes namespace in which to run function containers. Defaults to 'fission-function'.
|
|
||||||
--kubewatcher Start Kubernetes events watcher.
|
--kubewatcher Start Kubernetes events watcher.
|
||||||
--timer Start Timer.
|
--timer Start Timer.
|
||||||
--mqt Start message queue trigger.
|
--mqt Start message queue trigger.
|
||||||
--mqt_keda Start message queue trigger of kind KEDA
|
--mqt_keda Start message queue trigger of kind KEDA
|
||||||
--builderMgr Start builder manager.
|
--builderMgr Start builder manager.
|
||||||
--version Print version information
|
--version Print version information`
|
||||||
`
|
|
||||||
logger := loggerfactory.GetLogger()
|
|
||||||
defer exitWithSync(logger)
|
|
||||||
|
|
||||||
ctx := signals.SetupSignalHandler()
|
func main() {
|
||||||
profile.ProfileIfEnabled(ctx, logger, mgr)
|
mgr := manager.New()
|
||||||
|
defer mgr.Wait()
|
||||||
|
|
||||||
version := fmt.Sprintf("Fission Bundle Version: %s", info.BuildInfo().String())
|
// Set up command line parsing
|
||||||
arguments, err := docopt.ParseArgs(usage, nil, version)
|
args := setupCommandLineArgs()
|
||||||
if err != nil {
|
|
||||||
logger.Error("failed to parse arguments", zap.Error(err))
|
// Handle version request specially - exit after printing
|
||||||
return
|
if args.showVersion {
|
||||||
|
fmt.Printf("Fission Bundle Version: %s\n", info.BuildInfo().String())
|
||||||
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
shutdown, err := otel.InitProvider(ctx, logger, getServiceName(arguments))
|
// Initialize logger
|
||||||
|
logger := loggerfactory.GetLogger()
|
||||||
|
defer func() {
|
||||||
|
// Ignore error, safe to ignore as per https://github.com/uber-go/zap/issues/328
|
||||||
|
_ = logger.Sync()
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Set up signal handling for graceful shutdown
|
||||||
|
ctx := signals.SetupSignalHandler()
|
||||||
|
|
||||||
|
// Enable profiling if configured
|
||||||
|
profile.ProfileIfEnabled(ctx, logger, mgr)
|
||||||
|
|
||||||
|
// Initialize OpenTelemetry
|
||||||
|
serviceName := getServiceNameFromArgs(args)
|
||||||
|
shutdown, err := otel.InitProvider(ctx, logger, serviceName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("error initializing provider for OTLP", zap.Error(err), zap.Any("argument", arguments))
|
logger.Error("error initializing provider for OTLP", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if shutdown != nil {
|
if shutdown != nil {
|
||||||
defer shutdown(ctx)
|
defer shutdown(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
executorUrl := getStringArgWithDefault(arguments["--executorUrl"], "http://executor.fission")
|
// Initialize client generator
|
||||||
routerUrl := getStringArgWithDefault(arguments["--routerUrl"], "http://router.fission")
|
|
||||||
storageSvcUrl := getStringArgWithDefault(arguments["--storageSvcUrl"], "http://storagesvc.fission")
|
|
||||||
clientGen := crd.NewClientGenerator()
|
clientGen := crd.NewClientGenerator()
|
||||||
|
|
||||||
if arguments["--webhookPort"] != nil {
|
// Start the appropriate service based on command line arguments
|
||||||
port := getPort(logger, arguments["--webhookPort"])
|
startRequestedService(ctx, args, clientGen, logger, mgr)
|
||||||
err = runWebhook(ctx, clientGen, logger, port)
|
|
||||||
|
<-ctx.Done()
|
||||||
|
logger.Error("exiting")
|
||||||
|
}
|
||||||
|
|
||||||
|
// setupCommandLineArgs parses command line arguments and returns them
|
||||||
|
func setupCommandLineArgs() *CommandLineArgs {
|
||||||
|
args := &CommandLineArgs{}
|
||||||
|
|
||||||
|
// Override the default usage function
|
||||||
|
flag.Usage = func() {
|
||||||
|
fmt.Println(usageText)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tell glog to log into STDERR
|
||||||
|
flag.Set("logtostderr", "true") //nolint: errcheck
|
||||||
|
|
||||||
|
// Define flags
|
||||||
|
flag.BoolVar(&args.canaryConfig, "canaryConfig", false, "Start canary config server")
|
||||||
|
flag.BoolVar(&args.kubewatcher, "kubewatcher", false, "Start Kubernetes events watcher")
|
||||||
|
flag.BoolVar(&args.timer, "timer", false, "Start Timer")
|
||||||
|
flag.BoolVar(&args.mqt, "mqt", false, "Start message queue trigger")
|
||||||
|
flag.BoolVar(&args.mqt_keda, "mqt_keda", false, "Start message queue trigger of kind KEDA")
|
||||||
|
flag.BoolVar(&args.builderMgr, "builderMgr", false, "Start builder manager")
|
||||||
|
flag.BoolVar(&args.showVersion, "version", false, "Print version information")
|
||||||
|
flag.BoolVar(&args.logger, "logger", false, "Start logger")
|
||||||
|
|
||||||
|
// Port flags
|
||||||
|
flag.IntVar(&args.webhookPort, "webhookPort", 0, "Port that the webhook should listen on")
|
||||||
|
flag.IntVar(&args.routerPort, "routerPort", 0, "Port that the router should listen on")
|
||||||
|
flag.IntVar(&args.executorPort, "executorPort", 0, "Port that the executor should listen on")
|
||||||
|
flag.IntVar(&args.storageServicePort, "storageServicePort", 0, "Port that the storage service should listen on")
|
||||||
|
|
||||||
|
// URL flags
|
||||||
|
flag.StringVar(&args.executorUrl, "executorUrl", "http://executor.fission", "Executor URL")
|
||||||
|
flag.StringVar(&args.routerUrl, "routerUrl", "http://router.fission", "Router URL")
|
||||||
|
flag.StringVar(&args.storageSvcUrl, "storageSvcUrl", "http://storagesvc.fission", "StorageService URL")
|
||||||
|
|
||||||
|
// Other configuration flags
|
||||||
|
flag.StringVar(&args.storageType, "storageType", "", "Type of storage to use")
|
||||||
|
|
||||||
|
// Parse flags
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
// getServiceNameFromArgs determines which service is being started based on command line args
|
||||||
|
func getServiceNameFromArgs(args *CommandLineArgs) string {
|
||||||
|
serviceName := "Fission-Unknown"
|
||||||
|
|
||||||
|
if args.routerPort != 0 {
|
||||||
|
serviceName = "Fission-Router"
|
||||||
|
} else if args.executorPort != 0 {
|
||||||
|
serviceName = "Fission-Executor"
|
||||||
|
} else if args.kubewatcher {
|
||||||
|
serviceName = "Fission-KubeWatcher"
|
||||||
|
} else if args.timer {
|
||||||
|
serviceName = "Fission-Timer"
|
||||||
|
} else if args.mqt {
|
||||||
|
serviceName = "Fission-MessageQueueTrigger"
|
||||||
|
} else if args.builderMgr {
|
||||||
|
serviceName = "Fission-BuilderMgr"
|
||||||
|
} else if args.storageServicePort != 0 {
|
||||||
|
serviceName = "Fission-StorageSvc"
|
||||||
|
} else if args.mqt_keda {
|
||||||
|
serviceName = "Fission-Keda-MQTrigger"
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceName
|
||||||
|
}
|
||||||
|
|
||||||
|
// startRequestedService starts the service specified by command line arguments
|
||||||
|
func startRequestedService(ctx context.Context, args *CommandLineArgs, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface) {
|
||||||
|
var err error
|
||||||
|
|
||||||
|
// Start the requested service based on command line arguments
|
||||||
|
if args.webhookPort != 0 {
|
||||||
|
err = webhook.Start(ctx, clientGen, logger, cnwebhook.Options{
|
||||||
|
Port: args.webhookPort,
|
||||||
|
})
|
||||||
logger.Error("webhook server exited:", zap.Error(err))
|
logger.Error("webhook server exited:", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--canaryConfig"] == true {
|
if args.canaryConfig {
|
||||||
err := runCanaryConfigServer(ctx, clientGen, logger, mgr)
|
err = canaryconfigmgr.StartCanaryServer(ctx, clientGen, logger, mgr, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("canary config server exited with error: ", zap.Error(err))
|
logger.Error("canary config server exited with error: ", zap.Error(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--routerPort"] != nil {
|
if args.routerPort != 0 {
|
||||||
port := getPort(logger, arguments["--routerPort"])
|
err = router.Start(ctx, clientGen, logger, mgr, args.routerPort, eclient.MakeClient(logger, args.executorUrl))
|
||||||
err = runRouter(ctx, clientGen, logger, mgr, port, executorUrl)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("router exited", zap.Error(err))
|
logger.Error("router exited", zap.Error(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--executorPort"] != nil {
|
if args.executorPort != 0 {
|
||||||
port := getPort(logger, arguments["--executorPort"])
|
err = executor.StartExecutor(ctx, clientGen, logger, mgr, args.executorPort)
|
||||||
err = runExecutor(ctx, clientGen, logger, mgr, port)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("executor exited", zap.Error(err))
|
logger.Error("executor exited", zap.Error(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--kubewatcher"] == true {
|
if args.kubewatcher {
|
||||||
err = runKubeWatcher(ctx, clientGen, logger, mgr, routerUrl)
|
err = kubewatcher.Start(ctx, clientGen, logger, mgr, args.routerUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("kubewatcher exited", zap.Error(err))
|
logger.Error("kubewatcher exited", zap.Error(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--timer"] == true {
|
if args.timer {
|
||||||
err = runTimer(ctx, clientGen, logger, mgr, routerUrl)
|
err = timer.Start(ctx, clientGen, logger, mgr, args.routerUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("timer exited", zap.Error(err))
|
logger.Error("timer exited", zap.Error(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--mqt"] == true {
|
if args.mqt {
|
||||||
err = runMessageQueueMgr(ctx, clientGen, logger, mgr, routerUrl)
|
err = mqtrigger.Start(ctx, clientGen, logger, mgr, args.routerUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("message queue manager exited", zap.Error(err))
|
logger.Error("message queue manager exited", zap.Error(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--mqt_keda"] == true {
|
if args.mqt_keda {
|
||||||
err = runMQManager(ctx, clientGen, logger, mgr, routerUrl)
|
err = mqt.StartScalerManager(ctx, clientGen, logger, mgr, args.routerUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("mqt scaler manager exited", zap.Error(err))
|
logger.Error("mqt scaler manager exited", zap.Error(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--builderMgr"] == true {
|
if args.builderMgr {
|
||||||
err = runBuilderMgr(ctx, clientGen, logger, mgr, storageSvcUrl)
|
err = buildermgr.Start(ctx, clientGen, logger, mgr, args.storageSvcUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("builder manager exited", zap.Error(err))
|
logger.Error("builder manager exited", zap.Error(err))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--logger"] == true {
|
if args.logger {
|
||||||
err = runLogger(ctx, clientGen, logger)
|
err = functionLogger.Start(ctx, clientGen, logger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("logger exited", zap.Error(err))
|
logger.Error("logger exited", zap.Error(err))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--storageServicePort"] != nil {
|
if args.storageServicePort != 0 {
|
||||||
port := getPort(logger, arguments["--storageServicePort"])
|
startStorageService(ctx, args, clientGen, logger, mgr)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var storage storagesvc.Storage
|
// startStorageService initializes and starts the storage service
|
||||||
|
func startStorageService(ctx context.Context, args *CommandLineArgs, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface) {
|
||||||
|
var storage storagesvc.Storage
|
||||||
|
|
||||||
if arguments["--storageType"] != nil && arguments["--storageType"] == string(storagesvc.StorageTypeS3) {
|
if args.storageType == string(storagesvc.StorageTypeS3) {
|
||||||
storage = storagesvc.NewS3Storage()
|
storage = storagesvc.NewS3Storage()
|
||||||
} else if arguments["--storageType"] == string(storagesvc.StorageTypeLocal) {
|
} else if args.storageType == string(storagesvc.StorageTypeLocal) {
|
||||||
storage = storagesvc.NewLocalStorage("/fission")
|
storage = storagesvc.NewLocalStorage("/fission")
|
||||||
}
|
|
||||||
err := runStorageSvc(ctx, clientGen, logger, mgr, port, storage)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("storage service exited", zap.Error(err))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<-ctx.Done()
|
err := storagesvc.Start(ctx, clientGen, logger, storage, mgr, args.storageServicePort)
|
||||||
logger.Error("exiting")
|
if err != nil {
|
||||||
|
logger.Error("storage service exited", zap.Error(err))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -41,12 +40,12 @@ import (
|
|||||||
func Start(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, routerUrl string) error {
|
func Start(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *zap.Logger, mgr manager.Interface, routerUrl string) error {
|
||||||
fissionClient, err := clientGen.GetFissionClient()
|
fissionClient, err := clientGen.GetFissionClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get fission client")
|
return fmt.Errorf("failed to get fission client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error waiting for CRDs")
|
return fmt.Errorf("error waiting for CRDs: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mqType := (fv1.MessageQueueType)(os.Getenv("MESSAGE_QUEUE_TYPE"))
|
mqType := (fv1.MessageQueueType)(os.Getenv("MESSAGE_QUEUE_TYPE"))
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ limitations under the License.
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -65,7 +66,7 @@ func App(clientOptions cmd.ClientOptions) *cobra.Command {
|
|||||||
// }
|
// }
|
||||||
client, err := cmd.NewClient(clientOptions)
|
client, err := cmd.NewClient(clientOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get fission client")
|
return fmt.Errorf("failed to get fission client: %w", err)
|
||||||
}
|
}
|
||||||
cmd.SetClientset(*client)
|
cmd.SetClientset(*client)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
FROM cgr.dev/chainguard/static:latest@sha256:5497b01f36ef14a5198c0165e50ae6a0006d0c7457d4566f1110257e1c0812ed
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
COPY pre-upgrade-checks /
|
ARG TARGETPLATFORM
|
||||||
|
COPY $TARGETPLATFORM/pre-upgrade-checks /
|
||||||
ENTRYPOINT ["/pre-upgrade-checks"]
|
ENTRYPOINT ["/pre-upgrade-checks"]
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
@@ -12,8 +11,7 @@ import (
|
|||||||
func TestPreUpgradeTaskClient(t *testing.T) {
|
func TestPreUpgradeTaskClient(t *testing.T) {
|
||||||
f := framework.NewFramework()
|
f := framework.NewFramework()
|
||||||
defer f.Logger().Sync()
|
defer f.Logger().Sync()
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx := t.Context()
|
||||||
defer cancel()
|
|
||||||
err := f.Start(ctx)
|
err := f.Start(ctx)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
FROM cgr.dev/chainguard/static:latest@sha256:5497b01f36ef14a5198c0165e50ae6a0006d0c7457d4566f1110257e1c0812ed
|
FROM cgr.dev/chainguard/static:latest@sha256:a301031ffd4ed67f35ca7fa6cf3dad9937b5fa47d7493955a18d9b4ca5412d1a
|
||||||
COPY reporter /
|
ARG TARGETPLATFORM
|
||||||
|
COPY $TARGETPLATFORM/reporter /
|
||||||
ENTRYPOINT ["/reporter"]
|
ENTRYPOINT ["/reporter"]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.17.1
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
name: canaryconfigs.fission.io
|
name: canaryconfigs.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
|
|||||||
+1122
-144
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.17.1
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
name: functions.fission.io
|
name: functions.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
@@ -93,7 +93,9 @@ spec:
|
|||||||
policies:
|
policies:
|
||||||
description: |-
|
description: |-
|
||||||
policies is a list of potential scaling polices which can be used during scaling.
|
policies is a list of potential scaling polices which can be used during scaling.
|
||||||
At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
|
If not set, use the default values:
|
||||||
|
- For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window.
|
||||||
|
- For scale down: allow all pods to be removed in a 15s window.
|
||||||
items:
|
items:
|
||||||
description: HPAScalingPolicy is a single policy
|
description: HPAScalingPolicy is a single policy
|
||||||
which must hold true for a specified past interval.
|
which must hold true for a specified past interval.
|
||||||
@@ -136,6 +138,24 @@ spec:
|
|||||||
- For scale down: 300 (i.e. the stabilization window is 300 seconds long).
|
- For scale down: 300 (i.e. the stabilization window is 300 seconds long).
|
||||||
format: int32
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
|
tolerance:
|
||||||
|
anyOf:
|
||||||
|
- type: integer
|
||||||
|
- type: string
|
||||||
|
description: |-
|
||||||
|
tolerance is the tolerance on the ratio between the current and desired
|
||||||
|
metric value under which no updates are made to the desired number of
|
||||||
|
replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not
|
||||||
|
set, the default cluster-wide tolerance is applied (by default 10%).
|
||||||
|
|
||||||
|
For example, if autoscaling is configured with a memory consumption target of 100Mi,
|
||||||
|
and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be
|
||||||
|
triggered when the actual consumption falls below 95Mi or exceeds 101Mi.
|
||||||
|
|
||||||
|
This is an alpha field and requires enabling the HPAConfigurableTolerance
|
||||||
|
feature gate.
|
||||||
|
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||||
|
x-kubernetes-int-or-string: true
|
||||||
type: object
|
type: object
|
||||||
scaleUp:
|
scaleUp:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -148,7 +168,9 @@ spec:
|
|||||||
policies:
|
policies:
|
||||||
description: |-
|
description: |-
|
||||||
policies is a list of potential scaling polices which can be used during scaling.
|
policies is a list of potential scaling polices which can be used during scaling.
|
||||||
At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
|
If not set, use the default values:
|
||||||
|
- For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window.
|
||||||
|
- For scale down: allow all pods to be removed in a 15s window.
|
||||||
items:
|
items:
|
||||||
description: HPAScalingPolicy is a single policy
|
description: HPAScalingPolicy is a single policy
|
||||||
which must hold true for a specified past interval.
|
which must hold true for a specified past interval.
|
||||||
@@ -191,6 +213,24 @@ spec:
|
|||||||
- For scale down: 300 (i.e. the stabilization window is 300 seconds long).
|
- For scale down: 300 (i.e. the stabilization window is 300 seconds long).
|
||||||
format: int32
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
|
tolerance:
|
||||||
|
anyOf:
|
||||||
|
- type: integer
|
||||||
|
- type: string
|
||||||
|
description: |-
|
||||||
|
tolerance is the tolerance on the ratio between the current and desired
|
||||||
|
metric value under which no updates are made to the desired number of
|
||||||
|
replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not
|
||||||
|
set, the default cluster-wide tolerance is applied (by default 10%).
|
||||||
|
|
||||||
|
For example, if autoscaling is configured with a memory consumption target of 100Mi,
|
||||||
|
and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be
|
||||||
|
triggered when the actual consumption falls below 95Mi or exceeds 101Mi.
|
||||||
|
|
||||||
|
This is an alpha field and requires enabling the HPAConfigurableTolerance
|
||||||
|
feature gate.
|
||||||
|
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||||
|
x-kubernetes-int-or-string: true
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
hpaMetrics:
|
hpaMetrics:
|
||||||
@@ -1047,7 +1087,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
||||||
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1062,7 +1101,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
||||||
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1229,7 +1267,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
||||||
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1244,7 +1281,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
||||||
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1338,8 +1374,8 @@ spec:
|
|||||||
most preferred is the one with the greatest sum of weights, i.e.
|
most preferred is the one with the greatest sum of weights, i.e.
|
||||||
for each node that meets all of the scheduling requirements (resource
|
for each node that meets all of the scheduling requirements (resource
|
||||||
request, requiredDuringScheduling anti-affinity expressions, etc.),
|
request, requiredDuringScheduling anti-affinity expressions, etc.),
|
||||||
compute a sum by iterating through the elements of this field and adding
|
compute a sum by iterating through the elements of this field and subtracting
|
||||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
|
"weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
|
||||||
node(s) with the highest sum are the most preferred.
|
node(s) with the highest sum are the most preferred.
|
||||||
items:
|
items:
|
||||||
description: The weights of all of the matched WeightedPodAffinityTerm
|
description: The weights of all of the matched WeightedPodAffinityTerm
|
||||||
@@ -1409,7 +1445,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
||||||
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1424,7 +1459,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
||||||
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1591,7 +1625,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
||||||
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1606,7 +1639,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
||||||
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1739,8 +1771,9 @@ spec:
|
|||||||
present in a Container.
|
present in a Container.
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: Name of the environment variable. Must
|
description: |-
|
||||||
be a C_IDENTIFIER.
|
Name of the environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
value:
|
value:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -1798,6 +1831,43 @@ spec:
|
|||||||
- fieldPath
|
- fieldPath
|
||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
|
fileKeyRef:
|
||||||
|
description: |-
|
||||||
|
FileKeyRef selects a key of the env file.
|
||||||
|
Requires the EnvFiles feature gate to be enabled.
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
description: |-
|
||||||
|
The key within the env file. An invalid key will prevent the pod from starting.
|
||||||
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
|
During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
|
||||||
|
type: string
|
||||||
|
optional:
|
||||||
|
default: false
|
||||||
|
description: |-
|
||||||
|
Specify whether the file or its key must be defined. If the file or key
|
||||||
|
does not exist, then the env var is not published.
|
||||||
|
If optional is set to true and the specified key does not exist,
|
||||||
|
the environment variable will not be set in the Pod's containers.
|
||||||
|
|
||||||
|
If optional is set to false and the specified key does not exist,
|
||||||
|
an error will be returned during Pod creation.
|
||||||
|
type: boolean
|
||||||
|
path:
|
||||||
|
description: |-
|
||||||
|
The path within the volume from which to select the file.
|
||||||
|
Must be relative and may not contain the '..' path or start with '..'.
|
||||||
|
type: string
|
||||||
|
volumeName:
|
||||||
|
description: The name of the volume mount
|
||||||
|
containing the env file.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- path
|
||||||
|
- volumeName
|
||||||
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
resourceFieldRef:
|
resourceFieldRef:
|
||||||
description: |-
|
description: |-
|
||||||
Selects a resource of the container: only resources limits and requests
|
Selects a resource of the container: only resources limits and requests
|
||||||
@@ -1858,14 +1928,14 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
description: |-
|
description: |-
|
||||||
List of sources to populate environment variables in the container.
|
List of sources to populate environment variables in the container.
|
||||||
The keys defined within a source must be a C_IDENTIFIER. All invalid keys
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
will be reported as an event when the container is starting. When a key exists in multiple
|
When a key exists in multiple
|
||||||
sources, the value associated with the last source will take precedence.
|
sources, the value associated with the last source will take precedence.
|
||||||
Values defined by an Env with a duplicate key will take precedence.
|
Values defined by an Env with a duplicate key will take precedence.
|
||||||
Cannot be updated.
|
Cannot be updated.
|
||||||
items:
|
items:
|
||||||
description: EnvFromSource represents the source of a
|
description: EnvFromSource represents the source of a
|
||||||
set of ConfigMaps
|
set of ConfigMaps or Secrets
|
||||||
properties:
|
properties:
|
||||||
configMapRef:
|
configMapRef:
|
||||||
description: The ConfigMap to select from
|
description: The ConfigMap to select from
|
||||||
@@ -1886,8 +1956,9 @@ spec:
|
|||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
prefix:
|
prefix:
|
||||||
description: An optional identifier to prepend to
|
description: |-
|
||||||
each key in the ConfigMap. Must be a C_IDENTIFIER.
|
Optional text to prepend to the name of each environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
secretRef:
|
secretRef:
|
||||||
description: The Secret to select from
|
description: The Secret to select from
|
||||||
@@ -2151,6 +2222,12 @@ spec:
|
|||||||
- port
|
- port
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
stopSignal:
|
||||||
|
description: |-
|
||||||
|
StopSignal defines which signal will be sent to a container when it is being stopped.
|
||||||
|
If not specified, the default is defined by the container runtime in use.
|
||||||
|
StopSignal can only be set for Pods with a non-empty .spec.os.name
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -2558,7 +2635,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
@@ -2613,10 +2690,10 @@ spec:
|
|||||||
restartPolicy:
|
restartPolicy:
|
||||||
description: |-
|
description: |-
|
||||||
RestartPolicy defines the restart behavior of individual containers in a pod.
|
RestartPolicy defines the restart behavior of individual containers in a pod.
|
||||||
This field may only be set for init containers, and the only allowed value is "Always".
|
This overrides the pod-level restart policy. When this field is not specified,
|
||||||
For non-init containers or when this field is not specified,
|
|
||||||
the restart behavior is defined by the Pod's restart policy and the container type.
|
the restart behavior is defined by the Pod's restart policy and the container type.
|
||||||
Setting the RestartPolicy as "Always" for the init container will have the following effect:
|
Additionally, setting the RestartPolicy as "Always" for the init container will
|
||||||
|
have the following effect:
|
||||||
this init container will be continually restarted on
|
this init container will be continually restarted on
|
||||||
exit until all regular containers have terminated. Once all regular
|
exit until all regular containers have terminated. Once all regular
|
||||||
containers have completed, all init containers with restartPolicy "Always"
|
containers have completed, all init containers with restartPolicy "Always"
|
||||||
@@ -2628,6 +2705,59 @@ spec:
|
|||||||
init container is started, or after any startupProbe has successfully
|
init container is started, or after any startupProbe has successfully
|
||||||
completed.
|
completed.
|
||||||
type: string
|
type: string
|
||||||
|
restartPolicyRules:
|
||||||
|
description: |-
|
||||||
|
Represents a list of rules to be checked to determine if the
|
||||||
|
container should be restarted on exit. The rules are evaluated in
|
||||||
|
order. Once a rule matches a container exit condition, the remaining
|
||||||
|
rules are ignored. If no rule matches the container exit condition,
|
||||||
|
the Container-level restart policy determines the whether the container
|
||||||
|
is restarted or not. Constraints on the rules:
|
||||||
|
- At most 20 rules are allowed.
|
||||||
|
- Rules can have the same action.
|
||||||
|
- Identical rules are not forbidden in validations.
|
||||||
|
When rules are specified, container MUST set RestartPolicy explicitly
|
||||||
|
even it if matches the Pod's RestartPolicy.
|
||||||
|
items:
|
||||||
|
description: ContainerRestartRule describes how a container
|
||||||
|
exit is handled.
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
description: |-
|
||||||
|
Specifies the action taken on a container exit if the requirements
|
||||||
|
are satisfied. The only possible value is "Restart" to restart the
|
||||||
|
container.
|
||||||
|
type: string
|
||||||
|
exitCodes:
|
||||||
|
description: Represents the exit codes to check on
|
||||||
|
container exits.
|
||||||
|
properties:
|
||||||
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents the relationship between the container exit code(s) and the
|
||||||
|
specified values. Possible values are:
|
||||||
|
- In: the requirement is satisfied if the container exit code is in the
|
||||||
|
set of specified values.
|
||||||
|
- NotIn: the requirement is satisfied if the container exit code is
|
||||||
|
not in the set of specified values.
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
description: |-
|
||||||
|
Specifies the set of values to check for container exit codes.
|
||||||
|
At most 255 elements are allowed.
|
||||||
|
items:
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: set
|
||||||
|
required:
|
||||||
|
- operator
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- action
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
securityContext:
|
securityContext:
|
||||||
description: |-
|
description: |-
|
||||||
SecurityContext defines the security options the container should be run with.
|
SecurityContext defines the security options the container should be run with.
|
||||||
@@ -3246,8 +3376,9 @@ spec:
|
|||||||
present in a Container.
|
present in a Container.
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: Name of the environment variable. Must
|
description: |-
|
||||||
be a C_IDENTIFIER.
|
Name of the environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
value:
|
value:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -3305,6 +3436,43 @@ spec:
|
|||||||
- fieldPath
|
- fieldPath
|
||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
|
fileKeyRef:
|
||||||
|
description: |-
|
||||||
|
FileKeyRef selects a key of the env file.
|
||||||
|
Requires the EnvFiles feature gate to be enabled.
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
description: |-
|
||||||
|
The key within the env file. An invalid key will prevent the pod from starting.
|
||||||
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
|
During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
|
||||||
|
type: string
|
||||||
|
optional:
|
||||||
|
default: false
|
||||||
|
description: |-
|
||||||
|
Specify whether the file or its key must be defined. If the file or key
|
||||||
|
does not exist, then the env var is not published.
|
||||||
|
If optional is set to true and the specified key does not exist,
|
||||||
|
the environment variable will not be set in the Pod's containers.
|
||||||
|
|
||||||
|
If optional is set to false and the specified key does not exist,
|
||||||
|
an error will be returned during Pod creation.
|
||||||
|
type: boolean
|
||||||
|
path:
|
||||||
|
description: |-
|
||||||
|
The path within the volume from which to select the file.
|
||||||
|
Must be relative and may not contain the '..' path or start with '..'.
|
||||||
|
type: string
|
||||||
|
volumeName:
|
||||||
|
description: The name of the volume mount
|
||||||
|
containing the env file.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- path
|
||||||
|
- volumeName
|
||||||
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
resourceFieldRef:
|
resourceFieldRef:
|
||||||
description: |-
|
description: |-
|
||||||
Selects a resource of the container: only resources limits and requests
|
Selects a resource of the container: only resources limits and requests
|
||||||
@@ -3365,14 +3533,14 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
description: |-
|
description: |-
|
||||||
List of sources to populate environment variables in the container.
|
List of sources to populate environment variables in the container.
|
||||||
The keys defined within a source must be a C_IDENTIFIER. All invalid keys
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
will be reported as an event when the container is starting. When a key exists in multiple
|
When a key exists in multiple
|
||||||
sources, the value associated with the last source will take precedence.
|
sources, the value associated with the last source will take precedence.
|
||||||
Values defined by an Env with a duplicate key will take precedence.
|
Values defined by an Env with a duplicate key will take precedence.
|
||||||
Cannot be updated.
|
Cannot be updated.
|
||||||
items:
|
items:
|
||||||
description: EnvFromSource represents the source of a
|
description: EnvFromSource represents the source of a
|
||||||
set of ConfigMaps
|
set of ConfigMaps or Secrets
|
||||||
properties:
|
properties:
|
||||||
configMapRef:
|
configMapRef:
|
||||||
description: The ConfigMap to select from
|
description: The ConfigMap to select from
|
||||||
@@ -3393,8 +3561,9 @@ spec:
|
|||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
prefix:
|
prefix:
|
||||||
description: An optional identifier to prepend to
|
description: |-
|
||||||
each key in the ConfigMap. Must be a C_IDENTIFIER.
|
Optional text to prepend to the name of each environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
secretRef:
|
secretRef:
|
||||||
description: The Secret to select from
|
description: The Secret to select from
|
||||||
@@ -3654,6 +3823,12 @@ spec:
|
|||||||
- port
|
- port
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
stopSignal:
|
||||||
|
description: |-
|
||||||
|
StopSignal defines which signal will be sent to a container when it is being stopped.
|
||||||
|
If not specified, the default is defined by the container runtime in use.
|
||||||
|
StopSignal can only be set for Pods with a non-empty .spec.os.name
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
description: Probes are not allowed for ephemeral containers.
|
description: Probes are not allowed for ephemeral containers.
|
||||||
@@ -4044,7 +4219,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
@@ -4100,9 +4275,53 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
Restart policy for the container to manage the restart behavior of each
|
Restart policy for the container to manage the restart behavior of each
|
||||||
container within a pod.
|
container within a pod.
|
||||||
This may only be set for init containers. You cannot set this field on
|
You cannot set this field on ephemeral containers.
|
||||||
ephemeral containers.
|
|
||||||
type: string
|
type: string
|
||||||
|
restartPolicyRules:
|
||||||
|
description: |-
|
||||||
|
Represents a list of rules to be checked to determine if the
|
||||||
|
container should be restarted on exit. You cannot set this field on
|
||||||
|
ephemeral containers.
|
||||||
|
items:
|
||||||
|
description: ContainerRestartRule describes how a container
|
||||||
|
exit is handled.
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
description: |-
|
||||||
|
Specifies the action taken on a container exit if the requirements
|
||||||
|
are satisfied. The only possible value is "Restart" to restart the
|
||||||
|
container.
|
||||||
|
type: string
|
||||||
|
exitCodes:
|
||||||
|
description: Represents the exit codes to check on
|
||||||
|
container exits.
|
||||||
|
properties:
|
||||||
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents the relationship between the container exit code(s) and the
|
||||||
|
specified values. Possible values are:
|
||||||
|
- In: the requirement is satisfied if the container exit code is in the
|
||||||
|
set of specified values.
|
||||||
|
- NotIn: the requirement is satisfied if the container exit code is
|
||||||
|
not in the set of specified values.
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
description: |-
|
||||||
|
Specifies the set of values to check for container exit codes.
|
||||||
|
At most 255 elements are allowed.
|
||||||
|
items:
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: set
|
||||||
|
required:
|
||||||
|
- operator
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- action
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
securityContext:
|
securityContext:
|
||||||
description: |-
|
description: |-
|
||||||
Optional: SecurityContext defines the security options the ephemeral container should be run with.
|
Optional: SecurityContext defines the security options the ephemeral container should be run with.
|
||||||
@@ -4640,7 +4859,9 @@ spec:
|
|||||||
hostNetwork:
|
hostNetwork:
|
||||||
description: |-
|
description: |-
|
||||||
Host networking requested for this pod. Use the host's network namespace.
|
Host networking requested for this pod. Use the host's network namespace.
|
||||||
If this option is set, the ports that will be used must be specified.
|
When using HostNetwork you should specify ports so the scheduler is aware.
|
||||||
|
When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`,
|
||||||
|
and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`.
|
||||||
Default to false.
|
Default to false.
|
||||||
type: boolean
|
type: boolean
|
||||||
hostPID:
|
hostPID:
|
||||||
@@ -4665,6 +4886,19 @@ spec:
|
|||||||
Specifies the hostname of the Pod
|
Specifies the hostname of the Pod
|
||||||
If not specified, the pod's hostname will be set to a system-defined value.
|
If not specified, the pod's hostname will be set to a system-defined value.
|
||||||
type: string
|
type: string
|
||||||
|
hostnameOverride:
|
||||||
|
description: |-
|
||||||
|
HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod.
|
||||||
|
This field only specifies the pod's hostname and does not affect its DNS records.
|
||||||
|
When this field is set to a non-empty string:
|
||||||
|
- It takes precedence over the values set in `hostname` and `subdomain`.
|
||||||
|
- The Pod's hostname will be set to this value.
|
||||||
|
- `setHostnameAsFQDN` must be nil or set to false.
|
||||||
|
- `hostNetwork` must be set to false.
|
||||||
|
|
||||||
|
This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters.
|
||||||
|
Requires the HostnameOverride feature gate to be enabled.
|
||||||
|
type: string
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
description: |-
|
description: |-
|
||||||
ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
|
ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
|
||||||
@@ -4700,7 +4934,7 @@ spec:
|
|||||||
Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
|
Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
|
||||||
The resourceRequirements of an init container are taken into account during scheduling
|
The resourceRequirements of an init container are taken into account during scheduling
|
||||||
by finding the highest request/limit for each resource type, and then using the max of
|
by finding the highest request/limit for each resource type, and then using the max of
|
||||||
of that value or the sum of the normal containers. Limits are applied to init containers
|
that value or the sum of the normal containers. Limits are applied to init containers
|
||||||
in a similar fashion.
|
in a similar fashion.
|
||||||
Init containers cannot currently be added or removed.
|
Init containers cannot currently be added or removed.
|
||||||
Cannot be updated.
|
Cannot be updated.
|
||||||
@@ -4746,8 +4980,9 @@ spec:
|
|||||||
present in a Container.
|
present in a Container.
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: Name of the environment variable. Must
|
description: |-
|
||||||
be a C_IDENTIFIER.
|
Name of the environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
value:
|
value:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -4805,6 +5040,43 @@ spec:
|
|||||||
- fieldPath
|
- fieldPath
|
||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
|
fileKeyRef:
|
||||||
|
description: |-
|
||||||
|
FileKeyRef selects a key of the env file.
|
||||||
|
Requires the EnvFiles feature gate to be enabled.
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
description: |-
|
||||||
|
The key within the env file. An invalid key will prevent the pod from starting.
|
||||||
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
|
During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
|
||||||
|
type: string
|
||||||
|
optional:
|
||||||
|
default: false
|
||||||
|
description: |-
|
||||||
|
Specify whether the file or its key must be defined. If the file or key
|
||||||
|
does not exist, then the env var is not published.
|
||||||
|
If optional is set to true and the specified key does not exist,
|
||||||
|
the environment variable will not be set in the Pod's containers.
|
||||||
|
|
||||||
|
If optional is set to false and the specified key does not exist,
|
||||||
|
an error will be returned during Pod creation.
|
||||||
|
type: boolean
|
||||||
|
path:
|
||||||
|
description: |-
|
||||||
|
The path within the volume from which to select the file.
|
||||||
|
Must be relative and may not contain the '..' path or start with '..'.
|
||||||
|
type: string
|
||||||
|
volumeName:
|
||||||
|
description: The name of the volume mount
|
||||||
|
containing the env file.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- path
|
||||||
|
- volumeName
|
||||||
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
resourceFieldRef:
|
resourceFieldRef:
|
||||||
description: |-
|
description: |-
|
||||||
Selects a resource of the container: only resources limits and requests
|
Selects a resource of the container: only resources limits and requests
|
||||||
@@ -4865,14 +5137,14 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
description: |-
|
description: |-
|
||||||
List of sources to populate environment variables in the container.
|
List of sources to populate environment variables in the container.
|
||||||
The keys defined within a source must be a C_IDENTIFIER. All invalid keys
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
will be reported as an event when the container is starting. When a key exists in multiple
|
When a key exists in multiple
|
||||||
sources, the value associated with the last source will take precedence.
|
sources, the value associated with the last source will take precedence.
|
||||||
Values defined by an Env with a duplicate key will take precedence.
|
Values defined by an Env with a duplicate key will take precedence.
|
||||||
Cannot be updated.
|
Cannot be updated.
|
||||||
items:
|
items:
|
||||||
description: EnvFromSource represents the source of a
|
description: EnvFromSource represents the source of a
|
||||||
set of ConfigMaps
|
set of ConfigMaps or Secrets
|
||||||
properties:
|
properties:
|
||||||
configMapRef:
|
configMapRef:
|
||||||
description: The ConfigMap to select from
|
description: The ConfigMap to select from
|
||||||
@@ -4893,8 +5165,9 @@ spec:
|
|||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
prefix:
|
prefix:
|
||||||
description: An optional identifier to prepend to
|
description: |-
|
||||||
each key in the ConfigMap. Must be a C_IDENTIFIER.
|
Optional text to prepend to the name of each environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
secretRef:
|
secretRef:
|
||||||
description: The Secret to select from
|
description: The Secret to select from
|
||||||
@@ -5158,6 +5431,12 @@ spec:
|
|||||||
- port
|
- port
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
stopSignal:
|
||||||
|
description: |-
|
||||||
|
StopSignal defines which signal will be sent to a container when it is being stopped.
|
||||||
|
If not specified, the default is defined by the container runtime in use.
|
||||||
|
StopSignal can only be set for Pods with a non-empty .spec.os.name
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -5565,7 +5844,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
@@ -5620,10 +5899,10 @@ spec:
|
|||||||
restartPolicy:
|
restartPolicy:
|
||||||
description: |-
|
description: |-
|
||||||
RestartPolicy defines the restart behavior of individual containers in a pod.
|
RestartPolicy defines the restart behavior of individual containers in a pod.
|
||||||
This field may only be set for init containers, and the only allowed value is "Always".
|
This overrides the pod-level restart policy. When this field is not specified,
|
||||||
For non-init containers or when this field is not specified,
|
|
||||||
the restart behavior is defined by the Pod's restart policy and the container type.
|
the restart behavior is defined by the Pod's restart policy and the container type.
|
||||||
Setting the RestartPolicy as "Always" for the init container will have the following effect:
|
Additionally, setting the RestartPolicy as "Always" for the init container will
|
||||||
|
have the following effect:
|
||||||
this init container will be continually restarted on
|
this init container will be continually restarted on
|
||||||
exit until all regular containers have terminated. Once all regular
|
exit until all regular containers have terminated. Once all regular
|
||||||
containers have completed, all init containers with restartPolicy "Always"
|
containers have completed, all init containers with restartPolicy "Always"
|
||||||
@@ -5635,6 +5914,59 @@ spec:
|
|||||||
init container is started, or after any startupProbe has successfully
|
init container is started, or after any startupProbe has successfully
|
||||||
completed.
|
completed.
|
||||||
type: string
|
type: string
|
||||||
|
restartPolicyRules:
|
||||||
|
description: |-
|
||||||
|
Represents a list of rules to be checked to determine if the
|
||||||
|
container should be restarted on exit. The rules are evaluated in
|
||||||
|
order. Once a rule matches a container exit condition, the remaining
|
||||||
|
rules are ignored. If no rule matches the container exit condition,
|
||||||
|
the Container-level restart policy determines the whether the container
|
||||||
|
is restarted or not. Constraints on the rules:
|
||||||
|
- At most 20 rules are allowed.
|
||||||
|
- Rules can have the same action.
|
||||||
|
- Identical rules are not forbidden in validations.
|
||||||
|
When rules are specified, container MUST set RestartPolicy explicitly
|
||||||
|
even it if matches the Pod's RestartPolicy.
|
||||||
|
items:
|
||||||
|
description: ContainerRestartRule describes how a container
|
||||||
|
exit is handled.
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
description: |-
|
||||||
|
Specifies the action taken on a container exit if the requirements
|
||||||
|
are satisfied. The only possible value is "Restart" to restart the
|
||||||
|
container.
|
||||||
|
type: string
|
||||||
|
exitCodes:
|
||||||
|
description: Represents the exit codes to check on
|
||||||
|
container exits.
|
||||||
|
properties:
|
||||||
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents the relationship between the container exit code(s) and the
|
||||||
|
specified values. Possible values are:
|
||||||
|
- In: the requirement is satisfied if the container exit code is in the
|
||||||
|
set of specified values.
|
||||||
|
- NotIn: the requirement is satisfied if the container exit code is
|
||||||
|
not in the set of specified values.
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
description: |-
|
||||||
|
Specifies the set of values to check for container exit codes.
|
||||||
|
At most 255 elements are allowed.
|
||||||
|
items:
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: set
|
||||||
|
required:
|
||||||
|
- operator
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- action
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
securityContext:
|
securityContext:
|
||||||
description: |-
|
description: |-
|
||||||
SecurityContext defines the security options the container should be run with.
|
SecurityContext defines the security options the container should be run with.
|
||||||
@@ -6167,6 +6499,7 @@ spec:
|
|||||||
- spec.hostPID
|
- spec.hostPID
|
||||||
- spec.hostIPC
|
- spec.hostIPC
|
||||||
- spec.hostUsers
|
- spec.hostUsers
|
||||||
|
- spec.resources
|
||||||
- spec.securityContext.appArmorProfile
|
- spec.securityContext.appArmorProfile
|
||||||
- spec.securityContext.seLinuxOptions
|
- spec.securityContext.seLinuxOptions
|
||||||
- spec.securityContext.seccompProfile
|
- spec.securityContext.seccompProfile
|
||||||
@@ -6320,7 +6653,7 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
Resources is the total amount of CPU and Memory resources required by all
|
Resources is the total amount of CPU and Memory resources required by all
|
||||||
containers in the pod. It supports specifying Requests and Limits for
|
containers in the pod. It supports specifying Requests and Limits for
|
||||||
"cpu" and "memory" resource names only. ResourceClaims are not supported.
|
"cpu", "memory" and "hugepages-" resource names only. ResourceClaims are not supported.
|
||||||
|
|
||||||
This field enables fine-grained control over resource allocation for the
|
This field enables fine-grained control over resource allocation for the
|
||||||
entire pod, allowing resource sharing among containers in a pod.
|
entire pod, allowing resource sharing among containers in a pod.
|
||||||
@@ -6333,7 +6666,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
@@ -6870,7 +7203,6 @@ spec:
|
|||||||
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
|
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
|
||||||
|
|
||||||
If this value is nil, the behavior is equivalent to the Honor policy.
|
If this value is nil, the behavior is equivalent to the Honor policy.
|
||||||
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
|
|
||||||
type: string
|
type: string
|
||||||
nodeTaintsPolicy:
|
nodeTaintsPolicy:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -6881,7 +7213,6 @@ spec:
|
|||||||
- Ignore: node taints are ignored. All nodes are included.
|
- Ignore: node taints are ignored. All nodes are included.
|
||||||
|
|
||||||
If this value is nil, the behavior is equivalent to the Ignore policy.
|
If this value is nil, the behavior is equivalent to the Ignore policy.
|
||||||
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
|
|
||||||
type: string
|
type: string
|
||||||
topologyKey:
|
topologyKey:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -7606,15 +7937,13 @@ spec:
|
|||||||
volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
|
volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
|
||||||
If specified, the CSI driver will create or update the volume with the attributes defined
|
If specified, the CSI driver will create or update the volume with the attributes defined
|
||||||
in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
|
in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
|
||||||
it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass
|
it can be changed after the claim is created. An empty string or nil value indicates that no
|
||||||
will be applied to the claim but it's not allowed to reset this field to empty string once it is set.
|
VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state,
|
||||||
If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass
|
this field can be reset to its previous value (including nil) to cancel the modification.
|
||||||
will be set by the persistentvolume controller if it exists.
|
|
||||||
If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
|
If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
|
||||||
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
|
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
|
||||||
exists.
|
exists.
|
||||||
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
|
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
|
||||||
(Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
|
|
||||||
type: string
|
type: string
|
||||||
volumeMode:
|
volumeMode:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -7796,12 +8125,10 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
|
glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
|
||||||
Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.
|
Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.
|
||||||
More info: https://examples.k8s.io/volumes/glusterfs/README.md
|
|
||||||
properties:
|
properties:
|
||||||
endpoints:
|
endpoints:
|
||||||
description: |-
|
description: endpoints is the endpoint name that details
|
||||||
endpoints is the endpoint name that details Glusterfs topology.
|
Glusterfs topology.
|
||||||
More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
|
|
||||||
type: string
|
type: string
|
||||||
path:
|
path:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -7855,7 +8182,7 @@ spec:
|
|||||||
The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
|
The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
|
||||||
The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
|
The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
|
||||||
The volume will be mounted read-only (ro) and non-executable files (noexec).
|
The volume will be mounted read-only (ro) and non-executable files (noexec).
|
||||||
Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
|
Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33.
|
||||||
The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
|
The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
|
||||||
properties:
|
properties:
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
@@ -7880,7 +8207,7 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
iscsi represents an ISCSI Disk resource that is attached to a
|
iscsi represents an ISCSI Disk resource that is attached to a
|
||||||
kubelet's host machine and then exposed to the pod.
|
kubelet's host machine and then exposed to the pod.
|
||||||
More info: https://examples.k8s.io/volumes/iscsi/README.md
|
More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi
|
||||||
properties:
|
properties:
|
||||||
chapAuthDiscovery:
|
chapAuthDiscovery:
|
||||||
description: chapAuthDiscovery defines whether support
|
description: chapAuthDiscovery defines whether support
|
||||||
@@ -8302,6 +8629,111 @@ spec:
|
|||||||
type: array
|
type: array
|
||||||
x-kubernetes-list-type: atomic
|
x-kubernetes-list-type: atomic
|
||||||
type: object
|
type: object
|
||||||
|
podCertificate:
|
||||||
|
description: |-
|
||||||
|
Projects an auto-rotating credential bundle (private key and certificate
|
||||||
|
chain) that the pod can use either as a TLS client or server.
|
||||||
|
|
||||||
|
Kubelet generates a private key and uses it to send a
|
||||||
|
PodCertificateRequest to the named signer. Once the signer approves the
|
||||||
|
request and issues a certificate chain, Kubelet writes the key and
|
||||||
|
certificate chain to the pod filesystem. The pod does not start until
|
||||||
|
certificates have been issued for each podCertificate projected volume
|
||||||
|
source in its spec.
|
||||||
|
|
||||||
|
Kubelet will begin trying to rotate the certificate at the time indicated
|
||||||
|
by the signer using the PodCertificateRequest.Status.BeginRefreshAt
|
||||||
|
timestamp.
|
||||||
|
|
||||||
|
Kubelet can write a single file, indicated by the credentialBundlePath
|
||||||
|
field, or separate files, indicated by the keyPath and
|
||||||
|
certificateChainPath fields.
|
||||||
|
|
||||||
|
The credential bundle is a single file in PEM format. The first PEM
|
||||||
|
entry is the private key (in PKCS#8 format), and the remaining PEM
|
||||||
|
entries are the certificate chain issued by the signer (typically,
|
||||||
|
signers will return their certificate chain in leaf-to-root order).
|
||||||
|
|
||||||
|
Prefer using the credential bundle format, since your application code
|
||||||
|
can read it atomically. If you use keyPath and certificateChainPath,
|
||||||
|
your application must make two separate file reads. If these coincide
|
||||||
|
with a certificate rotation, it is possible that the private key and leaf
|
||||||
|
certificate you read may not correspond to each other. Your application
|
||||||
|
will need to check for this condition, and re-read until they are
|
||||||
|
consistent.
|
||||||
|
|
||||||
|
The named signer controls chooses the format of the certificate it
|
||||||
|
issues; consult the signer implementation's documentation to learn how to
|
||||||
|
use the certificates it issues.
|
||||||
|
properties:
|
||||||
|
certificateChainPath:
|
||||||
|
description: |-
|
||||||
|
Write the certificate chain at this path in the projected volume.
|
||||||
|
|
||||||
|
Most applications should use credentialBundlePath. When using keyPath
|
||||||
|
and certificateChainPath, your application needs to check that the key
|
||||||
|
and leaf certificate are consistent, because it is possible to read the
|
||||||
|
files mid-rotation.
|
||||||
|
type: string
|
||||||
|
credentialBundlePath:
|
||||||
|
description: |-
|
||||||
|
Write the credential bundle at this path in the projected volume.
|
||||||
|
|
||||||
|
The credential bundle is a single file that contains multiple PEM blocks.
|
||||||
|
The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private
|
||||||
|
key.
|
||||||
|
|
||||||
|
The remaining blocks are CERTIFICATE blocks, containing the issued
|
||||||
|
certificate chain from the signer (leaf and any intermediates).
|
||||||
|
|
||||||
|
Using credentialBundlePath lets your Pod's application code make a single
|
||||||
|
atomic read that retrieves a consistent key and certificate chain. If you
|
||||||
|
project them to separate files, your application code will need to
|
||||||
|
additionally check that the leaf certificate was issued to the key.
|
||||||
|
type: string
|
||||||
|
keyPath:
|
||||||
|
description: |-
|
||||||
|
Write the key at this path in the projected volume.
|
||||||
|
|
||||||
|
Most applications should use credentialBundlePath. When using keyPath
|
||||||
|
and certificateChainPath, your application needs to check that the key
|
||||||
|
and leaf certificate are consistent, because it is possible to read the
|
||||||
|
files mid-rotation.
|
||||||
|
type: string
|
||||||
|
keyType:
|
||||||
|
description: |-
|
||||||
|
The type of keypair Kubelet will generate for the pod.
|
||||||
|
|
||||||
|
Valid values are "RSA3072", "RSA4096", "ECDSAP256", "ECDSAP384",
|
||||||
|
"ECDSAP521", and "ED25519".
|
||||||
|
type: string
|
||||||
|
maxExpirationSeconds:
|
||||||
|
description: |-
|
||||||
|
maxExpirationSeconds is the maximum lifetime permitted for the
|
||||||
|
certificate.
|
||||||
|
|
||||||
|
Kubelet copies this value verbatim into the PodCertificateRequests it
|
||||||
|
generates for this projection.
|
||||||
|
|
||||||
|
If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver
|
||||||
|
will reject values shorter than 3600 (1 hour). The maximum allowable
|
||||||
|
value is 7862400 (91 days).
|
||||||
|
|
||||||
|
The signer implementation is then free to issue a certificate with any
|
||||||
|
lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600
|
||||||
|
seconds (1 hour). This constraint is enforced by kube-apiserver.
|
||||||
|
`kubernetes.io` signers will never issue certificates with a lifetime
|
||||||
|
longer than 24 hours.
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
signerName:
|
||||||
|
description: Kubelet's generated CSRs will
|
||||||
|
be addressed to this signer.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- keyType
|
||||||
|
- signerName
|
||||||
|
type: object
|
||||||
secret:
|
secret:
|
||||||
description: secret information about the secret
|
description: secret information about the secret
|
||||||
data to project
|
data to project
|
||||||
@@ -8436,7 +8868,6 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
|
rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
|
||||||
Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.
|
Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.
|
||||||
More info: https://examples.k8s.io/volumes/rbd/README.md
|
|
||||||
properties:
|
properties:
|
||||||
fsType:
|
fsType:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -8742,7 +9173,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.17.1
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
name: httptriggers.fission.io
|
name: httptriggers.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.17.1
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
name: kuberneteswatchtriggers.fission.io
|
name: kuberneteswatchtriggers.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.17.1
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
name: messagequeuetriggers.fission.io
|
name: messagequeuetriggers.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
@@ -412,7 +412,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
||||||
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -427,7 +426,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
||||||
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -594,7 +592,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
||||||
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -609,7 +606,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
||||||
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -703,8 +699,8 @@ spec:
|
|||||||
most preferred is the one with the greatest sum of weights, i.e.
|
most preferred is the one with the greatest sum of weights, i.e.
|
||||||
for each node that meets all of the scheduling requirements (resource
|
for each node that meets all of the scheduling requirements (resource
|
||||||
request, requiredDuringScheduling anti-affinity expressions, etc.),
|
request, requiredDuringScheduling anti-affinity expressions, etc.),
|
||||||
compute a sum by iterating through the elements of this field and adding
|
compute a sum by iterating through the elements of this field and subtracting
|
||||||
"weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
|
"weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
|
||||||
node(s) with the highest sum are the most preferred.
|
node(s) with the highest sum are the most preferred.
|
||||||
items:
|
items:
|
||||||
description: The weights of all of the matched WeightedPodAffinityTerm
|
description: The weights of all of the matched WeightedPodAffinityTerm
|
||||||
@@ -774,7 +770,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
||||||
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -789,7 +784,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
||||||
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -956,7 +950,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both matchLabelKeys and labelSelector.
|
||||||
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
Also, matchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -971,7 +964,6 @@ spec:
|
|||||||
pod labels will be ignored. The default value is empty.
|
pod labels will be ignored. The default value is empty.
|
||||||
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
|
||||||
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
|
||||||
This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
@@ -1104,8 +1096,9 @@ spec:
|
|||||||
present in a Container.
|
present in a Container.
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: Name of the environment variable. Must
|
description: |-
|
||||||
be a C_IDENTIFIER.
|
Name of the environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
value:
|
value:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -1163,6 +1156,43 @@ spec:
|
|||||||
- fieldPath
|
- fieldPath
|
||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
|
fileKeyRef:
|
||||||
|
description: |-
|
||||||
|
FileKeyRef selects a key of the env file.
|
||||||
|
Requires the EnvFiles feature gate to be enabled.
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
description: |-
|
||||||
|
The key within the env file. An invalid key will prevent the pod from starting.
|
||||||
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
|
During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
|
||||||
|
type: string
|
||||||
|
optional:
|
||||||
|
default: false
|
||||||
|
description: |-
|
||||||
|
Specify whether the file or its key must be defined. If the file or key
|
||||||
|
does not exist, then the env var is not published.
|
||||||
|
If optional is set to true and the specified key does not exist,
|
||||||
|
the environment variable will not be set in the Pod's containers.
|
||||||
|
|
||||||
|
If optional is set to false and the specified key does not exist,
|
||||||
|
an error will be returned during Pod creation.
|
||||||
|
type: boolean
|
||||||
|
path:
|
||||||
|
description: |-
|
||||||
|
The path within the volume from which to select the file.
|
||||||
|
Must be relative and may not contain the '..' path or start with '..'.
|
||||||
|
type: string
|
||||||
|
volumeName:
|
||||||
|
description: The name of the volume mount
|
||||||
|
containing the env file.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- path
|
||||||
|
- volumeName
|
||||||
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
resourceFieldRef:
|
resourceFieldRef:
|
||||||
description: |-
|
description: |-
|
||||||
Selects a resource of the container: only resources limits and requests
|
Selects a resource of the container: only resources limits and requests
|
||||||
@@ -1223,14 +1253,14 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
description: |-
|
description: |-
|
||||||
List of sources to populate environment variables in the container.
|
List of sources to populate environment variables in the container.
|
||||||
The keys defined within a source must be a C_IDENTIFIER. All invalid keys
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
will be reported as an event when the container is starting. When a key exists in multiple
|
When a key exists in multiple
|
||||||
sources, the value associated with the last source will take precedence.
|
sources, the value associated with the last source will take precedence.
|
||||||
Values defined by an Env with a duplicate key will take precedence.
|
Values defined by an Env with a duplicate key will take precedence.
|
||||||
Cannot be updated.
|
Cannot be updated.
|
||||||
items:
|
items:
|
||||||
description: EnvFromSource represents the source of a
|
description: EnvFromSource represents the source of a
|
||||||
set of ConfigMaps
|
set of ConfigMaps or Secrets
|
||||||
properties:
|
properties:
|
||||||
configMapRef:
|
configMapRef:
|
||||||
description: The ConfigMap to select from
|
description: The ConfigMap to select from
|
||||||
@@ -1251,8 +1281,9 @@ spec:
|
|||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
prefix:
|
prefix:
|
||||||
description: An optional identifier to prepend to
|
description: |-
|
||||||
each key in the ConfigMap. Must be a C_IDENTIFIER.
|
Optional text to prepend to the name of each environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
secretRef:
|
secretRef:
|
||||||
description: The Secret to select from
|
description: The Secret to select from
|
||||||
@@ -1516,6 +1547,12 @@ spec:
|
|||||||
- port
|
- port
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
stopSignal:
|
||||||
|
description: |-
|
||||||
|
StopSignal defines which signal will be sent to a container when it is being stopped.
|
||||||
|
If not specified, the default is defined by the container runtime in use.
|
||||||
|
StopSignal can only be set for Pods with a non-empty .spec.os.name
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -1923,7 +1960,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
@@ -1978,10 +2015,10 @@ spec:
|
|||||||
restartPolicy:
|
restartPolicy:
|
||||||
description: |-
|
description: |-
|
||||||
RestartPolicy defines the restart behavior of individual containers in a pod.
|
RestartPolicy defines the restart behavior of individual containers in a pod.
|
||||||
This field may only be set for init containers, and the only allowed value is "Always".
|
This overrides the pod-level restart policy. When this field is not specified,
|
||||||
For non-init containers or when this field is not specified,
|
|
||||||
the restart behavior is defined by the Pod's restart policy and the container type.
|
the restart behavior is defined by the Pod's restart policy and the container type.
|
||||||
Setting the RestartPolicy as "Always" for the init container will have the following effect:
|
Additionally, setting the RestartPolicy as "Always" for the init container will
|
||||||
|
have the following effect:
|
||||||
this init container will be continually restarted on
|
this init container will be continually restarted on
|
||||||
exit until all regular containers have terminated. Once all regular
|
exit until all regular containers have terminated. Once all regular
|
||||||
containers have completed, all init containers with restartPolicy "Always"
|
containers have completed, all init containers with restartPolicy "Always"
|
||||||
@@ -1993,6 +2030,59 @@ spec:
|
|||||||
init container is started, or after any startupProbe has successfully
|
init container is started, or after any startupProbe has successfully
|
||||||
completed.
|
completed.
|
||||||
type: string
|
type: string
|
||||||
|
restartPolicyRules:
|
||||||
|
description: |-
|
||||||
|
Represents a list of rules to be checked to determine if the
|
||||||
|
container should be restarted on exit. The rules are evaluated in
|
||||||
|
order. Once a rule matches a container exit condition, the remaining
|
||||||
|
rules are ignored. If no rule matches the container exit condition,
|
||||||
|
the Container-level restart policy determines the whether the container
|
||||||
|
is restarted or not. Constraints on the rules:
|
||||||
|
- At most 20 rules are allowed.
|
||||||
|
- Rules can have the same action.
|
||||||
|
- Identical rules are not forbidden in validations.
|
||||||
|
When rules are specified, container MUST set RestartPolicy explicitly
|
||||||
|
even it if matches the Pod's RestartPolicy.
|
||||||
|
items:
|
||||||
|
description: ContainerRestartRule describes how a container
|
||||||
|
exit is handled.
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
description: |-
|
||||||
|
Specifies the action taken on a container exit if the requirements
|
||||||
|
are satisfied. The only possible value is "Restart" to restart the
|
||||||
|
container.
|
||||||
|
type: string
|
||||||
|
exitCodes:
|
||||||
|
description: Represents the exit codes to check on
|
||||||
|
container exits.
|
||||||
|
properties:
|
||||||
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents the relationship between the container exit code(s) and the
|
||||||
|
specified values. Possible values are:
|
||||||
|
- In: the requirement is satisfied if the container exit code is in the
|
||||||
|
set of specified values.
|
||||||
|
- NotIn: the requirement is satisfied if the container exit code is
|
||||||
|
not in the set of specified values.
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
description: |-
|
||||||
|
Specifies the set of values to check for container exit codes.
|
||||||
|
At most 255 elements are allowed.
|
||||||
|
items:
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: set
|
||||||
|
required:
|
||||||
|
- operator
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- action
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
securityContext:
|
securityContext:
|
||||||
description: |-
|
description: |-
|
||||||
SecurityContext defines the security options the container should be run with.
|
SecurityContext defines the security options the container should be run with.
|
||||||
@@ -2611,8 +2701,9 @@ spec:
|
|||||||
present in a Container.
|
present in a Container.
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: Name of the environment variable. Must
|
description: |-
|
||||||
be a C_IDENTIFIER.
|
Name of the environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
value:
|
value:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -2670,6 +2761,43 @@ spec:
|
|||||||
- fieldPath
|
- fieldPath
|
||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
|
fileKeyRef:
|
||||||
|
description: |-
|
||||||
|
FileKeyRef selects a key of the env file.
|
||||||
|
Requires the EnvFiles feature gate to be enabled.
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
description: |-
|
||||||
|
The key within the env file. An invalid key will prevent the pod from starting.
|
||||||
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
|
During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
|
||||||
|
type: string
|
||||||
|
optional:
|
||||||
|
default: false
|
||||||
|
description: |-
|
||||||
|
Specify whether the file or its key must be defined. If the file or key
|
||||||
|
does not exist, then the env var is not published.
|
||||||
|
If optional is set to true and the specified key does not exist,
|
||||||
|
the environment variable will not be set in the Pod's containers.
|
||||||
|
|
||||||
|
If optional is set to false and the specified key does not exist,
|
||||||
|
an error will be returned during Pod creation.
|
||||||
|
type: boolean
|
||||||
|
path:
|
||||||
|
description: |-
|
||||||
|
The path within the volume from which to select the file.
|
||||||
|
Must be relative and may not contain the '..' path or start with '..'.
|
||||||
|
type: string
|
||||||
|
volumeName:
|
||||||
|
description: The name of the volume mount
|
||||||
|
containing the env file.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- path
|
||||||
|
- volumeName
|
||||||
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
resourceFieldRef:
|
resourceFieldRef:
|
||||||
description: |-
|
description: |-
|
||||||
Selects a resource of the container: only resources limits and requests
|
Selects a resource of the container: only resources limits and requests
|
||||||
@@ -2730,14 +2858,14 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
description: |-
|
description: |-
|
||||||
List of sources to populate environment variables in the container.
|
List of sources to populate environment variables in the container.
|
||||||
The keys defined within a source must be a C_IDENTIFIER. All invalid keys
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
will be reported as an event when the container is starting. When a key exists in multiple
|
When a key exists in multiple
|
||||||
sources, the value associated with the last source will take precedence.
|
sources, the value associated with the last source will take precedence.
|
||||||
Values defined by an Env with a duplicate key will take precedence.
|
Values defined by an Env with a duplicate key will take precedence.
|
||||||
Cannot be updated.
|
Cannot be updated.
|
||||||
items:
|
items:
|
||||||
description: EnvFromSource represents the source of a
|
description: EnvFromSource represents the source of a
|
||||||
set of ConfigMaps
|
set of ConfigMaps or Secrets
|
||||||
properties:
|
properties:
|
||||||
configMapRef:
|
configMapRef:
|
||||||
description: The ConfigMap to select from
|
description: The ConfigMap to select from
|
||||||
@@ -2758,8 +2886,9 @@ spec:
|
|||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
prefix:
|
prefix:
|
||||||
description: An optional identifier to prepend to
|
description: |-
|
||||||
each key in the ConfigMap. Must be a C_IDENTIFIER.
|
Optional text to prepend to the name of each environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
secretRef:
|
secretRef:
|
||||||
description: The Secret to select from
|
description: The Secret to select from
|
||||||
@@ -3019,6 +3148,12 @@ spec:
|
|||||||
- port
|
- port
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
stopSignal:
|
||||||
|
description: |-
|
||||||
|
StopSignal defines which signal will be sent to a container when it is being stopped.
|
||||||
|
If not specified, the default is defined by the container runtime in use.
|
||||||
|
StopSignal can only be set for Pods with a non-empty .spec.os.name
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
description: Probes are not allowed for ephemeral containers.
|
description: Probes are not allowed for ephemeral containers.
|
||||||
@@ -3409,7 +3544,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
@@ -3465,9 +3600,53 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
Restart policy for the container to manage the restart behavior of each
|
Restart policy for the container to manage the restart behavior of each
|
||||||
container within a pod.
|
container within a pod.
|
||||||
This may only be set for init containers. You cannot set this field on
|
You cannot set this field on ephemeral containers.
|
||||||
ephemeral containers.
|
|
||||||
type: string
|
type: string
|
||||||
|
restartPolicyRules:
|
||||||
|
description: |-
|
||||||
|
Represents a list of rules to be checked to determine if the
|
||||||
|
container should be restarted on exit. You cannot set this field on
|
||||||
|
ephemeral containers.
|
||||||
|
items:
|
||||||
|
description: ContainerRestartRule describes how a container
|
||||||
|
exit is handled.
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
description: |-
|
||||||
|
Specifies the action taken on a container exit if the requirements
|
||||||
|
are satisfied. The only possible value is "Restart" to restart the
|
||||||
|
container.
|
||||||
|
type: string
|
||||||
|
exitCodes:
|
||||||
|
description: Represents the exit codes to check on
|
||||||
|
container exits.
|
||||||
|
properties:
|
||||||
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents the relationship between the container exit code(s) and the
|
||||||
|
specified values. Possible values are:
|
||||||
|
- In: the requirement is satisfied if the container exit code is in the
|
||||||
|
set of specified values.
|
||||||
|
- NotIn: the requirement is satisfied if the container exit code is
|
||||||
|
not in the set of specified values.
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
description: |-
|
||||||
|
Specifies the set of values to check for container exit codes.
|
||||||
|
At most 255 elements are allowed.
|
||||||
|
items:
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: set
|
||||||
|
required:
|
||||||
|
- operator
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- action
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
securityContext:
|
securityContext:
|
||||||
description: |-
|
description: |-
|
||||||
Optional: SecurityContext defines the security options the ephemeral container should be run with.
|
Optional: SecurityContext defines the security options the ephemeral container should be run with.
|
||||||
@@ -4005,7 +4184,9 @@ spec:
|
|||||||
hostNetwork:
|
hostNetwork:
|
||||||
description: |-
|
description: |-
|
||||||
Host networking requested for this pod. Use the host's network namespace.
|
Host networking requested for this pod. Use the host's network namespace.
|
||||||
If this option is set, the ports that will be used must be specified.
|
When using HostNetwork you should specify ports so the scheduler is aware.
|
||||||
|
When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`,
|
||||||
|
and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`.
|
||||||
Default to false.
|
Default to false.
|
||||||
type: boolean
|
type: boolean
|
||||||
hostPID:
|
hostPID:
|
||||||
@@ -4030,6 +4211,19 @@ spec:
|
|||||||
Specifies the hostname of the Pod
|
Specifies the hostname of the Pod
|
||||||
If not specified, the pod's hostname will be set to a system-defined value.
|
If not specified, the pod's hostname will be set to a system-defined value.
|
||||||
type: string
|
type: string
|
||||||
|
hostnameOverride:
|
||||||
|
description: |-
|
||||||
|
HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod.
|
||||||
|
This field only specifies the pod's hostname and does not affect its DNS records.
|
||||||
|
When this field is set to a non-empty string:
|
||||||
|
- It takes precedence over the values set in `hostname` and `subdomain`.
|
||||||
|
- The Pod's hostname will be set to this value.
|
||||||
|
- `setHostnameAsFQDN` must be nil or set to false.
|
||||||
|
- `hostNetwork` must be set to false.
|
||||||
|
|
||||||
|
This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters.
|
||||||
|
Requires the HostnameOverride feature gate to be enabled.
|
||||||
|
type: string
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
description: |-
|
description: |-
|
||||||
ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
|
ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
|
||||||
@@ -4065,7 +4259,7 @@ spec:
|
|||||||
Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
|
Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
|
||||||
The resourceRequirements of an init container are taken into account during scheduling
|
The resourceRequirements of an init container are taken into account during scheduling
|
||||||
by finding the highest request/limit for each resource type, and then using the max of
|
by finding the highest request/limit for each resource type, and then using the max of
|
||||||
of that value or the sum of the normal containers. Limits are applied to init containers
|
that value or the sum of the normal containers. Limits are applied to init containers
|
||||||
in a similar fashion.
|
in a similar fashion.
|
||||||
Init containers cannot currently be added or removed.
|
Init containers cannot currently be added or removed.
|
||||||
Cannot be updated.
|
Cannot be updated.
|
||||||
@@ -4111,8 +4305,9 @@ spec:
|
|||||||
present in a Container.
|
present in a Container.
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: Name of the environment variable. Must
|
description: |-
|
||||||
be a C_IDENTIFIER.
|
Name of the environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
value:
|
value:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -4170,6 +4365,43 @@ spec:
|
|||||||
- fieldPath
|
- fieldPath
|
||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
|
fileKeyRef:
|
||||||
|
description: |-
|
||||||
|
FileKeyRef selects a key of the env file.
|
||||||
|
Requires the EnvFiles feature gate to be enabled.
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
description: |-
|
||||||
|
The key within the env file. An invalid key will prevent the pod from starting.
|
||||||
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
|
During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
|
||||||
|
type: string
|
||||||
|
optional:
|
||||||
|
default: false
|
||||||
|
description: |-
|
||||||
|
Specify whether the file or its key must be defined. If the file or key
|
||||||
|
does not exist, then the env var is not published.
|
||||||
|
If optional is set to true and the specified key does not exist,
|
||||||
|
the environment variable will not be set in the Pod's containers.
|
||||||
|
|
||||||
|
If optional is set to false and the specified key does not exist,
|
||||||
|
an error will be returned during Pod creation.
|
||||||
|
type: boolean
|
||||||
|
path:
|
||||||
|
description: |-
|
||||||
|
The path within the volume from which to select the file.
|
||||||
|
Must be relative and may not contain the '..' path or start with '..'.
|
||||||
|
type: string
|
||||||
|
volumeName:
|
||||||
|
description: The name of the volume mount
|
||||||
|
containing the env file.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- path
|
||||||
|
- volumeName
|
||||||
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
resourceFieldRef:
|
resourceFieldRef:
|
||||||
description: |-
|
description: |-
|
||||||
Selects a resource of the container: only resources limits and requests
|
Selects a resource of the container: only resources limits and requests
|
||||||
@@ -4230,14 +4462,14 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
description: |-
|
description: |-
|
||||||
List of sources to populate environment variables in the container.
|
List of sources to populate environment variables in the container.
|
||||||
The keys defined within a source must be a C_IDENTIFIER. All invalid keys
|
The keys defined within a source may consist of any printable ASCII characters except '='.
|
||||||
will be reported as an event when the container is starting. When a key exists in multiple
|
When a key exists in multiple
|
||||||
sources, the value associated with the last source will take precedence.
|
sources, the value associated with the last source will take precedence.
|
||||||
Values defined by an Env with a duplicate key will take precedence.
|
Values defined by an Env with a duplicate key will take precedence.
|
||||||
Cannot be updated.
|
Cannot be updated.
|
||||||
items:
|
items:
|
||||||
description: EnvFromSource represents the source of a
|
description: EnvFromSource represents the source of a
|
||||||
set of ConfigMaps
|
set of ConfigMaps or Secrets
|
||||||
properties:
|
properties:
|
||||||
configMapRef:
|
configMapRef:
|
||||||
description: The ConfigMap to select from
|
description: The ConfigMap to select from
|
||||||
@@ -4258,8 +4490,9 @@ spec:
|
|||||||
type: object
|
type: object
|
||||||
x-kubernetes-map-type: atomic
|
x-kubernetes-map-type: atomic
|
||||||
prefix:
|
prefix:
|
||||||
description: An optional identifier to prepend to
|
description: |-
|
||||||
each key in the ConfigMap. Must be a C_IDENTIFIER.
|
Optional text to prepend to the name of each environment variable.
|
||||||
|
May consist of any printable ASCII characters except '='.
|
||||||
type: string
|
type: string
|
||||||
secretRef:
|
secretRef:
|
||||||
description: The Secret to select from
|
description: The Secret to select from
|
||||||
@@ -4523,6 +4756,12 @@ spec:
|
|||||||
- port
|
- port
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
stopSignal:
|
||||||
|
description: |-
|
||||||
|
StopSignal defines which signal will be sent to a container when it is being stopped.
|
||||||
|
If not specified, the default is defined by the container runtime in use.
|
||||||
|
StopSignal can only be set for Pods with a non-empty .spec.os.name
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -4930,7 +5169,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
@@ -4985,10 +5224,10 @@ spec:
|
|||||||
restartPolicy:
|
restartPolicy:
|
||||||
description: |-
|
description: |-
|
||||||
RestartPolicy defines the restart behavior of individual containers in a pod.
|
RestartPolicy defines the restart behavior of individual containers in a pod.
|
||||||
This field may only be set for init containers, and the only allowed value is "Always".
|
This overrides the pod-level restart policy. When this field is not specified,
|
||||||
For non-init containers or when this field is not specified,
|
|
||||||
the restart behavior is defined by the Pod's restart policy and the container type.
|
the restart behavior is defined by the Pod's restart policy and the container type.
|
||||||
Setting the RestartPolicy as "Always" for the init container will have the following effect:
|
Additionally, setting the RestartPolicy as "Always" for the init container will
|
||||||
|
have the following effect:
|
||||||
this init container will be continually restarted on
|
this init container will be continually restarted on
|
||||||
exit until all regular containers have terminated. Once all regular
|
exit until all regular containers have terminated. Once all regular
|
||||||
containers have completed, all init containers with restartPolicy "Always"
|
containers have completed, all init containers with restartPolicy "Always"
|
||||||
@@ -5000,6 +5239,59 @@ spec:
|
|||||||
init container is started, or after any startupProbe has successfully
|
init container is started, or after any startupProbe has successfully
|
||||||
completed.
|
completed.
|
||||||
type: string
|
type: string
|
||||||
|
restartPolicyRules:
|
||||||
|
description: |-
|
||||||
|
Represents a list of rules to be checked to determine if the
|
||||||
|
container should be restarted on exit. The rules are evaluated in
|
||||||
|
order. Once a rule matches a container exit condition, the remaining
|
||||||
|
rules are ignored. If no rule matches the container exit condition,
|
||||||
|
the Container-level restart policy determines the whether the container
|
||||||
|
is restarted or not. Constraints on the rules:
|
||||||
|
- At most 20 rules are allowed.
|
||||||
|
- Rules can have the same action.
|
||||||
|
- Identical rules are not forbidden in validations.
|
||||||
|
When rules are specified, container MUST set RestartPolicy explicitly
|
||||||
|
even it if matches the Pod's RestartPolicy.
|
||||||
|
items:
|
||||||
|
description: ContainerRestartRule describes how a container
|
||||||
|
exit is handled.
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
description: |-
|
||||||
|
Specifies the action taken on a container exit if the requirements
|
||||||
|
are satisfied. The only possible value is "Restart" to restart the
|
||||||
|
container.
|
||||||
|
type: string
|
||||||
|
exitCodes:
|
||||||
|
description: Represents the exit codes to check on
|
||||||
|
container exits.
|
||||||
|
properties:
|
||||||
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents the relationship between the container exit code(s) and the
|
||||||
|
specified values. Possible values are:
|
||||||
|
- In: the requirement is satisfied if the container exit code is in the
|
||||||
|
set of specified values.
|
||||||
|
- NotIn: the requirement is satisfied if the container exit code is
|
||||||
|
not in the set of specified values.
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
description: |-
|
||||||
|
Specifies the set of values to check for container exit codes.
|
||||||
|
At most 255 elements are allowed.
|
||||||
|
items:
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: set
|
||||||
|
required:
|
||||||
|
- operator
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- action
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
securityContext:
|
securityContext:
|
||||||
description: |-
|
description: |-
|
||||||
SecurityContext defines the security options the container should be run with.
|
SecurityContext defines the security options the container should be run with.
|
||||||
@@ -5532,6 +5824,7 @@ spec:
|
|||||||
- spec.hostPID
|
- spec.hostPID
|
||||||
- spec.hostIPC
|
- spec.hostIPC
|
||||||
- spec.hostUsers
|
- spec.hostUsers
|
||||||
|
- spec.resources
|
||||||
- spec.securityContext.appArmorProfile
|
- spec.securityContext.appArmorProfile
|
||||||
- spec.securityContext.seLinuxOptions
|
- spec.securityContext.seLinuxOptions
|
||||||
- spec.securityContext.seccompProfile
|
- spec.securityContext.seccompProfile
|
||||||
@@ -5685,7 +5978,7 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
Resources is the total amount of CPU and Memory resources required by all
|
Resources is the total amount of CPU and Memory resources required by all
|
||||||
containers in the pod. It supports specifying Requests and Limits for
|
containers in the pod. It supports specifying Requests and Limits for
|
||||||
"cpu" and "memory" resource names only. ResourceClaims are not supported.
|
"cpu", "memory" and "hugepages-" resource names only. ResourceClaims are not supported.
|
||||||
|
|
||||||
This field enables fine-grained control over resource allocation for the
|
This field enables fine-grained control over resource allocation for the
|
||||||
entire pod, allowing resource sharing among containers in a pod.
|
entire pod, allowing resource sharing among containers in a pod.
|
||||||
@@ -5698,7 +5991,7 @@ spec:
|
|||||||
Claims lists the names of resources, defined in spec.resourceClaims,
|
Claims lists the names of resources, defined in spec.resourceClaims,
|
||||||
that are used by this container.
|
that are used by this container.
|
||||||
|
|
||||||
This is an alpha field and requires enabling the
|
This field depends on the
|
||||||
DynamicResourceAllocation feature gate.
|
DynamicResourceAllocation feature gate.
|
||||||
|
|
||||||
This field is immutable. It can only be set for containers.
|
This field is immutable. It can only be set for containers.
|
||||||
@@ -6235,7 +6528,6 @@ spec:
|
|||||||
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
|
- Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
|
||||||
|
|
||||||
If this value is nil, the behavior is equivalent to the Honor policy.
|
If this value is nil, the behavior is equivalent to the Honor policy.
|
||||||
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
|
|
||||||
type: string
|
type: string
|
||||||
nodeTaintsPolicy:
|
nodeTaintsPolicy:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -6246,7 +6538,6 @@ spec:
|
|||||||
- Ignore: node taints are ignored. All nodes are included.
|
- Ignore: node taints are ignored. All nodes are included.
|
||||||
|
|
||||||
If this value is nil, the behavior is equivalent to the Ignore policy.
|
If this value is nil, the behavior is equivalent to the Ignore policy.
|
||||||
This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
|
|
||||||
type: string
|
type: string
|
||||||
topologyKey:
|
topologyKey:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -6971,15 +7262,13 @@ spec:
|
|||||||
volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
|
volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
|
||||||
If specified, the CSI driver will create or update the volume with the attributes defined
|
If specified, the CSI driver will create or update the volume with the attributes defined
|
||||||
in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
|
in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
|
||||||
it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass
|
it can be changed after the claim is created. An empty string or nil value indicates that no
|
||||||
will be applied to the claim but it's not allowed to reset this field to empty string once it is set.
|
VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state,
|
||||||
If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass
|
this field can be reset to its previous value (including nil) to cancel the modification.
|
||||||
will be set by the persistentvolume controller if it exists.
|
|
||||||
If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
|
If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
|
||||||
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
|
set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
|
||||||
exists.
|
exists.
|
||||||
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
|
More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
|
||||||
(Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).
|
|
||||||
type: string
|
type: string
|
||||||
volumeMode:
|
volumeMode:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -7161,12 +7450,10 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
|
glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
|
||||||
Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.
|
Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.
|
||||||
More info: https://examples.k8s.io/volumes/glusterfs/README.md
|
|
||||||
properties:
|
properties:
|
||||||
endpoints:
|
endpoints:
|
||||||
description: |-
|
description: endpoints is the endpoint name that details
|
||||||
endpoints is the endpoint name that details Glusterfs topology.
|
Glusterfs topology.
|
||||||
More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
|
|
||||||
type: string
|
type: string
|
||||||
path:
|
path:
|
||||||
description: |-
|
description: |-
|
||||||
@@ -7220,7 +7507,7 @@ spec:
|
|||||||
The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
|
The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
|
||||||
The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
|
The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
|
||||||
The volume will be mounted read-only (ro) and non-executable files (noexec).
|
The volume will be mounted read-only (ro) and non-executable files (noexec).
|
||||||
Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath).
|
Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33.
|
||||||
The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
|
The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
|
||||||
properties:
|
properties:
|
||||||
pullPolicy:
|
pullPolicy:
|
||||||
@@ -7245,7 +7532,7 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
iscsi represents an ISCSI Disk resource that is attached to a
|
iscsi represents an ISCSI Disk resource that is attached to a
|
||||||
kubelet's host machine and then exposed to the pod.
|
kubelet's host machine and then exposed to the pod.
|
||||||
More info: https://examples.k8s.io/volumes/iscsi/README.md
|
More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi
|
||||||
properties:
|
properties:
|
||||||
chapAuthDiscovery:
|
chapAuthDiscovery:
|
||||||
description: chapAuthDiscovery defines whether support
|
description: chapAuthDiscovery defines whether support
|
||||||
@@ -7667,6 +7954,111 @@ spec:
|
|||||||
type: array
|
type: array
|
||||||
x-kubernetes-list-type: atomic
|
x-kubernetes-list-type: atomic
|
||||||
type: object
|
type: object
|
||||||
|
podCertificate:
|
||||||
|
description: |-
|
||||||
|
Projects an auto-rotating credential bundle (private key and certificate
|
||||||
|
chain) that the pod can use either as a TLS client or server.
|
||||||
|
|
||||||
|
Kubelet generates a private key and uses it to send a
|
||||||
|
PodCertificateRequest to the named signer. Once the signer approves the
|
||||||
|
request and issues a certificate chain, Kubelet writes the key and
|
||||||
|
certificate chain to the pod filesystem. The pod does not start until
|
||||||
|
certificates have been issued for each podCertificate projected volume
|
||||||
|
source in its spec.
|
||||||
|
|
||||||
|
Kubelet will begin trying to rotate the certificate at the time indicated
|
||||||
|
by the signer using the PodCertificateRequest.Status.BeginRefreshAt
|
||||||
|
timestamp.
|
||||||
|
|
||||||
|
Kubelet can write a single file, indicated by the credentialBundlePath
|
||||||
|
field, or separate files, indicated by the keyPath and
|
||||||
|
certificateChainPath fields.
|
||||||
|
|
||||||
|
The credential bundle is a single file in PEM format. The first PEM
|
||||||
|
entry is the private key (in PKCS#8 format), and the remaining PEM
|
||||||
|
entries are the certificate chain issued by the signer (typically,
|
||||||
|
signers will return their certificate chain in leaf-to-root order).
|
||||||
|
|
||||||
|
Prefer using the credential bundle format, since your application code
|
||||||
|
can read it atomically. If you use keyPath and certificateChainPath,
|
||||||
|
your application must make two separate file reads. If these coincide
|
||||||
|
with a certificate rotation, it is possible that the private key and leaf
|
||||||
|
certificate you read may not correspond to each other. Your application
|
||||||
|
will need to check for this condition, and re-read until they are
|
||||||
|
consistent.
|
||||||
|
|
||||||
|
The named signer controls chooses the format of the certificate it
|
||||||
|
issues; consult the signer implementation's documentation to learn how to
|
||||||
|
use the certificates it issues.
|
||||||
|
properties:
|
||||||
|
certificateChainPath:
|
||||||
|
description: |-
|
||||||
|
Write the certificate chain at this path in the projected volume.
|
||||||
|
|
||||||
|
Most applications should use credentialBundlePath. When using keyPath
|
||||||
|
and certificateChainPath, your application needs to check that the key
|
||||||
|
and leaf certificate are consistent, because it is possible to read the
|
||||||
|
files mid-rotation.
|
||||||
|
type: string
|
||||||
|
credentialBundlePath:
|
||||||
|
description: |-
|
||||||
|
Write the credential bundle at this path in the projected volume.
|
||||||
|
|
||||||
|
The credential bundle is a single file that contains multiple PEM blocks.
|
||||||
|
The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private
|
||||||
|
key.
|
||||||
|
|
||||||
|
The remaining blocks are CERTIFICATE blocks, containing the issued
|
||||||
|
certificate chain from the signer (leaf and any intermediates).
|
||||||
|
|
||||||
|
Using credentialBundlePath lets your Pod's application code make a single
|
||||||
|
atomic read that retrieves a consistent key and certificate chain. If you
|
||||||
|
project them to separate files, your application code will need to
|
||||||
|
additionally check that the leaf certificate was issued to the key.
|
||||||
|
type: string
|
||||||
|
keyPath:
|
||||||
|
description: |-
|
||||||
|
Write the key at this path in the projected volume.
|
||||||
|
|
||||||
|
Most applications should use credentialBundlePath. When using keyPath
|
||||||
|
and certificateChainPath, your application needs to check that the key
|
||||||
|
and leaf certificate are consistent, because it is possible to read the
|
||||||
|
files mid-rotation.
|
||||||
|
type: string
|
||||||
|
keyType:
|
||||||
|
description: |-
|
||||||
|
The type of keypair Kubelet will generate for the pod.
|
||||||
|
|
||||||
|
Valid values are "RSA3072", "RSA4096", "ECDSAP256", "ECDSAP384",
|
||||||
|
"ECDSAP521", and "ED25519".
|
||||||
|
type: string
|
||||||
|
maxExpirationSeconds:
|
||||||
|
description: |-
|
||||||
|
maxExpirationSeconds is the maximum lifetime permitted for the
|
||||||
|
certificate.
|
||||||
|
|
||||||
|
Kubelet copies this value verbatim into the PodCertificateRequests it
|
||||||
|
generates for this projection.
|
||||||
|
|
||||||
|
If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver
|
||||||
|
will reject values shorter than 3600 (1 hour). The maximum allowable
|
||||||
|
value is 7862400 (91 days).
|
||||||
|
|
||||||
|
The signer implementation is then free to issue a certificate with any
|
||||||
|
lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600
|
||||||
|
seconds (1 hour). This constraint is enforced by kube-apiserver.
|
||||||
|
`kubernetes.io` signers will never issue certificates with a lifetime
|
||||||
|
longer than 24 hours.
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
signerName:
|
||||||
|
description: Kubelet's generated CSRs will
|
||||||
|
be addressed to this signer.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- keyType
|
||||||
|
- signerName
|
||||||
|
type: object
|
||||||
secret:
|
secret:
|
||||||
description: secret information about the secret
|
description: secret information about the secret
|
||||||
data to project
|
data to project
|
||||||
@@ -7801,7 +8193,6 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
|
rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
|
||||||
Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.
|
Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.
|
||||||
More info: https://examples.k8s.io/volumes/rbd/README.md
|
|
||||||
properties:
|
properties:
|
||||||
fsType:
|
fsType:
|
||||||
description: |-
|
description: |-
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.17.1
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
name: packages.fission.io
|
name: packages.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.17.1
|
controller-gen.kubebuilder.io/version: v0.17.2
|
||||||
name: timetriggers.fission.io
|
name: timetriggers.fission.io
|
||||||
spec:
|
spec:
|
||||||
group: fission.io
|
group: fission.io
|
||||||
|
|||||||
+12
-10
@@ -1,13 +1,15 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
commonLabels:
|
|
||||||
group: fission.io
|
|
||||||
resources:
|
resources:
|
||||||
- fission.io_canaryconfigs.yaml
|
- fission.io_canaryconfigs.yaml
|
||||||
- fission.io_environments.yaml
|
- fission.io_environments.yaml
|
||||||
- fission.io_functions.yaml
|
- fission.io_functions.yaml
|
||||||
- fission.io_httptriggers.yaml
|
- fission.io_httptriggers.yaml
|
||||||
- fission.io_kuberneteswatchtriggers.yaml
|
- fission.io_kuberneteswatchtriggers.yaml
|
||||||
- fission.io_messagequeuetriggers.yaml
|
- fission.io_messagequeuetriggers.yaml
|
||||||
- fission.io_packages.yaml
|
- fission.io_packages.yaml
|
||||||
- fission.io_timetriggers.yaml
|
- fission.io_timetriggers.yaml
|
||||||
|
labels:
|
||||||
|
- includeSelectors: true
|
||||||
|
pairs:
|
||||||
|
group: fission.io
|
||||||
|
|||||||
@@ -1,60 +1,55 @@
|
|||||||
module github.com/fission/fission
|
module github.com/fission/fission
|
||||||
|
|
||||||
go 1.23.4
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
dario.cat/mergo v1.0.1
|
dario.cat/mergo v1.0.2
|
||||||
github.com/IBM/sarama v1.45.0
|
github.com/IBM/sarama v1.46.3
|
||||||
github.com/bep/debounce v1.2.1
|
github.com/bep/debounce v1.2.1
|
||||||
github.com/dchest/uniuri v1.2.0
|
github.com/dchest/uniuri v1.2.0
|
||||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
|
||||||
github.com/dustin/go-humanize v1.0.1
|
github.com/dustin/go-humanize v1.0.1
|
||||||
github.com/elastic/crd-ref-docs v0.1.0
|
|
||||||
github.com/fatih/color v1.18.0
|
github.com/fatih/color v1.18.0
|
||||||
github.com/fsnotify/fsnotify v1.8.0
|
github.com/fsnotify/fsnotify v1.9.0
|
||||||
github.com/go-git/go-git/v5 v5.13.1
|
github.com/go-git/go-git/v5 v5.16.4
|
||||||
github.com/go-logr/zapr v1.3.0
|
github.com/go-logr/zapr v1.3.0
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.1
|
github.com/golang-jwt/jwt/v4 v4.5.2
|
||||||
github.com/google/go-cmp v0.6.0
|
github.com/google/go-cmp v0.7.0
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/gorilla/mux v1.8.1
|
github.com/gorilla/mux v1.8.1
|
||||||
github.com/graymeta/stow v0.2.8
|
github.com/graymeta/stow v0.2.8
|
||||||
github.com/hashicorp/go-multierror v1.1.1
|
github.com/hashicorp/go-multierror v1.1.1
|
||||||
github.com/hashicorp/go-retryablehttp v0.7.7
|
github.com/hashicorp/go-retryablehttp v0.7.8
|
||||||
github.com/influxdata/influxdb v1.11.8
|
github.com/influxdata/influxdb v1.12.2
|
||||||
github.com/kedacore/keda/v2 v2.16.1
|
github.com/kedacore/keda/v2 v2.18.2
|
||||||
github.com/mholt/archives v0.1.0
|
github.com/mholt/archives v0.1.5
|
||||||
github.com/minio/minio-go v6.0.14+incompatible
|
github.com/minio/minio-go/v7 v7.0.97
|
||||||
github.com/ory/dockertest v3.3.5+incompatible
|
github.com/ory/dockertest/v3 v3.12.0
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/prometheus/client_golang v1.23.2
|
||||||
github.com/prometheus/client_golang v1.20.5
|
github.com/prometheus/common v0.67.4
|
||||||
github.com/prometheus/common v0.62.0
|
|
||||||
github.com/robfig/cron/v3 v3.0.1
|
github.com/robfig/cron/v3 v3.0.1
|
||||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
||||||
github.com/spf13/cobra v1.8.1
|
github.com/spf13/cobra v1.10.2
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.10
|
||||||
github.com/stretchr/testify v1.10.0
|
github.com/stretchr/testify v1.11.1
|
||||||
github.com/wcharczuk/go-chart v2.0.1+incompatible
|
github.com/wcharczuk/go-chart v2.0.1+incompatible
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0
|
||||||
go.opentelemetry.io/contrib/propagators/autoprop v0.59.0
|
go.opentelemetry.io/contrib/propagators/autoprop v0.64.0
|
||||||
go.opentelemetry.io/otel v1.34.0
|
go.opentelemetry.io/otel v1.39.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0
|
||||||
go.opentelemetry.io/otel/sdk v1.34.0
|
go.opentelemetry.io/otel/sdk v1.39.0
|
||||||
go.opentelemetry.io/otel/trace v1.34.0
|
go.opentelemetry.io/otel/trace v1.39.0
|
||||||
go.uber.org/zap v1.27.0
|
go.uber.org/zap v1.27.1
|
||||||
golang.org/x/net v0.34.0
|
golang.org/x/net v0.48.0
|
||||||
google.golang.org/grpc v1.69.4
|
google.golang.org/grpc v1.77.0
|
||||||
k8s.io/api v0.32.1
|
k8s.io/api v0.34.3
|
||||||
k8s.io/apiextensions-apiserver v0.32.1
|
k8s.io/apiextensions-apiserver v0.34.3
|
||||||
k8s.io/apimachinery v0.32.1
|
k8s.io/apimachinery v0.34.3
|
||||||
k8s.io/client-go v0.32.1
|
k8s.io/client-go v0.34.3
|
||||||
k8s.io/code-generator v0.32.1
|
k8s.io/metrics v0.34.3
|
||||||
k8s.io/metrics v0.32.1
|
sigs.k8s.io/controller-runtime v0.22.4
|
||||||
sigs.k8s.io/controller-runtime v0.19.4
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.1
|
||||||
sigs.k8s.io/controller-tools v0.17.1
|
sigs.k8s.io/yaml v1.6.0
|
||||||
sigs.k8s.io/structured-merge-diff/v4 v4.5.0
|
|
||||||
sigs.k8s.io/yaml v1.4.0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -62,62 +57,65 @@ require (
|
|||||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||||
github.com/Masterminds/semver v1.5.0 // indirect
|
github.com/Masterminds/semver v1.5.0 // indirect
|
||||||
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
|
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
|
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
|
||||||
github.com/ProtonMail/go-crypto v1.1.3 // indirect
|
github.com/ProtonMail/go-crypto v1.1.6 // indirect
|
||||||
github.com/STARRY-S/zip v0.2.1 // indirect
|
github.com/STARRY-S/zip v0.2.3 // indirect
|
||||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
github.com/andybalholm/brotli v1.2.0 // indirect
|
||||||
github.com/aws/aws-sdk-go v1.42.34 // indirect
|
github.com/aws/aws-sdk-go v1.55.7 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/blend/go-sdk v1.20220112.5 // indirect
|
github.com/blend/go-sdk v1.20220112.5 // indirect
|
||||||
github.com/bodgit/plumbing v1.3.0 // indirect
|
github.com/bodgit/plumbing v1.3.0 // indirect
|
||||||
github.com/bodgit/sevenzip v1.6.0 // indirect
|
github.com/bodgit/sevenzip v1.6.1 // indirect
|
||||||
github.com/bodgit/windows v1.0.1 // indirect
|
github.com/bodgit/windows v1.0.1 // indirect
|
||||||
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
|
||||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||||
|
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/cloudflare/circl v1.3.7 // indirect
|
github.com/cloudflare/circl v1.6.1 // indirect
|
||||||
github.com/containerd/continuity v0.2.2 // indirect
|
github.com/containerd/continuity v0.4.5 // indirect
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
|
||||||
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
|
github.com/cyphar/filepath-securejoin v0.5.1 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // 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/cli v27.4.1+incompatible // indirect
|
||||||
github.com/docker/go-units v0.4.0 // indirect
|
github.com/docker/docker v28.1.1+incompatible // indirect
|
||||||
|
github.com/docker/go-connections v0.5.0 // indirect
|
||||||
|
github.com/docker/go-units v0.5.0 // indirect
|
||||||
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
|
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
|
||||||
github.com/eapache/go-resiliency v1.7.0 // 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/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
|
||||||
github.com/eapache/queue v1.1.0 // indirect
|
github.com/eapache/queue v1.1.0 // indirect
|
||||||
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
|
github.com/elastic/crd-ref-docs v0.2.0 // indirect
|
||||||
|
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
|
||||||
github.com/emirpasic/gods v1.18.1 // indirect
|
github.com/emirpasic/gods v1.18.1 // indirect
|
||||||
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
|
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
|
||||||
github.com/expr-lang/expr v1.16.9 // indirect
|
github.com/expr-lang/expr v1.17.6 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||||
github.com/go-git/go-billy/v5 v5.6.1 // indirect
|
github.com/go-git/go-billy/v5 v5.6.2 // indirect
|
||||||
github.com/go-ini/ini v1.66.4 // indirect
|
github.com/go-ini/ini v1.67.0 // indirect
|
||||||
github.com/go-logr/logr v1.4.2 // indirect
|
github.com/go-logr/logr v1.4.3 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||||
github.com/go-openapi/swag v0.23.0 // indirect
|
github.com/go-openapi/swag v0.23.0 // indirect
|
||||||
|
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
|
||||||
github.com/gobuffalo/flect v1.0.3 // indirect
|
github.com/gobuffalo/flect v1.0.3 // indirect
|
||||||
github.com/goccy/go-yaml v1.11.3 // indirect
|
github.com/goccy/go-yaml v1.18.0 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
|
||||||
github.com/golang/protobuf v1.5.4 // indirect
|
github.com/golang/snappy v1.0.0 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/google/btree v1.1.3 // indirect
|
||||||
github.com/google/gnostic-models v0.6.8 // indirect
|
github.com/google/gnostic-models v0.7.0 // indirect
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||||
github.com/gorilla/websocket v1.5.1 // indirect
|
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
|
||||||
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
|
|
||||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||||
github.com/huandu/xstrings v1.3.3 // indirect
|
github.com/huandu/xstrings v1.5.0 // indirect
|
||||||
github.com/imdario/mergo v0.3.16 // indirect
|
github.com/imdario/mergo v0.3.16 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||||
@@ -130,74 +128,100 @@ require (
|
|||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||||
github.com/klauspost/compress v1.17.11 // indirect
|
github.com/klauspost/compress v1.18.1 // indirect
|
||||||
|
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||||
|
github.com/klauspost/crc32 v1.3.0 // indirect
|
||||||
github.com/klauspost/pgzip v1.2.6 // indirect
|
github.com/klauspost/pgzip v1.2.6 // indirect
|
||||||
github.com/lib/pq v1.10.4 // indirect
|
github.com/mailru/easyjson v0.9.0 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
|
github.com/mikelolasagasti/xz v1.0.1 // indirect
|
||||||
|
github.com/minio/crc64nvme v1.1.0 // indirect
|
||||||
|
github.com/minio/md5-simd v1.1.2 // indirect
|
||||||
|
github.com/minio/minlz v1.0.1 // indirect
|
||||||
github.com/mitchellh/copystructure v1.2.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/mitchellh/reflectwalk v1.0.2 // indirect
|
||||||
|
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||||
github.com/moby/spdystream v0.5.0 // indirect
|
github.com/moby/spdystream v0.5.0 // indirect
|
||||||
|
github.com/moby/sys/user v0.3.0 // indirect
|
||||||
|
github.com/moby/term v0.5.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||||
github.com/nwaples/rardecode/v2 v2.0.0-beta.4.0.20241112120701-034e449c6e78 // indirect
|
github.com/nwaples/rardecode/v2 v2.2.0 // indirect
|
||||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||||
github.com/opencontainers/image-spec v1.0.2 // indirect
|
github.com/opencontainers/image-spec v1.1.0 // indirect
|
||||||
github.com/opencontainers/runc v1.1.14 // indirect
|
github.com/opencontainers/runc v1.2.8 // indirect
|
||||||
|
github.com/philhofer/fwd v1.2.0 // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
github.com/pjbgf/sha1cd v0.3.2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // 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/client_model v0.6.2 // indirect
|
||||||
github.com/prometheus/procfs v0.15.1 // indirect
|
github.com/prometheus/procfs v0.17.0 // indirect
|
||||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
|
||||||
|
github.com/rs/xid v1.6.0 // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
github.com/sergi/go-diff v1.4.0 // indirect
|
||||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||||
github.com/skeema/knownhosts v1.3.0 // indirect
|
github.com/skeema/knownhosts v1.3.1 // indirect
|
||||||
github.com/sorairolake/lzip-go v0.3.5 // indirect
|
github.com/sorairolake/lzip-go v0.3.8 // indirect
|
||||||
github.com/therootcompany/xz v1.0.1 // indirect
|
github.com/spf13/afero v1.15.0 // indirect
|
||||||
github.com/ulikunitz/xz v0.5.12 // indirect
|
github.com/tinylib/msgp v1.3.0 // indirect
|
||||||
|
github.com/ulikunitz/xz v0.5.15 // indirect
|
||||||
github.com/x448/float16 v0.8.4 // indirect
|
github.com/x448/float16 v0.8.4 // indirect
|
||||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||||
go.opentelemetry.io/contrib/propagators/aws v1.34.0 // indirect
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||||
go.opentelemetry.io/contrib/propagators/b3 v1.34.0 // indirect
|
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||||
go.opentelemetry.io/contrib/propagators/jaeger v1.34.0 // indirect
|
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||||
go.opentelemetry.io/contrib/propagators/ot v1.34.0 // indirect
|
go.opentelemetry.io/contrib/propagators/aws v1.39.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v1.34.0 // indirect
|
go.opentelemetry.io/contrib/propagators/b3 v1.39.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
|
go.opentelemetry.io/contrib/propagators/jaeger v1.39.0 // indirect
|
||||||
|
go.opentelemetry.io/contrib/propagators/ot v1.39.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/metric v1.39.0 // indirect
|
||||||
|
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
|
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||||
|
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||||
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
|
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
|
||||||
golang.org/x/crypto v0.32.0 // indirect
|
golang.org/x/crypto v0.46.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
|
|
||||||
golang.org/x/image v0.18.0 // indirect
|
golang.org/x/image v0.18.0 // indirect
|
||||||
golang.org/x/mod v0.22.0 // indirect
|
golang.org/x/mod v0.30.0 // indirect
|
||||||
golang.org/x/oauth2 v0.24.0 // indirect
|
golang.org/x/oauth2 v0.33.0 // indirect
|
||||||
golang.org/x/sync v0.10.0 // indirect
|
golang.org/x/sync v0.19.0 // indirect
|
||||||
golang.org/x/sys v0.29.0 // indirect
|
golang.org/x/sys v0.39.0 // indirect
|
||||||
golang.org/x/term v0.28.0 // indirect
|
golang.org/x/term v0.38.0 // indirect
|
||||||
golang.org/x/text v0.21.0 // indirect
|
golang.org/x/text v0.32.0 // indirect
|
||||||
golang.org/x/time v0.8.0 // indirect
|
golang.org/x/time v0.14.0 // indirect
|
||||||
golang.org/x/tools v0.29.0 // indirect
|
golang.org/x/tools v0.39.0 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
|
||||||
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
|
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
|
google.golang.org/protobuf v1.36.10 // indirect
|
||||||
google.golang.org/protobuf v1.36.3 // indirect
|
|
||||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
gotest.tools v2.2.0+incompatible // indirect
|
k8s.io/code-generator v0.34.3 // indirect
|
||||||
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
|
k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect
|
||||||
k8s.io/klog/v2 v2.130.1 // indirect
|
k8s.io/klog/v2 v2.130.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
|
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
|
||||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
|
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
|
||||||
knative.dev/pkg v0.0.0-20241218051509-40afb7c5436e // indirect
|
knative.dev/pkg v0.0.0-20250326102644-9f3e60a9244c // indirect
|
||||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
|
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250211091558-894df3a7e664 // indirect
|
||||||
|
sigs.k8s.io/controller-tools v0.19.0 // indirect
|
||||||
|
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
|
||||||
|
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
tool (
|
||||||
|
github.com/elastic/crd-ref-docs
|
||||||
|
k8s.io/code-generator
|
||||||
|
sigs.k8s.io/controller-runtime/tools/setup-envtest
|
||||||
|
sigs.k8s.io/controller-tools/cmd/controller-gen
|
||||||
|
)
|
||||||
|
|
||||||
|
replace k8s.io/code-generator => github.com/fission/code-generator v0.18.0-alpha.1.0.20250914164041-5cd640227cd4
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
if ! command -v dashboard-linter >/dev/null 2>&1; then
|
if ! command -v dashboard-linter >/dev/null 2>&1; then
|
||||||
echo "dashboard-linter is not installed"
|
echo "dashboard-linter is not installed"
|
||||||
|
echo "Installing dashboard-linter..."
|
||||||
|
go install github.com/grafana/dashboard-linter@latest
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
BASE_PATH=$(pwd)
|
BASE_PATH=$(pwd)
|
||||||
|
|||||||
+1
-2
@@ -28,8 +28,7 @@ set +x
|
|||||||
# for codecov
|
# for codecov
|
||||||
echo "" > coverage.txt
|
echo "" > coverage.txt
|
||||||
|
|
||||||
make install-envtest
|
KUBEBUILDER_ASSETS=$(go tool setup-envtest -p path use 1.30.x)
|
||||||
KUBEBUILDER_ASSETS=$(setup-envtest -p path use 1.30.x)
|
|
||||||
export KUBEBUILDER_ASSETS
|
export KUBEBUILDER_ASSETS
|
||||||
|
|
||||||
# The executor unit test only works with NodePort-type services for
|
# The executor unit test only works with NodePort-type services for
|
||||||
|
|||||||
@@ -3,11 +3,18 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
CODEGEN_PKG_VERSION=$(go list -m -f '{{.Replace.Version}}' k8s.io/code-generator)
|
||||||
|
if [ -z "$CODEGEN_PKG_VERSION" ]; then
|
||||||
|
echo "Error: could not determine code-generator version from go.mod"
|
||||||
|
echo "Received output: '$CODEGEN_PKG_VERSION'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
GOPATH=$(go env GOPATH)
|
GOPATH=$(go env GOPATH)
|
||||||
|
GOMODCACHEPATH=$(go env GOMODCACHE)
|
||||||
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||||
CODEGEN_PKG=${CODEGEN_PKG:-$(
|
CODEGEN_PKG=${CODEGEN_PKG:-$(
|
||||||
cd "${SCRIPT_ROOT}"
|
cd "${SCRIPT_ROOT}"
|
||||||
ls -d -1 ${SCRIPT_ROOT}/../code-generator 2>/dev/null || echo $GOPATH/pkg/mod/k8s.io/code-generator@v0.32.0
|
echo ${GOMODCACHEPATH}/github.com/fission/code-generator@${CODEGEN_PKG_VERSION}
|
||||||
)}
|
)}
|
||||||
OUTDIR="${SCRIPT_ROOT}/pkg/generated"
|
OUTDIR="${SCRIPT_ROOT}/pkg/generated"
|
||||||
|
|
||||||
|
|||||||
@@ -599,7 +599,7 @@ func (e *Environment) Validate() error {
|
|||||||
|
|
||||||
if e.Spec.Runtime.PodSpec != nil {
|
if e.Spec.Runtime.PodSpec != nil {
|
||||||
for _, container := range e.Spec.Runtime.PodSpec.Containers {
|
for _, container := range e.Spec.Runtime.PodSpec.Containers {
|
||||||
if container.Command == nil && container.Image == e.Spec.Runtime.Image && container.Name != e.ObjectMeta.Name {
|
if container.Command == nil && container.Image == e.Spec.Runtime.Image && container.Name != e.Name {
|
||||||
result = multierror.Append(result, errors.New("container with image same as runtime image in podspec, must have name same as environment name"))
|
result = multierror.Append(result, errors.New("container with image same as runtime image in podspec, must have name same as environment name"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dchest/uniuri"
|
"github.com/dchest/uniuri"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/info"
|
"github.com/fission/fission/pkg/info"
|
||||||
@@ -206,7 +205,7 @@ func (builder *Builder) reply(ctx context.Context, w http.ResponseWriter, pkgFil
|
|||||||
|
|
||||||
rBody, err := json.Marshal(resp)
|
rBody, err := json.Marshal(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e := errors.Wrap(err, "error encoding response body")
|
e := fmt.Errorf("error encoding response body: %w", err)
|
||||||
rBody = []byte(fmt.Sprintf(`{"buildLogs": "%s"}`, e.Error()))
|
rBody = []byte(fmt.Sprintf(`{"buildLogs": "%s"}`, e.Error()))
|
||||||
statusCode = http.StatusInternalServerError
|
statusCode = http.StatusInternalServerError
|
||||||
}
|
}
|
||||||
@@ -247,12 +246,12 @@ func (builder *Builder) build(ctx context.Context, command string, args []string
|
|||||||
|
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "error creating stdout pipe for cmd")
|
return "", fmt.Errorf("error creating stdout pipe for cmd: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
stderr, err := cmd.StderrPipe()
|
stderr, err := cmd.StderrPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "error creating stderr pipe for cmd")
|
return "", fmt.Errorf("error creating stderr pipe for cmd: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init logs
|
// Init logs
|
||||||
@@ -263,7 +262,7 @@ func (builder *Builder) build(ctx context.Context, command string, args []string
|
|||||||
|
|
||||||
err = cmd.Start()
|
err = cmd.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "error starting cmd")
|
return "", fmt.Errorf("error starting cmd: %w", err)
|
||||||
}
|
}
|
||||||
fmt.Printf("========= START =========\n")
|
fmt.Printf("========= START =========\n")
|
||||||
defer fmt.Printf("========= END ===========\n")
|
defer fmt.Printf("========= END ===========\n")
|
||||||
@@ -276,14 +275,14 @@ func (builder *Builder) build(ctx context.Context, command string, args []string
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := scanner.Err(); err != nil {
|
if err := scanner.Err(); err != nil {
|
||||||
scanErr := errors.Wrap(err, "error reading cmd output")
|
scanErr := fmt.Errorf("error reading cmd output: %w", err)
|
||||||
fmt.Println(scanErr)
|
fmt.Println(scanErr)
|
||||||
return buildLogs, scanErr
|
return buildLogs, scanErr
|
||||||
}
|
}
|
||||||
|
|
||||||
err = cmd.Wait()
|
err = cmd.Wait()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmdErr := errors.Wrapf(err, "error waiting for cmd %q", command)
|
cmdErr := fmt.Errorf("error waiting for cmd %q: %w", command, err)
|
||||||
fmt.Println(cmdErr)
|
fmt.Println(cmdErr)
|
||||||
return buildLogs, cmdErr
|
return buildLogs, cmdErr
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/go-retryablehttp"
|
"github.com/hashicorp/go-retryablehttp"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
@@ -68,26 +68,26 @@ func (c *client) Build(ctx context.Context, req *builder.PackageBuildRequest) (*
|
|||||||
|
|
||||||
body, err := json.Marshal(req)
|
body, err := json.Marshal(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error marshaling json")
|
return nil, fmt.Errorf("error marshaling json: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := ctxhttp.Post(ctx, c.httpClient.StandardClient(), c.url, "application/json", bytes.NewReader(body))
|
resp, err := ctxhttp.Post(ctx, c.httpClient.StandardClient(), c.url, "application/json", bytes.NewReader(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("error sending request: %w", err)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
rBody, err := io.ReadAll(resp.Body)
|
rBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("error reading resp body", zap.Error(err))
|
logger.Error("error reading resp body", zap.Error(err))
|
||||||
return nil, err
|
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgBuildResp := builder.PackageBuildResponse{}
|
pkgBuildResp := builder.PackageBuildResponse{}
|
||||||
err = json.Unmarshal(rBody, &pkgBuildResp)
|
err = json.Unmarshal(rBody, &pkgBuildResp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("error parsing resp body", zap.Error(err))
|
logger.Error("error parsing resp body", zap.Error(err))
|
||||||
return nil, err
|
return nil, fmt.Errorf("error parsing response body: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &pkgBuildResp, ferror.MakeErrorFromHTTP(resp)
|
return &pkgBuildResp, ferror.MakeErrorFromHTTP(resp)
|
||||||
@@ -98,7 +98,7 @@ func (c *client) Clean(ctx context.Context, srcPkgFilename string) error {
|
|||||||
|
|
||||||
req, err := http.NewRequest(http.MethodDelete, c.getCleanUrl(srcPkgFilename), http.NoBody)
|
req, err := http.NewRequest(http.MethodDelete, c.getCleanUrl(srcPkgFilename), http.NoBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to create http request for clean api")
|
return fmt.Errorf("error creating http request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := ctxhttp.Do(ctx, c.httpClient.StandardClient(), req)
|
resp, err := ctxhttp.Do(ctx, c.httpClient.StandardClient(), req)
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ package buildermgr
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -38,21 +38,21 @@ func Start(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *
|
|||||||
|
|
||||||
fissionClient, err := clientGen.GetFissionClient()
|
fissionClient, err := clientGen.GetFissionClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get fission client")
|
return fmt.Errorf("failed to get fission client: %w", err)
|
||||||
}
|
}
|
||||||
kubernetesClient, err := clientGen.GetKubernetesClient()
|
kubernetesClient, err := clientGen.GetKubernetesClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get kubernetes client")
|
return fmt.Errorf("failed to get kubernetes client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error waiting for CRDs")
|
return fmt.Errorf("error waiting for CRDs: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/packages")
|
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/packages")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error making fetcher config")
|
return fmt.Errorf("error making fetcher config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
podSpecPatch, err := util.GetSpecFromConfigMap(fv1.BuilderPodSpecPath)
|
podSpecPatch, err := util.GetSpecFromConfigMap(fv1.BuilderPodSpecPath)
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dchest/uniuri"
|
"github.com/dchest/uniuri"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -162,7 +161,7 @@ func updatePackage(ctx context.Context, logger *zap.Logger, fissionClient versio
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
e := "error updating package"
|
e := "error updating package"
|
||||||
logger.Error(e, zap.Error(err))
|
logger.Error(e, zap.Error(err))
|
||||||
return nil, errors.Wrap(err, e)
|
return nil, fmt.Errorf("%s: %w", e, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// return resource version for function to update function package ref
|
// return resource version for function to update function package ref
|
||||||
|
|||||||
@@ -461,7 +461,7 @@ func (canaryCfgMgr *canaryConfigMgr) rollback(ctx context.Context, canaryConfig
|
|||||||
functionWeights[canaryConfig.Spec.NewFunction] = 0
|
functionWeights[canaryConfig.Spec.NewFunction] = 0
|
||||||
functionWeights[canaryConfig.Spec.OldFunction] = 100
|
functionWeights[canaryConfig.Spec.OldFunction] = 100
|
||||||
|
|
||||||
err := canaryCfgMgr.updateHttpTriggerWithRetries(ctx, trigger.ObjectMeta.Name, trigger.ObjectMeta.Namespace, functionWeights)
|
err := canaryCfgMgr.updateHttpTriggerWithRetries(ctx, trigger.Name, trigger.ObjectMeta.Namespace, functionWeights)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -494,7 +494,7 @@ func (canaryCfgMgr *canaryConfigMgr) rollForward(ctx context.Context, canaryConf
|
|||||||
zap.String("namespace", canaryConfig.ObjectMeta.Namespace),
|
zap.String("namespace", canaryConfig.ObjectMeta.Namespace),
|
||||||
zap.Any("function_weights", functionWeights))
|
zap.Any("function_weights", functionWeights))
|
||||||
|
|
||||||
err := canaryCfgMgr.updateHttpTriggerWithRetries(ctx, trigger.ObjectMeta.Name, trigger.ObjectMeta.Namespace, functionWeights)
|
err := canaryCfgMgr.updateHttpTriggerWithRetries(ctx, trigger.Name, trigger.ObjectMeta.Namespace, functionWeights)
|
||||||
return doneProcessingCanaryConfig, err
|
return doneProcessingCanaryConfig, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ package canaryconfigmgr
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ func ConfigureFeatures(ctx context.Context, logger *zap.Logger, unitTestMode boo
|
|||||||
// in the future when new optional features are added, we need to add corresponding feature handlers and invoke them here
|
// in the future when new optional features are added, we need to add corresponding feature handlers and invoke them here
|
||||||
canaryCfgMgr, err := MakeCanaryConfigMgr(ctx, logger, fissionClient, kubeClient, featureConfig.CanaryConfig.PrometheusSvc)
|
canaryCfgMgr, err := MakeCanaryConfigMgr(ctx, logger, fissionClient, kubeClient, featureConfig.CanaryConfig.PrometheusSvc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to start canary config manager")
|
return fmt.Errorf("failed to start canary config manager: %w", err)
|
||||||
}
|
}
|
||||||
canaryCfgMgr.Run(ctx, mgr)
|
canaryCfgMgr.Run(ctx, mgr)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
prometheus "github.com/prometheus/client_golang/api"
|
prometheus "github.com/prometheus/client_golang/api"
|
||||||
prometheusv1 "github.com/prometheus/client_golang/api/prometheus/v1"
|
prometheusv1 "github.com/prometheus/client_golang/api/prometheus/v1"
|
||||||
"github.com/prometheus/common/model"
|
"github.com/prometheus/common/model"
|
||||||
@@ -40,7 +39,7 @@ func MakePrometheusClient(logger *zap.Logger, prometheusSvc string) (*Prometheus
|
|||||||
|
|
||||||
promApiClient, err := prometheus.NewClient(promApiConfig)
|
promApiClient, err := prometheus.NewClient(promApiConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "error creating prometheus api client for svc: %s", prometheusSvc)
|
return nil, fmt.Errorf("error creating prometheus api client for svc: %s: %w", prometheusSvc, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
apiQueryClient := prometheusv1.NewAPI(promApiClient)
|
apiQueryClient := prometheusv1.NewAPI(promApiClient)
|
||||||
@@ -91,14 +90,14 @@ func (promApiClient *PrometheusApiClient) GetRequestsToFuncInWindow(ctx context.
|
|||||||
|
|
||||||
reqs, err := promApiClient.executeQuery(ctx, queryString)
|
reqs, err := promApiClient.executeQuery(ctx, queryString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
return 0, fmt.Errorf("error executing query %s: %w", queryString, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
queryString = fmt.Sprintf("fission_function_calls_total{%s} offset %v", queryLabels, window)
|
queryString = fmt.Sprintf("fission_function_calls_total{%s} offset %v", queryLabels, window)
|
||||||
|
|
||||||
reqsInPrevWindow, err := promApiClient.executeQuery(ctx, queryString)
|
reqsInPrevWindow, err := promApiClient.executeQuery(ctx, queryString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
return 0, fmt.Errorf("error executing query %s: %w", queryString, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
reqsInCurrentWindow := reqs - reqsInPrevWindow
|
reqsInCurrentWindow := reqs - reqsInPrevWindow
|
||||||
@@ -117,14 +116,14 @@ func (promApiClient *PrometheusApiClient) GetTotalFailedRequestsToFuncInWindow(c
|
|||||||
|
|
||||||
failedRequests, err := promApiClient.executeQuery(ctx, queryString)
|
failedRequests, err := promApiClient.executeQuery(ctx, queryString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
return 0, fmt.Errorf("error executing query %s: %w", queryString, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
queryString = fmt.Sprintf("fission_function_errors_total{%s} offset %v", queryLabels, window)
|
queryString = fmt.Sprintf("fission_function_errors_total{%s} offset %v", queryLabels, window)
|
||||||
|
|
||||||
failedReqsInPrevWindow, err := promApiClient.executeQuery(ctx, queryString)
|
failedReqsInPrevWindow, err := promApiClient.executeQuery(ctx, queryString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
return 0, fmt.Errorf("error executing query %s: %w", queryString, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
failedReqsInCurrentWindow := failedRequests - failedReqsInPrevWindow
|
failedReqsInCurrentWindow := failedRequests - failedReqsInPrevWindow
|
||||||
@@ -142,7 +141,7 @@ func (promApiClient *PrometheusApiClient) executeQuery(ctx context.Context, quer
|
|||||||
|
|
||||||
val, warn, err := promApiClient.client.Query(ctx, queryString, time.Now())
|
val, warn, err := promApiClient.client.Query(ctx, queryString, time.Now())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error querying prometheus")
|
return 0, fmt.Errorf("error querying prometheus: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if warn != nil {
|
if warn != nil {
|
||||||
|
|||||||
+1
-1
@@ -21,6 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
kedaClient "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -32,7 +33,6 @@ import (
|
|||||||
|
|
||||||
"github.com/fission/fission/pkg/generated/clientset/versioned"
|
"github.com/fission/fission/pkg/generated/clientset/versioned"
|
||||||
"github.com/fission/fission/pkg/utils"
|
"github.com/fission/fission/pkg/utils"
|
||||||
kedaClient "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
package error
|
package error
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIsNotFound(t *testing.T) {
|
func TestIsNotFound(t *testing.T) {
|
||||||
errs := map[error]bool{
|
errs := map[error]bool{
|
||||||
nil: false,
|
nil: false,
|
||||||
MakeError(ErrorNotFound, "someone not found"): true,
|
MakeError(ErrorNotFound, "someone not found"): true,
|
||||||
MakeError(ErrorTooManyRequests, "too many requests"): false,
|
MakeError(ErrorTooManyRequests, "too many requests"): false,
|
||||||
errors.Wrap(MakeError(ErrorNotFound, "someone not found"), "other information"): true,
|
fmt.Errorf("other information: %w", MakeError(ErrorNotFound, "someone not found")): true,
|
||||||
errors.Wrap(MakeError(ErrorTooManyRequests, "too many requests"), "other information"): false,
|
fmt.Errorf("other information: %w", MakeError(ErrorTooManyRequests, "too many requests")): false,
|
||||||
}
|
}
|
||||||
|
|
||||||
for err, want := range errs {
|
for err, want := range errs {
|
||||||
@@ -25,9 +25,9 @@ func TestIsNotFound(t *testing.T) {
|
|||||||
func TestGetHTTPError(t *testing.T) {
|
func TestGetHTTPError(t *testing.T) {
|
||||||
errs := map[int]error{
|
errs := map[int]error{
|
||||||
http.StatusBadRequest: MakeError(ErrorInvalidArgument, ""),
|
http.StatusBadRequest: MakeError(ErrorInvalidArgument, ""),
|
||||||
http.StatusConflict: errors.Wrap(MakeError(ErrorNameExists, ""), ""),
|
http.StatusConflict: fmt.Errorf("%w", MakeError(ErrorNameExists, "")),
|
||||||
http.StatusNotFound: errors.Wrap(MakeError(ErrorNotFound, ""), ""),
|
http.StatusNotFound: fmt.Errorf("%w", MakeError(ErrorNotFound, "")),
|
||||||
http.StatusTooManyRequests: errors.Wrap(MakeError(ErrorTooManyRequests, "too many requests"), "other information"),
|
http.StatusTooManyRequests: fmt.Errorf("other information: %w", MakeError(ErrorTooManyRequests, "too many requests")),
|
||||||
}
|
}
|
||||||
for want, err := range errs {
|
for want, err := range errs {
|
||||||
code, _ := GetHTTPError(err)
|
code, _ := GetHTTPError(err)
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/go-retryablehttp"
|
"github.com/hashicorp/go-retryablehttp"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -80,18 +80,18 @@ func (c *client) GetServiceForFunction(ctx context.Context, fn *fv1.Function) (s
|
|||||||
|
|
||||||
body, err := json.Marshal(fn)
|
body, err := json.Marshal(fn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "could not marshal request body for getting service for function")
|
return "", fmt.Errorf("could not marshal request body for getting service for function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := retryablehttp.NewRequestWithContext(ctx, "POST", executorURL, bytes.NewReader(body))
|
req, err := retryablehttp.NewRequestWithContext(ctx, "POST", executorURL, bytes.NewReader(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "could not create request for getting service for function")
|
return "", fmt.Errorf("could not create request for getting service for function: %w", err)
|
||||||
}
|
}
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
resp, err := c.httpClient.Do(req)
|
resp, err := c.httpClient.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "error posting to getting service for function")
|
return "", fmt.Errorf("error posting to getting service for function: %w", err)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ func (c *client) GetServiceForFunction(ctx context.Context, fn *fv1.Function) (s
|
|||||||
|
|
||||||
svcName, err := io.ReadAll(resp.Body)
|
svcName, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "error reading response body from getting service for function")
|
return "", fmt.Errorf("error reading response body from getting service for function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(svcName), nil
|
return string(svcName), nil
|
||||||
@@ -118,17 +118,17 @@ func (c *client) UnTapService(ctx context.Context, fnMeta metav1.ObjectMeta, exe
|
|||||||
|
|
||||||
body, err := json.Marshal(tapSvc)
|
body, err := json.Marshal(tapSvc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "could not marshal request body for getting service for function")
|
return fmt.Errorf("could not marshal request body for getting service for function: %w", err)
|
||||||
}
|
}
|
||||||
req, err := retryablehttp.NewRequestWithContext(ctx, "POST", url, bytes.NewReader(body))
|
req, err := retryablehttp.NewRequestWithContext(ctx, "POST", url, bytes.NewReader(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "could not create request for untap service for function")
|
return fmt.Errorf("could not create request for untap service for function: %w", err)
|
||||||
}
|
}
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
resp, err := c.httpClient.Do(req)
|
resp, err := c.httpClient.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error posting to getting service for function")
|
return fmt.Errorf("error posting to getting service for function: %w", err)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ func (c *client) _tapService(ctx context.Context, tapSvcReqs []TapServiceRequest
|
|||||||
|
|
||||||
req, err := retryablehttp.NewRequestWithContext(ctx, "POST", executorURL, bytes.NewReader(body))
|
req, err := retryablehttp.NewRequestWithContext(ctx, "POST", executorURL, bytes.NewReader(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "could not create request for tap service request")
|
return fmt.Errorf("could not create request for tap service request: %w", err)
|
||||||
}
|
}
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ package cms
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/client-go/tools/cache"
|
"k8s.io/client-go/tools/cache"
|
||||||
@@ -72,7 +72,7 @@ func refreshPods(ctx context.Context, logger *zap.Logger, funcs []fv1.Function,
|
|||||||
if exists {
|
if exists {
|
||||||
err = et.RefreshFuncPods(ctx, logger, f)
|
err = et.RefreshFuncPods(ctx, logger, f)
|
||||||
} else {
|
} else {
|
||||||
err = errors.Errorf("Unknown executor type '%s'", f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType)
|
err = fmt.Errorf("unknown executor type '%s'", f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
+21
-24
@@ -26,7 +26,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dchest/uniuri"
|
"github.com/dchest/uniuri"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
k8sCache "k8s.io/client-go/tools/cache"
|
k8sCache "k8s.io/client-go/tools/cache"
|
||||||
|
|
||||||
@@ -155,12 +154,11 @@ func (executor *Executor) serveCreateFuncServices(ctx context.Context) {
|
|||||||
// create a waitgroup for other requests for
|
// create a waitgroup for other requests for
|
||||||
// the same function to wait on
|
// the same function to wait on
|
||||||
wg := &sync.WaitGroup{}
|
wg := &sync.WaitGroup{}
|
||||||
wg.Add(1)
|
|
||||||
executor.fsCreateWg.Store(fnkeyUR, wg)
|
executor.fsCreateWg.Store(fnkeyUR, wg)
|
||||||
|
|
||||||
// launch a goroutine for each request, to parallelize
|
// launch a goroutine for each request, to parallelize
|
||||||
// the specialization of different functions
|
// the specialization of different functions
|
||||||
go func() {
|
wg.Go(func() {
|
||||||
// Control overall specialization time by setting function
|
// Control overall specialization time by setting function
|
||||||
// specialization time to context. The reason not to use
|
// specialization time to context. The reason not to use
|
||||||
// context from router requests is because a request maybe
|
// context from router requests is because a request maybe
|
||||||
@@ -189,8 +187,7 @@ func (executor *Executor) serveCreateFuncServices(ctx context.Context) {
|
|||||||
err: err,
|
err: err,
|
||||||
}
|
}
|
||||||
executor.fsCreateWg.Delete(fnkeyUR)
|
executor.fsCreateWg.Delete(fnkeyUR)
|
||||||
wg.Done()
|
})
|
||||||
}()
|
|
||||||
} else {
|
} else {
|
||||||
// There's an existing request for this function, wait for it to finish
|
// There's an existing request for this function, wait for it to finish
|
||||||
go func() {
|
go func() {
|
||||||
@@ -213,7 +210,7 @@ func (executor *Executor) serveCreateFuncServices(ctx context.Context) {
|
|||||||
// It normally happened if there are multiple requests are
|
// It normally happened if there are multiple requests are
|
||||||
// waiting for the same function and executor failed to cre-
|
// waiting for the same function and executor failed to cre-
|
||||||
// ate service for function.
|
// ate service for function.
|
||||||
err = errors.Wrapf(err, "error getting service for function %s", fnName)
|
err = fmt.Errorf("error getting service for function %s: %w", fnName, err)
|
||||||
req.respChan <- &createFuncServiceResponse{
|
req.respChan <- &createFuncServiceResponse{
|
||||||
funcSvc: fsvc,
|
funcSvc: fsvc,
|
||||||
err: err,
|
err: err,
|
||||||
@@ -233,7 +230,7 @@ func (executor *Executor) createServiceForFunction(ctx context.Context, fn *fv1.
|
|||||||
t := fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType
|
t := fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType
|
||||||
e, ok := executor.executorTypes[t]
|
e, ok := executor.executorTypes[t]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.Errorf("Unknown executor type '%s'", t)
|
return nil, fmt.Errorf("unknown executor type '%s'", t)
|
||||||
}
|
}
|
||||||
|
|
||||||
fsvc, fsvcErr := e.GetFuncSvc(ctx, fn)
|
fsvc, fsvcErr := e.GetFuncSvc(ctx, fn)
|
||||||
@@ -243,7 +240,7 @@ func (executor *Executor) createServiceForFunction(ctx context.Context, fn *fv1.
|
|||||||
zap.Error(fsvcErr),
|
zap.Error(fsvcErr),
|
||||||
zap.String("function_name", fn.ObjectMeta.Name),
|
zap.String("function_name", fn.ObjectMeta.Name),
|
||||||
zap.String("function_namespace", fn.ObjectMeta.Namespace))
|
zap.String("function_namespace", fn.ObjectMeta.Namespace))
|
||||||
fsvcErr = errors.Wrap(fsvcErr, fmt.Sprintf("[%s] %s", fn.ObjectMeta.Name, e))
|
fsvcErr = fmt.Errorf("[%s] %s: %w", fn.ObjectMeta.Name, e, fsvcErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
return fsvc, fsvcErr
|
return fsvc, fsvcErr
|
||||||
@@ -254,7 +251,7 @@ func (executor *Executor) getFunctionServiceFromCache(ctx context.Context, fn *f
|
|||||||
t := fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType
|
t := fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType
|
||||||
e, ok := executor.executorTypes[t]
|
e, ok := executor.executorTypes[t]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.Errorf("Unknown executor type '%s'", t)
|
return nil, fmt.Errorf("unknown executor type '%s'", t)
|
||||||
}
|
}
|
||||||
return e.GetFuncSvcFromCache(ctx, fn)
|
return e.GetFuncSvcFromCache(ctx, fn)
|
||||||
}
|
}
|
||||||
@@ -265,11 +262,11 @@ func StartExecutor(ctx context.Context, clientGen crd.ClientGeneratorInterface,
|
|||||||
|
|
||||||
fissionClient, err := clientGen.GetFissionClient()
|
fissionClient, err := clientGen.GetFissionClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error making the fission client")
|
return fmt.Errorf("error making the fission client: %w", err)
|
||||||
}
|
}
|
||||||
kubernetesClient, err := clientGen.GetKubernetesClient()
|
kubernetesClient, err := clientGen.GetKubernetesClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error making the kube client")
|
return fmt.Errorf("error making the kube client: %w", err)
|
||||||
}
|
}
|
||||||
metricsClient, err := clientGen.GetMetricsClient()
|
metricsClient, err := clientGen.GetMetricsClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -278,12 +275,12 @@ func StartExecutor(ctx context.Context, clientGen crd.ClientGeneratorInterface,
|
|||||||
|
|
||||||
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
err = crd.WaitForFunctionCRDs(ctx, logger, fissionClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error waiting for CRDs")
|
return fmt.Errorf("error waiting for CRDs: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/userfunc")
|
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/userfunc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "Error making fetcher config")
|
return fmt.Errorf("error making fetcher config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
executorInstanceID := strings.ToLower(uniuri.NewLen(8))
|
executorInstanceID := strings.ToLower(uniuri.NewLen(8))
|
||||||
@@ -312,7 +309,7 @@ func StartExecutor(ctx context.Context, clientGen crd.ClientGeneratorInterface,
|
|||||||
finformerFactory,
|
finformerFactory,
|
||||||
gpmInformerFactory, podSpecPatch)
|
gpmInformerFactory, podSpecPatch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "pool manager creation failed")
|
return fmt.Errorf("pool manager creation failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
executorLabel, err = utils.GetInformerLabelByExecutor(fv1.ExecutorTypeNewdeploy)
|
executorLabel, err = utils.GetInformerLabelByExecutor(fv1.ExecutorTypeNewdeploy)
|
||||||
@@ -327,7 +324,7 @@ func StartExecutor(ctx context.Context, clientGen crd.ClientGeneratorInterface,
|
|||||||
finformerFactory,
|
finformerFactory,
|
||||||
ndmInformerFactory, podSpecPatch)
|
ndmInformerFactory, podSpecPatch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "new deploy manager creation failed")
|
return fmt.Errorf("new deploy manager creation failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
executorLabel, err = utils.GetInformerLabelByExecutor(fv1.ExecutorTypeContainer)
|
executorLabel, err = utils.GetInformerLabelByExecutor(fv1.ExecutorTypeContainer)
|
||||||
@@ -341,7 +338,7 @@ func StartExecutor(ctx context.Context, clientGen crd.ClientGeneratorInterface,
|
|||||||
executorInstanceID, finformerFactory,
|
executorInstanceID, finformerFactory,
|
||||||
cnmInformerFactory)
|
cnmInformerFactory)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "container manager creation failed")
|
return fmt.Errorf("container manager creation failed: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
executorTypes := make(map[fv1.ExecutorType]executortype.ExecutorType)
|
executorTypes := make(map[fv1.ExecutorType]executortype.ExecutorType)
|
||||||
@@ -353,14 +350,14 @@ func StartExecutor(ctx context.Context, clientGen crd.ClientGeneratorInterface,
|
|||||||
|
|
||||||
wg := &sync.WaitGroup{}
|
wg := &sync.WaitGroup{}
|
||||||
for _, et := range executorTypes {
|
for _, et := range executorTypes {
|
||||||
wg.Add(1)
|
wg.Go(func() {
|
||||||
go func(et executortype.ExecutorType) {
|
func(et executortype.ExecutorType) {
|
||||||
defer wg.Done()
|
if adoptExistingResources {
|
||||||
if adoptExistingResources {
|
et.AdoptExistingResources(ctx)
|
||||||
et.AdoptExistingResources(ctx)
|
}
|
||||||
}
|
et.CleanupOldExecutorObjects(ctx)
|
||||||
et.CleanupOldExecutorObjects(ctx)
|
}(et)
|
||||||
}(et)
|
})
|
||||||
}
|
}
|
||||||
// set hard timeout for resource adoption
|
// set hard timeout for resource adoption
|
||||||
// TODO: use context to control the waiting time once kubernetes client supports it.
|
// TODO: use context to control the waiting time once kubernetes client supports it.
|
||||||
|
|||||||
@@ -302,17 +302,14 @@ func (caaf *Container) AdoptExistingResources(ctx context.Context) {
|
|||||||
for i := range fnList.Items {
|
for i := range fnList.Items {
|
||||||
fn := &fnList.Items[i]
|
fn := &fnList.Items[i]
|
||||||
if fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType == fv1.ExecutorTypeContainer {
|
if fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType == fv1.ExecutorTypeContainer {
|
||||||
wg.Add(1)
|
wg.Go(func() {
|
||||||
go func() {
|
|
||||||
defer wg.Done()
|
|
||||||
|
|
||||||
_, err = caaf.fnCreate(ctx, fn)
|
_, err = caaf.fnCreate(ctx, fn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
caaf.logger.Warn("failed to adopt resources for function", zap.Error(err))
|
caaf.logger.Warn("failed to adopt resources for function", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
caaf.logger.Info("adopt resources for function", zap.String("function", fn.ObjectMeta.Name))
|
caaf.logger.Info("adopt resources for function", zap.String("function", fn.ObjectMeta.Name))
|
||||||
}()
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -436,27 +433,27 @@ func (caaf *Container) fnCreate(ctx context.Context, fn *fv1.Function) (*fscache
|
|||||||
{
|
{
|
||||||
// obj.TypeMeta.Kind does not work hence this, needs investigation and a fix
|
// obj.TypeMeta.Kind does not work hence this, needs investigation and a fix
|
||||||
Kind: "deployment",
|
Kind: "deployment",
|
||||||
Name: depl.ObjectMeta.Name,
|
Name: depl.Name,
|
||||||
APIVersion: depl.TypeMeta.APIVersion,
|
APIVersion: depl.APIVersion,
|
||||||
Namespace: depl.ObjectMeta.Namespace,
|
Namespace: depl.Namespace,
|
||||||
ResourceVersion: depl.ObjectMeta.ResourceVersion,
|
ResourceVersion: depl.ResourceVersion,
|
||||||
UID: depl.ObjectMeta.UID,
|
UID: depl.UID,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Kind: "service",
|
Kind: "service",
|
||||||
Name: svc.ObjectMeta.Name,
|
Name: svc.Name,
|
||||||
APIVersion: svc.TypeMeta.APIVersion,
|
APIVersion: svc.APIVersion,
|
||||||
Namespace: svc.ObjectMeta.Namespace,
|
Namespace: svc.Namespace,
|
||||||
ResourceVersion: svc.ObjectMeta.ResourceVersion,
|
ResourceVersion: svc.ResourceVersion,
|
||||||
UID: svc.ObjectMeta.UID,
|
UID: svc.UID,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Kind: "horizontalpodautoscaler",
|
Kind: "horizontalpodautoscaler",
|
||||||
Name: hpa.ObjectMeta.Name,
|
Name: hpa.Name,
|
||||||
APIVersion: hpa.TypeMeta.APIVersion,
|
APIVersion: hpa.APIVersion,
|
||||||
Namespace: hpa.ObjectMeta.Namespace,
|
Namespace: hpa.Namespace,
|
||||||
ResourceVersion: hpa.ObjectMeta.ResourceVersion,
|
ResourceVersion: hpa.ResourceVersion,
|
||||||
UID: hpa.ObjectMeta.UID,
|
UID: hpa.UID,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,18 +468,18 @@ func (caaf *Container) fnCreate(ctx context.Context, fn *fv1.Function) (*fscache
|
|||||||
_, err = caaf.fsCache.Add(*fsvc)
|
_, err = caaf.fsCache.Add(*fsvc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
caaf.logger.Error("error adding function to cache", zap.Error(err), zap.Any("function", fsvc.Function))
|
caaf.logger.Error("error adding function to cache", zap.Error(err), zap.Any("function", fsvc.Function))
|
||||||
metrics.ColdStartsError.WithLabelValues(fn.ObjectMeta.Name, fn.ObjectMeta.Namespace).Inc()
|
metrics.ColdStartsError.WithLabelValues(fn.Name, fn.Namespace).Inc()
|
||||||
return fsvc, err
|
return fsvc, err
|
||||||
}
|
}
|
||||||
|
|
||||||
metrics.ColdStarts.WithLabelValues(fn.ObjectMeta.Name, fn.ObjectMeta.Namespace).Inc()
|
metrics.ColdStarts.WithLabelValues(fn.Name, fn.Namespace).Inc()
|
||||||
|
|
||||||
return fsvc, nil
|
return fsvc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (caaf *Container) updateFunction(ctx context.Context, oldFn *fv1.Function, newFn *fv1.Function) error {
|
func (caaf *Container) updateFunction(ctx context.Context, oldFn *fv1.Function, newFn *fv1.Function) error {
|
||||||
|
|
||||||
if oldFn.ObjectMeta.ResourceVersion == newFn.ObjectMeta.ResourceVersion {
|
if oldFn.ResourceVersion == newFn.ResourceVersion {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -322,17 +322,14 @@ func (deploy *NewDeploy) AdoptExistingResources(ctx context.Context) {
|
|||||||
for i := range fnList.Items {
|
for i := range fnList.Items {
|
||||||
fn := &fnList.Items[i]
|
fn := &fnList.Items[i]
|
||||||
if fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType == fv1.ExecutorTypeNewdeploy {
|
if fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType == fv1.ExecutorTypeNewdeploy {
|
||||||
wg.Add(1)
|
wg.Go(func() {
|
||||||
go func() {
|
|
||||||
defer wg.Done()
|
|
||||||
|
|
||||||
_, err = deploy.fnCreate(ctx, fn)
|
_, err = deploy.fnCreate(ctx, fn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
deploy.logger.Warn("failed to adopt resources for function", zap.Error(err))
|
deploy.logger.Warn("failed to adopt resources for function", zap.Error(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
deploy.logger.Info("adopt resources for function", zap.String("function", fn.ObjectMeta.Name))
|
deploy.logger.Info("adopt resources for function", zap.String("function", fn.ObjectMeta.Name))
|
||||||
}()
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -482,7 +479,7 @@ func (deploy *NewDeploy) fnCreate(ctx context.Context, fn *fv1.Function) (*fscac
|
|||||||
// obj.TypeMeta.Kind does not work hence this, needs investigation and a fix
|
// obj.TypeMeta.Kind does not work hence this, needs investigation and a fix
|
||||||
Kind: "deployment",
|
Kind: "deployment",
|
||||||
Name: depl.ObjectMeta.Name,
|
Name: depl.ObjectMeta.Name,
|
||||||
APIVersion: depl.TypeMeta.APIVersion,
|
APIVersion: depl.APIVersion,
|
||||||
Namespace: depl.ObjectMeta.Namespace,
|
Namespace: depl.ObjectMeta.Namespace,
|
||||||
ResourceVersion: depl.ObjectMeta.ResourceVersion,
|
ResourceVersion: depl.ObjectMeta.ResourceVersion,
|
||||||
UID: depl.ObjectMeta.UID,
|
UID: depl.ObjectMeta.UID,
|
||||||
@@ -490,7 +487,7 @@ func (deploy *NewDeploy) fnCreate(ctx context.Context, fn *fv1.Function) (*fscac
|
|||||||
{
|
{
|
||||||
Kind: "service",
|
Kind: "service",
|
||||||
Name: svc.ObjectMeta.Name,
|
Name: svc.ObjectMeta.Name,
|
||||||
APIVersion: svc.TypeMeta.APIVersion,
|
APIVersion: svc.APIVersion,
|
||||||
Namespace: svc.ObjectMeta.Namespace,
|
Namespace: svc.ObjectMeta.Namespace,
|
||||||
ResourceVersion: svc.ObjectMeta.ResourceVersion,
|
ResourceVersion: svc.ObjectMeta.ResourceVersion,
|
||||||
UID: svc.ObjectMeta.UID,
|
UID: svc.ObjectMeta.UID,
|
||||||
@@ -498,7 +495,7 @@ func (deploy *NewDeploy) fnCreate(ctx context.Context, fn *fv1.Function) (*fscac
|
|||||||
{
|
{
|
||||||
Kind: "horizontalpodautoscaler",
|
Kind: "horizontalpodautoscaler",
|
||||||
Name: hpa.ObjectMeta.Name,
|
Name: hpa.ObjectMeta.Name,
|
||||||
APIVersion: hpa.TypeMeta.APIVersion,
|
APIVersion: hpa.APIVersion,
|
||||||
Namespace: hpa.ObjectMeta.Namespace,
|
Namespace: hpa.ObjectMeta.Namespace,
|
||||||
ResourceVersion: hpa.ObjectMeta.ResourceVersion,
|
ResourceVersion: hpa.ObjectMeta.ResourceVersion,
|
||||||
UID: hpa.ObjectMeta.UID,
|
UID: hpa.ObjectMeta.UID,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const (
|
|||||||
func TestRefreshFuncPods(t *testing.T) {
|
func TestRefreshFuncPods(t *testing.T) {
|
||||||
os.Setenv("DEBUG_ENV", "true")
|
os.Setenv("DEBUG_ENV", "true")
|
||||||
mgr := manager.New()
|
mgr := manager.New()
|
||||||
defer mgr.Wait()
|
t.Cleanup(mgr.Wait)
|
||||||
logger := loggerfactory.GetLogger()
|
logger := loggerfactory.GetLogger()
|
||||||
kubernetesClient := fake.NewSimpleClientset()
|
kubernetesClient := fake.NewSimpleClientset()
|
||||||
fissionClient := fClient.NewSimpleClientset()
|
fissionClient := fClient.NewSimpleClientset()
|
||||||
@@ -50,8 +50,7 @@ func TestRefreshFuncPods(t *testing.T) {
|
|||||||
}
|
}
|
||||||
ndmInformerFactory := utils.GetInformerFactoryByExecutor(kubernetesClient, executorLabel, time.Minute*30)
|
ndmInformerFactory := utils.GetInformerFactoryByExecutor(kubernetesClient, executorLabel, time.Minute*30)
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx := t.Context()
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/userfunc")
|
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/userfunc")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package poolmgr
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"net"
|
"net"
|
||||||
@@ -28,7 +29,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dchest/uniuri"
|
"github.com/dchest/uniuri"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
@@ -320,7 +320,7 @@ func (gp *GenericPool) choosePod(ctx context.Context, newLabels map[string]strin
|
|||||||
// ending retry loop when the request canceled
|
// ending retry loop when the request canceled
|
||||||
gp.readyPodQueue.Done(key)
|
gp.readyPodQueue.Done(key)
|
||||||
gp.readyPodQueue.AddAfter(key, expoDelay)
|
gp.readyPodQueue.AddAfter(key, expoDelay)
|
||||||
return "", nil, errors.Errorf("failed to relabel pod: %s", err)
|
return "", nil, fmt.Errorf("failed to relabel pod: %s", err)
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
logger.Error("failed to relabel pod", zap.Error(err), zap.String("pod", chosenPod.Name), zap.Duration("delay", expoDelay))
|
logger.Error("failed to relabel pod", zap.Error(err), zap.String("pod", chosenPod.Name), zap.Duration("delay", expoDelay))
|
||||||
gp.readyPodQueue.Done(key)
|
gp.readyPodQueue.Done(key)
|
||||||
@@ -335,13 +335,13 @@ func (gp *GenericPool) choosePod(ctx context.Context, newLabels map[string]strin
|
|||||||
// So we have to check both of them to ensure the patch success.
|
// So we have to check both of them to ensure the patch success.
|
||||||
for k, v := range newLabels {
|
for k, v := range newLabels {
|
||||||
if newPod.Labels[k] != v {
|
if newPod.Labels[k] != v {
|
||||||
return "", nil, errors.Errorf("value of necessary labels '%s' mismatch: want '%s', get '%v'",
|
return "", nil, fmt.Errorf("value of necessary labels '%s' mismatch: want '%s', get '%v'",
|
||||||
k, v, newPod.Labels[k])
|
k, v, newPod.Labels[k])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for k, v := range annotations {
|
for k, v := range annotations {
|
||||||
if newPod.Annotations[k] != v {
|
if newPod.Annotations[k] != v {
|
||||||
return "", nil, errors.Errorf("value of necessary annotations '%s' mismatch: want '%s', get '%v'",
|
return "", nil, fmt.Errorf("value of necessary annotations '%s' mismatch: want '%s', get '%v'",
|
||||||
k, v, newPod.Annotations[k])
|
k, v, newPod.Annotations[k])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -415,7 +415,7 @@ func (gp *GenericPool) specializePod(ctx context.Context, pod *apiv1.Pod, fn *fv
|
|||||||
// for fetcher we don't need to create a service, just talk to the pod directly
|
// for fetcher we don't need to create a service, just talk to the pod directly
|
||||||
podIP := pod.Status.PodIP
|
podIP := pod.Status.PodIP
|
||||||
if len(podIP) == 0 {
|
if len(podIP) == 0 {
|
||||||
return errors.Errorf("Pod %s in namespace %s has no IP", pod.ObjectMeta.Name, pod.ObjectMeta.Namespace)
|
return fmt.Errorf("pod %s in namespace %s has no IP", pod.ObjectMeta.Name, pod.ObjectMeta.Namespace)
|
||||||
}
|
}
|
||||||
for _, cm := range fn.Spec.ConfigMaps {
|
for _, cm := range fn.Spec.ConfigMaps {
|
||||||
_, err := gp.kubernetesClient.CoreV1().ConfigMaps(gp.fnNamespace).Get(ctx, cm.Name, metav1.GetOptions{})
|
_, err := gp.kubernetesClient.CoreV1().ConfigMaps(gp.fnNamespace).Get(ctx, cm.Name, metav1.GetOptions{})
|
||||||
@@ -571,7 +571,7 @@ func (gp *GenericPool) getFuncSvc(ctx context.Context, fn *fv1.Function) (*fscac
|
|||||||
}
|
}
|
||||||
if svc.ObjectMeta.Name != svcName {
|
if svc.ObjectMeta.Name != svcName {
|
||||||
go gp.scheduleDeletePod(context.Background(), pod.ObjectMeta.Name)
|
go gp.scheduleDeletePod(context.Background(), pod.ObjectMeta.Name)
|
||||||
return nil, errors.Errorf("sanity check failed for svc %s", svc.ObjectMeta.Name)
|
return nil, fmt.Errorf("sanity check failed for svc %s", svc.ObjectMeta.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// the fission router isn't in the same namespace, so return a
|
// the fission router isn't in the same namespace, so return a
|
||||||
@@ -601,7 +601,7 @@ func (gp *GenericPool) getFuncSvc(ctx context.Context, fn *fv1.Function) (*fscac
|
|||||||
{
|
{
|
||||||
Kind: "pod",
|
Kind: "pod",
|
||||||
Name: pod.ObjectMeta.Name,
|
Name: pod.ObjectMeta.Name,
|
||||||
APIVersion: pod.TypeMeta.APIVersion,
|
APIVersion: pod.APIVersion,
|
||||||
Namespace: pod.ObjectMeta.Namespace,
|
Namespace: pod.ObjectMeta.Namespace,
|
||||||
ResourceVersion: pod.ObjectMeta.ResourceVersion,
|
ResourceVersion: pod.ObjectMeta.ResourceVersion,
|
||||||
UID: pod.ObjectMeta.UID,
|
UID: pod.ObjectMeta.UID,
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/executor/metrics"
|
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
@@ -47,6 +46,7 @@ import (
|
|||||||
"github.com/fission/fission/pkg/crd"
|
"github.com/fission/fission/pkg/crd"
|
||||||
"github.com/fission/fission/pkg/executor/executortype"
|
"github.com/fission/fission/pkg/executor/executortype"
|
||||||
"github.com/fission/fission/pkg/executor/fscache"
|
"github.com/fission/fission/pkg/executor/fscache"
|
||||||
|
"github.com/fission/fission/pkg/executor/metrics"
|
||||||
"github.com/fission/fission/pkg/executor/reaper"
|
"github.com/fission/fission/pkg/executor/reaper"
|
||||||
executorUtils "github.com/fission/fission/pkg/executor/util"
|
executorUtils "github.com/fission/fission/pkg/executor/util"
|
||||||
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
|
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
|
||||||
@@ -368,9 +368,7 @@ func (gpm *GenericPoolManager) AdoptExistingResources(ctx context.Context) {
|
|||||||
env := envs.Items[i]
|
env := envs.Items[i]
|
||||||
|
|
||||||
if getEnvPoolSize(&env) > 0 {
|
if getEnvPoolSize(&env) > 0 {
|
||||||
wg.Add(1)
|
wg.Go(func() {
|
||||||
go func() {
|
|
||||||
defer wg.Done()
|
|
||||||
_, created, err := gpm.getPool(ctx, &env)
|
_, created, err := gpm.getPool(ctx, &env)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
gpm.logger.Error("adopt pool failed", zap.Error(err))
|
gpm.logger.Error("adopt pool failed", zap.Error(err))
|
||||||
@@ -378,11 +376,11 @@ func (gpm *GenericPoolManager) AdoptExistingResources(ctx context.Context) {
|
|||||||
if created {
|
if created {
|
||||||
gpm.logger.Info("created pool for the environment", zap.String("env", env.ObjectMeta.Name), zap.String("namespace", gpm.nsResolver.ResolveNamespace(gpm.nsResolver.FunctionNamespace)))
|
gpm.logger.Info("created pool for the environment", zap.String("env", env.ObjectMeta.Name), zap.String("namespace", gpm.nsResolver.ResolveNamespace(gpm.nsResolver.FunctionNamespace)))
|
||||||
}
|
}
|
||||||
}()
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// create environment map for later use
|
// create environment map for later use
|
||||||
key := fmt.Sprintf("%s/%s", env.ObjectMeta.Namespace, env.ObjectMeta.Name)
|
key := k8sCache.MetaObjectToName(&env.ObjectMeta).String()
|
||||||
envMap[key] = env
|
envMap[key] = env
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,10 +405,7 @@ func (gpm *GenericPoolManager) AdoptExistingResources(ctx context.Context) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Go(func() {
|
||||||
go func() {
|
|
||||||
defer wg.Done()
|
|
||||||
|
|
||||||
// avoid too many requests arrive Kubernetes API server at the same time.
|
// avoid too many requests arrive Kubernetes API server at the same time.
|
||||||
time.Sleep(time.Duration(rand.Intn(30)) * time.Millisecond)
|
time.Sleep(time.Duration(rand.Intn(30)) * time.Millisecond)
|
||||||
|
|
||||||
@@ -458,7 +453,7 @@ func (gpm *GenericPoolManager) AdoptExistingResources(ctx context.Context) {
|
|||||||
{
|
{
|
||||||
Kind: "pod",
|
Kind: "pod",
|
||||||
Name: pod.Name,
|
Name: pod.Name,
|
||||||
APIVersion: pod.TypeMeta.APIVersion,
|
APIVersion: pod.APIVersion,
|
||||||
Namespace: pod.ObjectMeta.Namespace,
|
Namespace: pod.ObjectMeta.Namespace,
|
||||||
ResourceVersion: pod.ObjectMeta.ResourceVersion,
|
ResourceVersion: pod.ObjectMeta.ResourceVersion,
|
||||||
UID: pod.ObjectMeta.UID,
|
UID: pod.ObjectMeta.UID,
|
||||||
@@ -482,7 +477,7 @@ func (gpm *GenericPoolManager) AdoptExistingResources(ctx context.Context) {
|
|||||||
|
|
||||||
gpm.logger.Info("adopt function pod",
|
gpm.logger.Info("adopt function pod",
|
||||||
zap.String("pod", pod.Name), zap.Any("labels", pod.Labels), zap.Any("annotations", pod.Annotations))
|
zap.String("pod", pod.Name), zap.Any("labels", pod.Labels), zap.Any("annotations", pod.Annotations))
|
||||||
}()
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ limitations under the License.
|
|||||||
package poolmgr
|
package poolmgr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@@ -39,9 +38,8 @@ import (
|
|||||||
|
|
||||||
func TestPoolPodControllerPodCleanup(t *testing.T) {
|
func TestPoolPodControllerPodCleanup(t *testing.T) {
|
||||||
mgr := manager.New()
|
mgr := manager.New()
|
||||||
defer mgr.Wait()
|
t.Cleanup(mgr.Wait)
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx := t.Context()
|
||||||
defer cancel()
|
|
||||||
logger := loggerfactory.GetLogger()
|
logger := loggerfactory.GetLogger()
|
||||||
kubernetesClient := fake.NewSimpleClientset()
|
kubernetesClient := fake.NewSimpleClientset()
|
||||||
fissionClient := fClient.NewSimpleClientset()
|
fissionClient := fClient.NewSimpleClientset()
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
@@ -292,7 +291,7 @@ func (fsc *FunctionServiceCache) Add(fsvc FuncSvc) (*FuncSvc, error) {
|
|||||||
if IsNameExistError(err) {
|
if IsNameExistError(err) {
|
||||||
err = nil
|
err = nil
|
||||||
} else {
|
} else {
|
||||||
err = errors.Wrap(err, "error caching fsvc")
|
err = fmt.Errorf("error caching fsvc: %w", err)
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -304,7 +303,7 @@ func (fsc *FunctionServiceCache) Add(fsvc FuncSvc) (*FuncSvc, error) {
|
|||||||
if IsNameExistError(err) {
|
if IsNameExistError(err) {
|
||||||
err = nil
|
err = nil
|
||||||
} else {
|
} else {
|
||||||
err = errors.Wrap(err, "error caching fsvc by function uid")
|
err = fmt.Errorf("error caching fsvc by function uid: %w", err)
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -383,10 +382,6 @@ func (fsc *FunctionServiceCache) DeleteFunctionSvc(ctx context.Context, fsvc *Fu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fsc *FunctionServiceCache) SetCPUUtilization(key crd.CacheKeyURG, svcHost string, cpuUsage resource.Quantity) {
|
|
||||||
fsc.connFunctionCache.SetCPUUtilization(key, svcHost, cpuUsage)
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeleteOld deletes aged function service entries from cache.
|
// DeleteOld deletes aged function service entries from cache.
|
||||||
func (fsc *FunctionServiceCache) DeleteOld(fsvc *FuncSvc, minAge time.Duration) (bool, error) {
|
func (fsc *FunctionServiceCache) DeleteOld(fsvc *FuncSvc, minAge time.Duration) (bool, error) {
|
||||||
if time.Since(fsvc.Atime) < minAge {
|
if time.Since(fsvc.Atime) < minAge {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package fscache
|
package fscache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"log"
|
"log"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@@ -157,8 +156,7 @@ func TestFunctionServiceNewCache(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx := t.Context()
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
fsc.AddFunc(ctx, *fsvc, 10, fn.GetRetainPods())
|
fsc.AddFunc(ctx, *fsvc, 10, fn.GetRetainPods())
|
||||||
concurrency := 10
|
concurrency := 10
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ func (c *PoolCache) service() {
|
|||||||
datawriter := bufio.NewWriter(req.dumpWriter)
|
datawriter := bufio.NewWriter(req.dumpWriter)
|
||||||
|
|
||||||
writefnSvcGrp := func(svcGrp *funcSvcGroup) error {
|
writefnSvcGrp := func(svcGrp *funcSvcGroup) error {
|
||||||
_, err := datawriter.WriteString(fmt.Sprintf("svc_waiting:%d\tqueue_len:%d", svcGrp.svcWaiting, svcGrp.queue.Len()))
|
_, err := fmt.Fprintf(datawriter, "svc_waiting:%d\tqueue_len:%d", svcGrp.svcWaiting, svcGrp.queue.Len())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -319,8 +319,8 @@ func (c *PoolCache) service() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for addr, fnSvc := range svcGrp.svcs {
|
for addr, fnSvc := range svcGrp.svcs {
|
||||||
_, err := datawriter.WriteString(fmt.Sprintf("\tfunction_name:%s\tfn_svc_address:%s\tactive_req:%d\tcurrent_cpu_usage:%v\tcpu_limit:%v\n",
|
_, err := fmt.Fprintf(datawriter, "\tfunction_name:%s\tfn_svc_address:%s\tactive_req:%d\tcurrent_cpu_usage:%v\tcpu_limit:%v\n",
|
||||||
fnSvc.val.Function.Name, addr, fnSvc.activeRequests, fnSvc.currentCPUUsage, fnSvc.cpuLimit))
|
fnSvc.val.Function.Name, addr, fnSvc.activeRequests, fnSvc.currentCPUUsage, fnSvc.cpuLimit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ func checkErr(err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPoolCache(t *testing.T) {
|
func TestPoolCache(t *testing.T) {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx := t.Context()
|
||||||
defer cancel()
|
|
||||||
logger := loggerfactory.GetLogger()
|
logger := loggerfactory.GetLogger()
|
||||||
concurrency := 5
|
concurrency := 5
|
||||||
requestsPerPod := 2
|
requestsPerPod := 2
|
||||||
@@ -225,32 +224,33 @@ func TestPoolCacheRequests(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for i := 1; i <= tt.requests; i++ {
|
for i := 1; i <= tt.requests; i++ {
|
||||||
reqno := i
|
reqno := i
|
||||||
wg.Add(1)
|
wg.Go(func() {
|
||||||
go func(reqno int) {
|
func(reqno int) {
|
||||||
defer wg.Done()
|
svc, err := p.GetSvcValue(context.Background(), key, tt.rpp, tt.concurrency)
|
||||||
svc, err := p.GetSvcValue(context.Background(), key, tt.rpp, tt.concurrency)
|
if err != nil {
|
||||||
if err != nil {
|
code, _ := ferror.GetHTTPError(err)
|
||||||
code, _ := ferror.GetHTTPError(err)
|
if code == http.StatusNotFound {
|
||||||
if code == http.StatusNotFound {
|
atomic.AddUint64(&svcCounter, 1)
|
||||||
atomic.AddUint64(&svcCounter, 1)
|
address := fmt.Sprintf("svc-%d", atomic.LoadUint64(&svcCounter))
|
||||||
address := fmt.Sprintf("svc-%d", atomic.LoadUint64(&svcCounter))
|
p.SetSvcValue(context.Background(), key, address, &FuncSvc{
|
||||||
p.SetSvcValue(context.Background(), key, address, &FuncSvc{
|
Name: address,
|
||||||
Name: address,
|
}, resource.MustParse("45m"), tt.rpp, tt.retainPods)
|
||||||
}, resource.MustParse("45m"), tt.rpp, tt.retainPods)
|
} else {
|
||||||
|
t.Log(reqno, "=>", err)
|
||||||
|
atomic.AddUint64(&failedRequests, 1)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
t.Log(reqno, "=>", err)
|
if svc == nil {
|
||||||
atomic.AddUint64(&failedRequests, 1)
|
t.Log(reqno, "=>", "svc is nil")
|
||||||
|
atomic.AddUint64(&failedRequests, 1)
|
||||||
|
}
|
||||||
|
// } else {
|
||||||
|
// t.Log(reqno, "=>", svc.Name)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
}(reqno)
|
||||||
if svc == nil {
|
})
|
||||||
t.Log(reqno, "=>", "svc is nil")
|
|
||||||
atomic.AddUint64(&failedRequests, 1)
|
|
||||||
}
|
|
||||||
// } else {
|
|
||||||
// t.Log(reqno, "=>", svc.Name)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}(reqno)
|
|
||||||
if reqno%simultaneous == 0 {
|
if reqno%simultaneous == 0 {
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
@@ -262,12 +262,12 @@ func TestPoolCacheRequests(t *testing.T) {
|
|||||||
|
|
||||||
for i := 0; i < tt.concurrency; i++ {
|
for i := 0; i < tt.concurrency; i++ {
|
||||||
for j := 0; j < tt.rpp; j++ {
|
for j := 0; j < tt.rpp; j++ {
|
||||||
wg.Add(1)
|
|
||||||
svcno := i
|
svcno := i
|
||||||
go func(svcno int) {
|
wg.Go(func() {
|
||||||
defer wg.Done()
|
func(svcno int) {
|
||||||
p.MarkAvailable(key, fmt.Sprintf("svc-%d", svcno+1))
|
p.MarkAvailable(key, fmt.Sprintf("svc-%d", svcno+1))
|
||||||
}(svcno)
|
}(svcno)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|||||||
@@ -48,16 +48,14 @@ func TestQueuePushWithConcurrentRequest(t *testing.T) {
|
|||||||
q := NewQueue()
|
q := NewQueue()
|
||||||
noOfRequests := 20
|
noOfRequests := 20
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
wg.Add(noOfRequests)
|
|
||||||
for i := 0; i < noOfRequests; i++ {
|
for i := 0; i < noOfRequests; i++ {
|
||||||
go func() {
|
wg.Go(func() {
|
||||||
defer wg.Done()
|
|
||||||
item := &svcWait{
|
item := &svcWait{
|
||||||
svcChannel: make(chan *FuncSvc),
|
svcChannel: make(chan *FuncSvc),
|
||||||
ctx: nil,
|
ctx: nil,
|
||||||
}
|
}
|
||||||
q.Push(item)
|
q.Push(item)
|
||||||
}()
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ limitations under the License.
|
|||||||
package metrics
|
package metrics
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/fission/fission/pkg/utils/metrics"
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
|
||||||
|
"github.com/fission/fission/pkg/utils/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ limitations under the License.
|
|||||||
package hpa
|
package hpa
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@@ -58,8 +57,7 @@ func TestHpaOps(t *testing.T) {
|
|||||||
t.Errorf("Expected instanceID to be %v, got %v", instanceID, hpaops.instanceID)
|
t.Errorf("Expected instanceID to be %v, got %v", instanceID, hpaops.instanceID)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx := t.Context()
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
deployLabels := map[string]string{
|
deployLabels := map[string]string{
|
||||||
"test-label": "test-label-value",
|
"test-label": "test-label-value",
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
apiv1 "k8s.io/api/core/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
"github.com/fission/fission/pkg/utils/loggerfactory"
|
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetSpecFromConfigMap(t *testing.T) {
|
func TestGetSpecFromConfigMap(t *testing.T) {
|
||||||
@@ -55,7 +55,7 @@ securityContext:
|
|||||||
}
|
}
|
||||||
|
|
||||||
var permissionNum int64 = 10001
|
var permissionNum int64 = 10001
|
||||||
var runAsNonRoot bool = true
|
var runAsNonRoot = true
|
||||||
|
|
||||||
testSpecPatch := apiv1.PodSpec{
|
testSpecPatch := apiv1.PodSpec{
|
||||||
SecurityContext: &apiv1.PodSecurityContext{
|
SecurityContext: &apiv1.PodSecurityContext{
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
@@ -104,7 +104,7 @@ func sendRequest(logger *zap.Logger, ctx context.Context, httpClient *http.Clien
|
|||||||
// skip retry and return directly due to context deadline exceeded
|
// skip retry and return directly due to context deadline exceeded
|
||||||
if err == context.DeadlineExceeded {
|
if err == context.DeadlineExceeded {
|
||||||
msg := "error specializing function pod, either increase the specialization timeout for function or check function pod log would help."
|
msg := "error specializing function pod, either increase the specialization timeout for function or check function pod log would help."
|
||||||
err = errors.Wrap(err, msg)
|
err = fmt.Errorf("%s: %w", msg, err)
|
||||||
logger.Error(msg, zap.Error(err), zap.String("url", url))
|
logger.Error(msg, zap.Error(err), zap.String("url", url))
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/pkg/errors"
|
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -305,7 +304,7 @@ func (cfg *Config) addFetcherToPodSpecWithCommand(podSpec *apiv1.PodSpec, mainCo
|
|||||||
for _, existingContainer := range podSpec.Containers {
|
for _, existingContainer := range podSpec.Containers {
|
||||||
existingContainerNames = append(existingContainerNames, existingContainer.Name)
|
existingContainerNames = append(existingContainerNames, existingContainer.Name)
|
||||||
}
|
}
|
||||||
return errors.Errorf("could not find main container '%s' in given PodSpec. Found: %v",
|
return fmt.Errorf("could not find main container '%s' in given PodSpec. Found: %v",
|
||||||
mainContainerName,
|
mainContainerName,
|
||||||
existingContainerNames)
|
existingContainerNames)
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-29
@@ -20,6 +20,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -29,7 +30,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/pkg/errors"
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
@@ -92,21 +92,21 @@ func MakeFetcher(logger *zap.Logger, clientGen crd.ClientGeneratorInterface, sha
|
|||||||
|
|
||||||
fissionClient, err := clientGen.GetFissionClient()
|
fissionClient, err := clientGen.GetFissionClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error making the fission client")
|
return nil, fmt.Errorf("error making the fission client: %w", err)
|
||||||
}
|
}
|
||||||
kubeClient, err := clientGen.GetKubernetesClient()
|
kubeClient, err := clientGen.GetKubernetesClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error making the kube client")
|
return nil, fmt.Errorf("error making the kube client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
name, err := os.ReadFile(podInfoMountDir + "/name")
|
name, err := os.ReadFile(podInfoMountDir + "/name")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error reading pod name from downward volume")
|
return nil, fmt.Errorf("error reading pod name from downward volume: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace, err := os.ReadFile(podInfoMountDir + "/namespace")
|
namespace, err := os.ReadFile(podInfoMountDir + "/namespace")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error reading pod namespace from downward volume")
|
return nil, fmt.Errorf("error reading pod namespace from downward volume: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
||||||
@@ -140,7 +140,7 @@ func writeSecretOrConfigMap(dataMap map[string][]byte, dirPath string) error {
|
|||||||
writeFilePath := filepath.Join(dirPath, key)
|
writeFilePath := filepath.Join(dirPath, key)
|
||||||
err := os.WriteFile(writeFilePath, val, 0750)
|
err := os.WriteFile(writeFilePath, val, 0750)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "Failed to write file %s", writeFilePath)
|
return fmt.Errorf("failed to write file %s: %w", writeFilePath, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -255,7 +255,7 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
|||||||
storePath, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedVolumePath, req.Filename), fetcher.sharedVolumePath)
|
storePath, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedVolumePath, req.Filename), fetcher.sharedVolumePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err.Error(), zap.String("filename", req.Filename))
|
logger.Error(err.Error(), zap.String("filename", req.Filename))
|
||||||
return http.StatusBadRequest, errors.New(fmt.Sprintf("%s, request: %v", err, req))
|
return http.StatusBadRequest, fmt.Errorf("%s, request: %v", err, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify first if the file already exists.
|
// verify first if the file already exists.
|
||||||
@@ -270,7 +270,7 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
|||||||
tmpPath, err := utils.SanitizeFilePath(storePath+".tmp", fetcher.sharedVolumePath)
|
tmpPath, err := utils.SanitizeFilePath(storePath+".tmp", fetcher.sharedVolumePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err.Error(), zap.String("filename", req.Filename))
|
logger.Error(err.Error(), zap.String("filename", req.Filename))
|
||||||
return http.StatusBadRequest, errors.New(fmt.Sprintf("%s, request: %v", err, req))
|
return http.StatusBadRequest, fmt.Errorf("%s, request: %v", err, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.FetchType == fv1.FETCH_URL {
|
if req.FetchType == fv1.FETCH_URL {
|
||||||
@@ -284,7 +284,7 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
e := "failed to download url"
|
e := "failed to download url"
|
||||||
logger.Error(e, zap.Error(err), zap.String("url", req.Url))
|
logger.Error(e, zap.Error(err), zap.String("url", req.Url))
|
||||||
return http.StatusBadRequest, errors.Wrapf(err, "%s: %s", e, req.Url)
|
return http.StatusBadRequest, fmt.Errorf("%s: %s: %w", e, req.Url, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var archive *fv1.Archive
|
var archive *fv1.Archive
|
||||||
@@ -298,10 +298,10 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
|||||||
if pkg.Status.BuildStatus != fv1.BuildStatusSucceeded && pkg.Status.BuildStatus != fv1.BuildStatusNone {
|
if pkg.Status.BuildStatus != fv1.BuildStatusSucceeded && pkg.Status.BuildStatus != fv1.BuildStatusNone {
|
||||||
e := fmt.Sprintf("cannot fetch deployment: package build status was not %q", fv1.BuildStatusSucceeded)
|
e := fmt.Sprintf("cannot fetch deployment: package build status was not %q", fv1.BuildStatusSucceeded)
|
||||||
logger.Error(e,
|
logger.Error(e,
|
||||||
zap.String("package_name", pkg.ObjectMeta.Name),
|
zap.String("package_name", pkg.Name),
|
||||||
zap.String("package_namespace", pkg.ObjectMeta.Namespace),
|
zap.String("package_namespace", pkg.Namespace),
|
||||||
zap.Any("package_build_status", pkg.Status.BuildStatus))
|
zap.Any("package_build_status", pkg.Status.BuildStatus))
|
||||||
return http.StatusInternalServerError, errors.New(fmt.Sprintf("%s: pkg %s.%s has a status of %s", e, pkg.ObjectMeta.Name, pkg.ObjectMeta.Namespace, pkg.Status.BuildStatus))
|
return http.StatusInternalServerError, fmt.Errorf("%s: pkg %s.%s has a status of %s", e, pkg.Name, pkg.Namespace, pkg.Status.BuildStatus)
|
||||||
}
|
}
|
||||||
archive = &pkg.Spec.Deployment
|
archive = &pkg.Spec.Deployment
|
||||||
} else {
|
} else {
|
||||||
@@ -315,7 +315,7 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
e := "failed to write file"
|
e := "failed to write file"
|
||||||
logger.Error(e, zap.Error(err), zap.String("location", tmpPath))
|
logger.Error(e, zap.Error(err), zap.String("location", tmpPath))
|
||||||
return http.StatusInternalServerError, errors.Wrapf(err, "%s %s", e, tmpPath)
|
return http.StatusInternalServerError, fmt.Errorf("%s %s: %w", e, tmpPath, err)
|
||||||
}
|
}
|
||||||
otelUtils.SpanTrackEvent(ctx, "archiveLiteral", otelUtils.GetAttributesForPackage(pkg)...)
|
otelUtils.SpanTrackEvent(ctx, "archiveLiteral", otelUtils.GetAttributesForPackage(pkg)...)
|
||||||
} else {
|
} else {
|
||||||
@@ -329,7 +329,7 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
e := "failed to download url"
|
e := "failed to download url"
|
||||||
logger.Error(e, zap.Error(err), zap.String("url", req.Url))
|
logger.Error(e, zap.Error(err), zap.String("url", req.Url))
|
||||||
return http.StatusBadRequest, errors.Wrapf(err, "%s %s", e, req.Url)
|
return http.StatusBadRequest, fmt.Errorf("%s %s: %w", e, req.Url, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check file integrity only if checksum is not empty.
|
// check file integrity only if checksum is not empty.
|
||||||
@@ -338,13 +338,13 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
e := "failed to get checksum"
|
e := "failed to get checksum"
|
||||||
logger.Error(e, zap.Error(err))
|
logger.Error(e, zap.Error(err))
|
||||||
return http.StatusBadRequest, errors.Wrap(err, e)
|
return http.StatusBadRequest, fmt.Errorf("%s: %w", e, err)
|
||||||
}
|
}
|
||||||
err = verifyChecksum(checksum, &archive.Checksum)
|
err = verifyChecksum(checksum, &archive.Checksum)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e := "failed to verify checksum"
|
e := "failed to verify checksum"
|
||||||
logger.Error(e, zap.Error(err))
|
logger.Error(e, zap.Error(err))
|
||||||
return http.StatusBadRequest, errors.Wrap(err, e)
|
return http.StatusBadRequest, fmt.Errorf("%s: %w", e, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -373,7 +373,7 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
|
|||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.String("original_path", tmpPath),
|
zap.String("original_path", tmpPath),
|
||||||
zap.String("rename_path", storePath))
|
zap.String("rename_path", storePath))
|
||||||
return http.StatusInternalServerError, err
|
return http.StatusInternalServerError, fmt.Errorf("error renaming file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
otelUtils.SpanTrackEvent(ctx, "packageFetched", otelUtils.GetAttributesForPackage(pkg)...)
|
otelUtils.SpanTrackEvent(ctx, "packageFetched", otelUtils.GetAttributesForPackage(pkg)...)
|
||||||
@@ -409,7 +409,7 @@ func (fetcher *Fetcher) FetchSecretsAndCfgMaps(ctx context.Context, secrets []fv
|
|||||||
secretDir, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedSecretPath, secret.Namespace, secret.Name), fetcher.sharedSecretPath)
|
secretDir, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedSecretPath, secret.Namespace, secret.Name), fetcher.sharedSecretPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err.Error(), zap.String("directory", secretDir), zap.String("secret_name", secret.Name), zap.String("secret_namespace", secret.Namespace))
|
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))
|
return http.StatusBadRequest, fmt.Errorf("%s, request: %v", err, secret)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = os.MkdirAll(secretDir, os.ModeDir|0750)
|
err = os.MkdirAll(secretDir, os.ModeDir|0750)
|
||||||
@@ -420,7 +420,7 @@ func (fetcher *Fetcher) FetchSecretsAndCfgMaps(ctx context.Context, secrets []fv
|
|||||||
zap.String("directory", secretDir),
|
zap.String("directory", secretDir),
|
||||||
zap.String("secret_name", secret.Name),
|
zap.String("secret_name", secret.Name),
|
||||||
zap.String("secret_namespace", secret.Namespace))
|
zap.String("secret_namespace", secret.Namespace))
|
||||||
return http.StatusInternalServerError, errors.Wrapf(err, "%s: %s", e, secretDir)
|
return http.StatusInternalServerError, fmt.Errorf("%s: %s: %w", e, secretDir, err)
|
||||||
}
|
}
|
||||||
err = writeSecretOrConfigMap(data.Data, secretDir)
|
err = writeSecretOrConfigMap(data.Data, secretDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -461,8 +461,8 @@ func (fetcher *Fetcher) FetchSecretsAndCfgMaps(ctx context.Context, secrets []fv
|
|||||||
configDir, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedConfigPath, config.Namespace, config.Name), fetcher.sharedConfigPath)
|
configDir, err := utils.SanitizeFilePath(filepath.Join(fetcher.sharedConfigPath, config.Namespace, config.Name), fetcher.sharedConfigPath)
|
||||||
if err != nil {
|
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))
|
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,
|
return http.StatusBadRequest, fmt.Errorf("%s, request: %v", err,
|
||||||
config))
|
config)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = os.MkdirAll(configDir, os.ModeDir|0750)
|
err = os.MkdirAll(configDir, os.ModeDir|0750)
|
||||||
@@ -473,7 +473,7 @@ func (fetcher *Fetcher) FetchSecretsAndCfgMaps(ctx context.Context, secrets []fv
|
|||||||
zap.String("directory", configDir),
|
zap.String("directory", configDir),
|
||||||
zap.String("config_map_name", config.Name),
|
zap.String("config_map_name", config.Name),
|
||||||
zap.String("config_map_namespace", config.Namespace))
|
zap.String("config_map_namespace", config.Namespace))
|
||||||
return http.StatusInternalServerError, errors.Wrapf(err, "%s: %s", e, configDir)
|
return http.StatusInternalServerError, fmt.Errorf("%s: %s: %w", e, configDir, err)
|
||||||
}
|
}
|
||||||
configMap := make(map[string][]byte)
|
configMap := make(map[string][]byte)
|
||||||
for key, val := range data.Data {
|
for key, val := range data.Data {
|
||||||
@@ -617,7 +617,7 @@ func (fetcher *Fetcher) UploadHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
func (fetcher *Fetcher) rename(src string, dst string) error {
|
func (fetcher *Fetcher) rename(src string, dst string) error {
|
||||||
err := os.Rename(src, dst)
|
err := os.Rename(src, dst)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to move file")
|
return fmt.Errorf("failed to move file: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -673,17 +673,17 @@ func (fetcher *Fetcher) SpecializePod(ctx context.Context, fetchReq FunctionFetc
|
|||||||
|
|
||||||
pkg, err := fetcher.getPkgInformation(ctx, fetchReq)
|
pkg, err := fetcher.getPkgInformation(ctx, fetchReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting package information")
|
return fmt.Errorf("error getting package information: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = fetcher.Fetch(ctx, pkg, fetchReq)
|
_, err = fetcher.Fetch(ctx, pkg, fetchReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error fetching deploy package")
|
return fmt.Errorf("error fetching deploy package: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = fetcher.FetchSecretsAndCfgMaps(ctx, fetchReq.Secrets, fetchReq.ConfigMaps)
|
_, err = fetcher.FetchSecretsAndCfgMaps(ctx, fetchReq.Secrets, fetchReq.ConfigMaps)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error fetching secrets/configs")
|
return fmt.Errorf("error fetching secrets/configs: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specialize the pod
|
// Specialize the pod
|
||||||
@@ -695,7 +695,7 @@ func (fetcher *Fetcher) SpecializePod(ctx context.Context, fetchReq FunctionFetc
|
|||||||
|
|
||||||
loadPayload, err := json.Marshal(loadReq)
|
loadPayload, err := json.Marshal(loadReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error encoding load request")
|
return fmt.Errorf("error encoding load request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instead of using "localhost", here we use "127.0.0.1" for
|
// Instead of using "localhost", here we use "127.0.0.1" for
|
||||||
@@ -739,10 +739,10 @@ func (fetcher *Fetcher) SpecializePod(ctx context.Context, fetchReq FunctionFetc
|
|||||||
err = ferror.MakeErrorFromHTTP(resp)
|
err = ferror.MakeErrorFromHTTP(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.Wrap(err, "error specializing function pod")
|
return fmt.Errorf("error specializing function pod: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.Wrapf(err, "error specializing function pod after %v times", maxRetries)
|
return fmt.Errorf("error specializing function pod after %v times: %w", maxRetries, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// WsStartHandler is used to generate websocket events in Kubernetes
|
// WsStartHandler is used to generate websocket events in Kubernetes
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ limitations under the License.
|
|||||||
package canaryconfig
|
package canaryconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -57,7 +57,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, fnNs, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, fnNs, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in creating canaryconfig")
|
return fmt.Errorf("error in creating canaryconfig: %w", err)
|
||||||
}
|
}
|
||||||
incrementStep := input.Int(flagkey.CanaryWeightIncrement)
|
incrementStep := input.Int(flagkey.CanaryWeightIncrement)
|
||||||
failureThreshold := input.Int(flagkey.CanaryFailureThreshold)
|
failureThreshold := input.Int(flagkey.CanaryFailureThreshold)
|
||||||
@@ -66,13 +66,13 @@ func (opts *CreateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
// check for time parsing
|
// check for time parsing
|
||||||
_, err = time.ParseDuration(incrementInterval)
|
_, err = time.ParseDuration(incrementInterval)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error parsing time duration")
|
return fmt.Errorf("error parsing time duration: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that the trigger exists in the same namespace.
|
// check that the trigger exists in the same namespace.
|
||||||
htTrigger, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(fnNs).Get(input.Context(), ht, metav1.GetOptions{})
|
htTrigger, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(fnNs).Get(input.Context(), ht, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error finding http trigger referenced in the canary config")
|
return fmt.Errorf("error finding http trigger referenced in the canary config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that the trigger has function reference type function weights
|
// check that the trigger has function reference type function weights
|
||||||
@@ -95,7 +95,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
fnList := []string{newFunc, oldFunc}
|
fnList := []string{newFunc, oldFunc}
|
||||||
err = util.CheckFunctionExistence(input.Context(), opts.Client(), fnList, fnNs)
|
err = util.CheckFunctionExistence(input.Context(), opts.Client(), fnList, fnNs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error checking functions existence")
|
return fmt.Errorf("error checking functions existence: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally create canaryCfg in the same namespace as the functions referenced
|
// finally create canaryCfg in the same namespace as the functions referenced
|
||||||
@@ -124,7 +124,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
func (opts *CreateSubCommand) run(input cli.Input) error {
|
func (opts *CreateSubCommand) run(input cli.Input) error {
|
||||||
_, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(opts.canary.ObjectMeta.Namespace).Create(input.Context(), opts.canary, metav1.CreateOptions{})
|
_, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(opts.canary.ObjectMeta.Namespace).Create(input.Context(), opts.canary, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating canary config")
|
return fmt.Errorf("error creating canary config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("canary config '%s' created\n", opts.canary.ObjectMeta.Name)
|
fmt.Printf("canary config '%s' created\n", opts.canary.ObjectMeta.Name)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package canaryconfig
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -39,7 +38,7 @@ func Delete(input cli.Input) error {
|
|||||||
func (opts *DeleteSubCommand) run(input cli.Input) (err error) {
|
func (opts *DeleteSubCommand) run(input cli.Input) (err error) {
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceCanary)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceCanary)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in deleting canaryConfig ")
|
return fmt.Errorf("error in deleting canaryConfig: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = opts.Client().FissionClientSet.CoreV1().CanaryConfigs(namespace).Delete(input.Context(), input.String(flagkey.CanaryName), metav1.DeleteOptions{})
|
err = opts.Client().FissionClientSet.CoreV1().CanaryConfigs(namespace).Delete(input.Context(), input.String(flagkey.CanaryName), metav1.DeleteOptions{})
|
||||||
@@ -47,7 +46,7 @@ func (opts *DeleteSubCommand) run(input cli.Input) (err error) {
|
|||||||
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.Wrap(err, "error deleting canary config")
|
return fmt.Errorf("error deleting canary config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("canaryconfig '%v.%v' deleted\n", input.String(flagkey.CanaryName), namespace)
|
fmt.Printf("canaryconfig '%v.%v' deleted\n", input.String(flagkey.CanaryName), namespace)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -41,12 +40,12 @@ func (opts *GetSubCommand) run(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceCanary)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceCanary)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting canary config")
|
return fmt.Errorf("error getting canary config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
canaryCfg, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(namespace).Get(input.Context(), input.String(flagkey.CanaryName), metav1.GetOptions{})
|
canaryCfg, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(namespace).Get(input.Context(), input.String(flagkey.CanaryName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting canary config")
|
return fmt.Errorf("error getting canary config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -49,7 +48,7 @@ func (opts *ListSubCommand) do(input cli.Input) error {
|
|||||||
func (opts *ListSubCommand) complete(input cli.Input) (err error) {
|
func (opts *ListSubCommand) complete(input cli.Input) (err error) {
|
||||||
_, opts.namespace, err = opts.GetResourceNamespace(input, flagkey.NamespaceCanary)
|
_, opts.namespace, err = opts.GetResourceNamespace(input, flagkey.NamespaceCanary)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in listing canary config ")
|
return fmt.Errorf("error in listing canary config: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -62,7 +61,7 @@ func (opts *ListSubCommand) run(input cli.Input) (err error) {
|
|||||||
canaryCfgs, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(opts.namespace).List(input.Context(), metav1.ListOptions{})
|
canaryCfgs, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(opts.namespace).List(input.Context(), metav1.ListOptions{})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error listing canary config")
|
return fmt.Errorf("error listing canary config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -50,7 +49,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
// get the current config
|
// get the current config
|
||||||
_, ns, err := opts.GetResourceNamespace(input, flagkey.NamespaceCanary)
|
_, ns, err := opts.GetResourceNamespace(input, flagkey.NamespaceCanary)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error updating canary config")
|
return fmt.Errorf("error updating canary config: %w", err)
|
||||||
}
|
}
|
||||||
incrementStep := input.Int(flagkey.CanaryWeightIncrement)
|
incrementStep := input.Int(flagkey.CanaryWeightIncrement)
|
||||||
failureThreshold := input.Int(flagkey.CanaryFailureThreshold)
|
failureThreshold := input.Int(flagkey.CanaryFailureThreshold)
|
||||||
@@ -59,12 +58,12 @@ func (opts *UpdateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
// check for time parsing
|
// check for time parsing
|
||||||
_, err = time.ParseDuration(incrementInterval)
|
_, err = time.ParseDuration(incrementInterval)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error parsing time duration")
|
return fmt.Errorf("error parsing time duration: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
canaryCfg, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(ns).Get(input.Context(), input.String(flagkey.CanaryName), metav1.GetOptions{})
|
canaryCfg, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(ns).Get(input.Context(), input.String(flagkey.CanaryName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting canary config")
|
return fmt.Errorf("error getting canary config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var updateNeeded bool
|
var updateNeeded bool
|
||||||
@@ -93,7 +92,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
func (opts *UpdateSubCommand) run(input cli.Input) error {
|
func (opts *UpdateSubCommand) run(input cli.Input) error {
|
||||||
_, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(opts.canary.ObjectMeta.Namespace).Update(input.Context(), opts.canary, metav1.UpdateOptions{})
|
_, err := opts.Client().FissionClientSet.CoreV1().CanaryConfigs(opts.canary.ObjectMeta.Namespace).Update(input.Context(), opts.canary, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error updating canary config")
|
return fmt.Errorf("error updating canary config: %w", err)
|
||||||
}
|
}
|
||||||
fmt.Printf("canary config '%v' updated\n", opts.canary.ObjectMeta.Name)
|
fmt.Printf("canary config '%v' updated\n", opts.canary.ObjectMeta.Name)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ func getLoadingRules() (loadingRules *clientcmd.ClientConfigLoadingRules, err er
|
|||||||
|
|
||||||
if _, err := os.Stat(kubeConfigPath); os.IsNotExist(err) {
|
if _, err := os.Stat(kubeConfigPath); os.IsNotExist(err) {
|
||||||
return nil, errors.New("couldn't find kubeconfig file. " +
|
return nil, errors.New("couldn't find kubeconfig file. " +
|
||||||
"Set the KUBECONFIG environment variable to your kubeconfig's path.")
|
"Set the KUBECONFIG environment variable to your kubeconfig's path")
|
||||||
}
|
}
|
||||||
loadingRules.ExplicitPath = kubeConfigPath
|
loadingRules.ExplicitPath = kubeConfigPath
|
||||||
console.Verbose(2, "Using kubeconfig from %q", kubeConfigPath)
|
console.Verbose(2, "Using kubeconfig from %q", kubeConfigPath)
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/pkg/errors"
|
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -101,7 +100,7 @@ func (opts *CreateSubCommand) run(input cli.Input) (err error) {
|
|||||||
specFile := fmt.Sprintf("env-%v.yaml", opts.env.ObjectMeta.Name)
|
specFile := fmt.Sprintf("env-%v.yaml", opts.env.ObjectMeta.Name)
|
||||||
err = spec.SpecSave(*opts.env, specFile, false)
|
err = spec.SpecSave(*opts.env, specFile, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error saving environment spec")
|
return fmt.Errorf("error saving environment spec: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -110,7 +109,7 @@ func (opts *CreateSubCommand) run(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, err = opts.Client().FissionClientSet.CoreV1().Environments(opts.env.Namespace).Create(input.Context(), opts.env, metav1.CreateOptions{})
|
_, err = opts.Client().FissionClientSet.CoreV1().Environments(opts.env.Namespace).Create(input.Context(), opts.env, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating resource")
|
return fmt.Errorf("error creating resource: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("environment '%v' created\n", opts.env.ObjectMeta.Name)
|
fmt.Printf("environment '%v' created\n", opts.env.ObjectMeta.Name)
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ limitations under the License.
|
|||||||
package environment
|
package environment
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ func (opts *DeleteSubCommand) do(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, currentContextNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
_, currentContextNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating environment")
|
return fmt.Errorf("error creating environment: %w", err)
|
||||||
}
|
}
|
||||||
console.Verbose(2, "Searching for resource in %s Namespace", currentContextNS)
|
console.Verbose(2, "Searching for resource in %s Namespace", currentContextNS)
|
||||||
envName := input.String(flagkey.EnvName)
|
envName := input.String(flagkey.EnvName)
|
||||||
@@ -49,13 +49,13 @@ func (opts *DeleteSubCommand) do(input cli.Input) (err error) {
|
|||||||
if !input.Bool(flagkey.EnvForce) {
|
if !input.Bool(flagkey.EnvForce) {
|
||||||
fns, err := opts.Client().FissionClientSet.CoreV1().Functions(metav1.NamespaceAll).List(input.Context(), metav1.ListOptions{})
|
fns, err := opts.Client().FissionClientSet.CoreV1().Functions(metav1.NamespaceAll).List(input.Context(), metav1.ListOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "Error getting functions wrt environment.")
|
return fmt.Errorf("error getting functions wrt environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, fn := range fns.Items {
|
for _, fn := range fns.Items {
|
||||||
if fn.Spec.Environment.Name == envName &&
|
if fn.Spec.Environment.Name == envName &&
|
||||||
fn.Spec.Environment.Namespace == currentContextNS {
|
fn.Spec.Environment.Namespace == currentContextNS {
|
||||||
return errors.New("Environment is used by at least one function.")
|
return errors.New("environment is used by at least one function")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ func (opts *DeleteSubCommand) do(input cli.Input) (err error) {
|
|||||||
if input.Bool(flagkey.IgnoreNotFound) && kerrors.IsNotFound(err) {
|
if input.Bool(flagkey.IgnoreNotFound) && kerrors.IsNotFound(err) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.Wrap(err, "error deleting environment")
|
return fmt.Errorf("error deleting environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("environment '%s' deleted\n", envName)
|
fmt.Printf("environment '%s' deleted\n", envName)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -41,12 +40,12 @@ func (opts *GetSubCommand) do(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, currentNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
_, currentNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating environment")
|
return fmt.Errorf("error creating environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
env, err := opts.Client().FissionClientSet.CoreV1().Environments(currentNS).Get(input.Context(), input.String(flagkey.EnvName), metav1.GetOptions{})
|
env, err := opts.Client().FissionClientSet.CoreV1().Environments(currentNS).Get(input.Context(), input.String(flagkey.EnvName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting environment")
|
return fmt.Errorf("error getting environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -41,7 +40,7 @@ func (opts *ListSubCommand) do(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, currentNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
_, currentNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating environment")
|
return fmt.Errorf("error creating environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.Bool(flagkey.AllNamespaces) {
|
if input.Bool(flagkey.AllNamespaces) {
|
||||||
@@ -50,7 +49,7 @@ func (opts *ListSubCommand) do(input cli.Input) (err error) {
|
|||||||
|
|
||||||
response, err := opts.Client().FissionClientSet.CoreV1().Environments(currentNS).List(input.Context(), metav1.ListOptions{})
|
response, err := opts.Client().FissionClientSet.CoreV1().Environments(currentNS).List(input.Context(), metav1.ListOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error listing environments")
|
return fmt.Errorf("error listing environments: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
envs := response.Items
|
envs := response.Items
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
|
|
||||||
@@ -44,12 +43,12 @@ func (opts *ListPodsSubCommand) do(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, currentNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
_, currentNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating environment")
|
return fmt.Errorf("error creating environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = opts.Client().FissionClientSet.CoreV1().Environments(currentNS).Get(input.Context(), input.String(flagkey.EnvName), metav1.GetOptions{})
|
_, err = opts.Client().FissionClientSet.CoreV1().Environments(currentNS).Get(input.Context(), input.String(flagkey.EnvName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting environment")
|
return fmt.Errorf("error getting environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// label selector
|
// label selector
|
||||||
@@ -65,7 +64,7 @@ func (opts *ListPodsSubCommand) do(input cli.Input) (err error) {
|
|||||||
LabelSelector: labels.Set(selector).AsSelector().String(),
|
LabelSelector: labels.Set(selector).AsSelector().String(),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error listing environments")
|
return fmt.Errorf("error listing environments: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||||
|
|||||||
@@ -17,11 +17,12 @@ limitations under the License.
|
|||||||
package environment
|
package environment
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/pkg/errors"
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -57,11 +58,11 @@ func (opts *UpdateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, currentContextNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
_, currentContextNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating environment")
|
return fmt.Errorf("error creating environment: %w", err)
|
||||||
}
|
}
|
||||||
env, err := opts.Client().FissionClientSet.CoreV1().Environments(currentContextNS).Get(input.Context(), input.String(flagkey.EnvName), metav1.GetOptions{})
|
env, err := opts.Client().FissionClientSet.CoreV1().Environments(currentContextNS).Get(input.Context(), input.String(flagkey.EnvName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error finding environment")
|
return fmt.Errorf("error finding environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
env, err = updateExistingEnvironmentWithCmd(env, input)
|
env, err = updateExistingEnvironmentWithCmd(env, input)
|
||||||
@@ -89,16 +90,16 @@ func (opts *UpdateSubCommand) run(input cli.Input) error {
|
|||||||
specFile := fmt.Sprintf("env-%s.yaml", m.Name)
|
specFile := fmt.Sprintf("env-%s.yaml", m.Name)
|
||||||
err = spec.SpecSave(*opts.env, specFile, true)
|
err = spec.SpecSave(*opts.env, specFile, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error saving environment spec")
|
return fmt.Errorf("error saving environment spec: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
enew, err := opts.Client().FissionClientSet.CoreV1().Environments(opts.env.ObjectMeta.Namespace).Update(input.Context(), opts.env, metav1.UpdateOptions{})
|
enew, err := opts.Client().FissionClientSet.CoreV1().Environments(opts.env.ObjectMeta.Namespace).Update(input.Context(), opts.env, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error updating environment")
|
return fmt.Errorf("error updating environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("environment '%v' updated\n", enew.ObjectMeta.Name)
|
fmt.Printf("environment '%v' updated\n", enew.Name)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +152,7 @@ func updateExistingEnvironmentWithCmd(env *fv1.Environment, input cli.Input) (*f
|
|||||||
mincpu := input.Int(flagkey.RuntimeMincpu)
|
mincpu := input.Int(flagkey.RuntimeMincpu)
|
||||||
cpuRequest, err := resource.ParseQuantity(strconv.Itoa(mincpu) + "m")
|
cpuRequest, err := resource.ParseQuantity(strconv.Itoa(mincpu) + "m")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e = multierror.Append(e, errors.Wrap(err, "Failed to parse mincpu"))
|
e = multierror.Append(e, fmt.Errorf("failed to parse mincpu: %w", err))
|
||||||
}
|
}
|
||||||
env.Spec.Resources.Requests[v1.ResourceCPU] = cpuRequest
|
env.Spec.Resources.Requests[v1.ResourceCPU] = cpuRequest
|
||||||
}
|
}
|
||||||
@@ -160,7 +161,7 @@ func updateExistingEnvironmentWithCmd(env *fv1.Environment, input cli.Input) (*f
|
|||||||
maxcpu := input.Int(flagkey.RuntimeMaxcpu)
|
maxcpu := input.Int(flagkey.RuntimeMaxcpu)
|
||||||
cpuLimit, err := resource.ParseQuantity(strconv.Itoa(maxcpu) + "m")
|
cpuLimit, err := resource.ParseQuantity(strconv.Itoa(maxcpu) + "m")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e = multierror.Append(e, errors.Wrap(err, "Failed to parse maxcpu"))
|
e = multierror.Append(e, fmt.Errorf("failed to parse maxcpu: %w", err))
|
||||||
}
|
}
|
||||||
env.Spec.Resources.Limits[v1.ResourceCPU] = cpuLimit
|
env.Spec.Resources.Limits[v1.ResourceCPU] = cpuLimit
|
||||||
}
|
}
|
||||||
@@ -169,7 +170,7 @@ func updateExistingEnvironmentWithCmd(env *fv1.Environment, input cli.Input) (*f
|
|||||||
minmem := input.Int(flagkey.RuntimeMinmemory)
|
minmem := input.Int(flagkey.RuntimeMinmemory)
|
||||||
memRequest, err := resource.ParseQuantity(strconv.Itoa(minmem) + "Mi")
|
memRequest, err := resource.ParseQuantity(strconv.Itoa(minmem) + "Mi")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e = multierror.Append(e, errors.Wrap(err, "Failed to parse minmemory"))
|
e = multierror.Append(e, fmt.Errorf("failed to parse minmemory: %w", err))
|
||||||
}
|
}
|
||||||
env.Spec.Resources.Requests[v1.ResourceMemory] = memRequest
|
env.Spec.Resources.Requests[v1.ResourceMemory] = memRequest
|
||||||
}
|
}
|
||||||
@@ -178,7 +179,7 @@ func updateExistingEnvironmentWithCmd(env *fv1.Environment, input cli.Input) (*f
|
|||||||
maxmem := input.Int(flagkey.RuntimeMaxmemory)
|
maxmem := input.Int(flagkey.RuntimeMaxmemory)
|
||||||
memLimit, err := resource.ParseQuantity(strconv.Itoa(maxmem) + "Mi")
|
memLimit, err := resource.ParseQuantity(strconv.Itoa(maxmem) + "Mi")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e = multierror.Append(e, errors.Wrap(err, "Failed to parse maxmemory"))
|
e = multierror.Append(e, fmt.Errorf("failed to parse maxmemory: %w", err))
|
||||||
}
|
}
|
||||||
env.Spec.Resources.Limits[v1.ResourceMemory] = memLimit
|
env.Spec.Resources.Limits[v1.ResourceMemory] = memLimit
|
||||||
}
|
}
|
||||||
@@ -195,7 +196,7 @@ func updateExistingEnvironmentWithCmd(env *fv1.Environment, input cli.Input) (*f
|
|||||||
if limitCPU.IsZero() && !requestCPU.IsZero() {
|
if limitCPU.IsZero() && !requestCPU.IsZero() {
|
||||||
env.Spec.Resources.Limits[v1.ResourceCPU] = requestCPU
|
env.Spec.Resources.Limits[v1.ResourceCPU] = requestCPU
|
||||||
} else if limitCPU.Cmp(requestCPU) < 0 {
|
} else if limitCPU.Cmp(requestCPU) < 0 {
|
||||||
e = multierror.Append(e, fmt.Errorf("MinCPU (%v) cannot be greater than MaxCPU (%v)", requestCPU.String(), limitCPU.String()))
|
e = multierror.Append(e, fmt.Errorf("minCPU (%v) cannot be greater than MaxCPU (%v)", requestCPU.String(), limitCPU.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
limitMem := env.Spec.Resources.Limits[v1.ResourceMemory]
|
limitMem := env.Spec.Resources.Limits[v1.ResourceMemory]
|
||||||
@@ -204,7 +205,7 @@ func updateExistingEnvironmentWithCmd(env *fv1.Environment, input cli.Input) (*f
|
|||||||
if limitMem.IsZero() && !requestMem.IsZero() {
|
if limitMem.IsZero() && !requestMem.IsZero() {
|
||||||
env.Spec.Resources.Limits[v1.ResourceMemory] = requestMem
|
env.Spec.Resources.Limits[v1.ResourceMemory] = requestMem
|
||||||
} else if limitMem.Cmp(requestMem) < 0 {
|
} else if limitMem.Cmp(requestMem) < 0 {
|
||||||
e = multierror.Append(e, fmt.Errorf("MinMemory (%v) cannot be greater than MaxMemory (%v)", requestMem.String(), limitMem.String()))
|
e = multierror.Append(e, fmt.Errorf("minMemory (%v) cannot be greater than MaxMemory (%v)", requestMem.String(), limitMem.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
if e.ErrorOrNil() != nil {
|
if e.ErrorOrNil() != nil {
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ limitations under the License.
|
|||||||
package function
|
package function
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
asv2 "k8s.io/api/autoscaling/v2"
|
asv2 "k8s.io/api/autoscaling/v2"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
@@ -67,7 +67,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
userProvidedNS, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
userProvidedNS, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error retrieving namespace information")
|
return fmt.Errorf("error retrieving namespace information: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// user wants a spec, create a yaml file with package and function
|
// user wants a spec, create a yaml file with package and function
|
||||||
@@ -93,7 +93,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
fnTimeout := input.Int(flagkey.FnExecutionTimeout)
|
fnTimeout := input.Int(flagkey.FnExecutionTimeout)
|
||||||
if fnTimeout <= 0 {
|
if fnTimeout <= 0 {
|
||||||
return errors.Errorf("--%v must be greater than 0", flagkey.FnExecutionTimeout)
|
return fmt.Errorf("--%v must be greater than 0", flagkey.FnExecutionTimeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
fnIdleTimeout := input.Int(flagkey.FnIdleTimeout)
|
fnIdleTimeout := input.Int(flagkey.FnIdleTimeout)
|
||||||
@@ -119,7 +119,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
cfgMapNames := input.StringSlice(flagkey.FnCfgMap)
|
cfgMapNames := input.StringSlice(flagkey.FnCfgMap)
|
||||||
|
|
||||||
if input.String(flagkey.FnExecutorType) == string(fv1.ExecutorTypeContainer) {
|
if input.String(flagkey.FnExecutorType) == string(fv1.ExecutorTypeContainer) {
|
||||||
return errors.Errorf("this command does not support creating function of executor type container. Check `fission function run-container --help`")
|
return fmt.Errorf("this command does not support creating function of executor type container. Check `fission function run-container --help`")
|
||||||
}
|
}
|
||||||
|
|
||||||
invokeStrategy, err := getInvokeStrategy(input, nil)
|
invokeStrategy, err := getInvokeStrategy(input, nil)
|
||||||
@@ -141,7 +141,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
fr, err := spec.ReadSpecs(specDir, specIgnore, false)
|
fr, err := spec.ReadSpecs(specDir, specIgnore, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("error reading spec in '%s'", specDir))
|
return fmt.Errorf("error reading spec in '%s': %w", specDir, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
obj := fr.SpecExists(&fv1.Package{ // In case of spec I might or might not have the `fnNamespace`, how will I get pkg objectMeta here.
|
obj := fr.SpecExists(&fv1.Package{ // In case of spec I might or might not have the `fnNamespace`, how will I get pkg objectMeta here.
|
||||||
@@ -151,7 +151,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
},
|
},
|
||||||
}, true, false)
|
}, true, false)
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return errors.Errorf("please create package %s spec file with namespace %s before referencing it", pkgName, userProvidedNS)
|
return fmt.Errorf("please create package %s spec file with namespace %s before referencing it", pkgName, userProvidedNS)
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg = obj.(*fv1.Package)
|
pkg = obj.(*fv1.Package)
|
||||||
@@ -160,7 +160,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
// use existing package
|
// use existing package
|
||||||
pkg, err = opts.Client().FissionClientSet.CoreV1().Packages(fnNamespace).Get(input.Context(), pkgName, metav1.GetOptions{})
|
pkg, err = opts.Client().FissionClientSet.CoreV1().Packages(fnNamespace).Get(input.Context(), pkgName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("read package in '%s' in Namespace: %s. Package needs to be present in the same namespace as function", pkgName, fnNamespace))
|
return fmt.Errorf("read package in '%s' in Namespace: %s. Package needs to be present in the same namespace as function: %w", pkgName, fnNamespace, err)
|
||||||
}
|
}
|
||||||
pkgMetadata = &pkg.ObjectMeta
|
pkgMetadata = &pkg.ObjectMeta
|
||||||
}
|
}
|
||||||
@@ -180,7 +180,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
fr, err := spec.ReadSpecs(specDir, specIgnore, false)
|
fr, err := spec.ReadSpecs(specDir, specIgnore, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("error reading spec in '%s'", specDir))
|
return fmt.Errorf("error reading spec in '%s': %w", specDir, err)
|
||||||
}
|
}
|
||||||
exists, err := fr.ExistsInSpecs(fv1.Environment{
|
exists, err := fr.ExistsInSpecs(fv1.Environment{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@@ -201,7 +201,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
if e, ok := err.(ferror.Error); ok && e.Code == ferror.ErrorNotFound {
|
if e, ok := err.(ferror.Error); ok && e.Code == ferror.ErrorNotFound {
|
||||||
console.Warn(fmt.Sprintf("Environment \"%s\" does not exist. Please create the environment before executing the function. \nFor example: `fission env create --name %s --envns %s --image <image>`\n", envName, envName, fnNamespace))
|
console.Warn(fmt.Sprintf("Environment \"%s\" does not exist. Please create the environment before executing the function. \nFor example: `fission env create --name %s --envns %s --image <image>`\n", envName, envName, fnNamespace))
|
||||||
} else {
|
} else {
|
||||||
return errors.Wrap(err, "error retrieving environment information")
|
return fmt.Errorf("error retrieving environment information: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
pkgMetadata, err = _package.CreatePackage(input, opts.Client(), pkgName, fnNamespace, envName,
|
pkgMetadata, err = _package.CreatePackage(input, opts.Client(), pkgName, fnNamespace, envName,
|
||||||
srcArchiveFiles, deployArchiveFiles, buildcmd, specDir, opts.specFile, noZip, userProvidedNS)
|
srcArchiveFiles, deployArchiveFiles, buildcmd, specDir, opts.specFile, noZip, userProvidedNS)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating package")
|
return fmt.Errorf("error creating package: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
if k8serrors.IsNotFound(err) {
|
if k8serrors.IsNotFound(err) {
|
||||||
console.Warn(fmt.Sprintf("Secret %s not found in Namespace: %s. Secret needs to be present in the same namespace as function", secretName, fnNamespace))
|
console.Warn(fmt.Sprintf("Secret %s not found in Namespace: %s. Secret needs to be present in the same namespace as function", secretName, fnNamespace))
|
||||||
} else {
|
} else {
|
||||||
return errors.Wrapf(err, "error checking secret %s", secretName)
|
return fmt.Errorf("error checking secret %s: %w", secretName, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newSecret := fv1.SecretReference{
|
newSecret := fv1.SecretReference{
|
||||||
@@ -274,7 +274,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
if k8serrors.IsNotFound(err) {
|
if k8serrors.IsNotFound(err) {
|
||||||
console.Warn(fmt.Sprintf("ConfigMap %s not found in Namespace: %s. ConfigMap needs to be present in the same namespace as function", cfgMapName, fnNamespace))
|
console.Warn(fmt.Sprintf("ConfigMap %s not found in Namespace: %s. ConfigMap needs to be present in the same namespace as function", cfgMapName, fnNamespace))
|
||||||
} else {
|
} else {
|
||||||
return errors.Wrapf(err, "error checking configmap %s", cfgMapName)
|
return fmt.Errorf("error checking configmap %s: %w", cfgMapName, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newCfgMap := fv1.ConfigMapReference{
|
newCfgMap := fv1.ConfigMapReference{
|
||||||
@@ -342,8 +342,8 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
// 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.
|
// 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 {
|
func generatePackageName(fnName string, id string) string {
|
||||||
var (
|
var (
|
||||||
lenFnName int = len(fnName)
|
lenFnName = len(fnName)
|
||||||
lenId int = len(id)
|
lenId = len(id)
|
||||||
lastIndexOfChar int
|
lastIndexOfChar int
|
||||||
)
|
)
|
||||||
if lenFnName+lenId <= 62 {
|
if lenFnName+lenId <= 62 {
|
||||||
@@ -368,14 +368,14 @@ func (opts *CreateSubCommand) run(input cli.Input) error {
|
|||||||
if input.Bool(flagkey.SpecSave) {
|
if input.Bool(flagkey.SpecSave) {
|
||||||
err := spec.SpecSave(*opts.function, opts.specFile, false)
|
err := spec.SpecSave(*opts.function, opts.specFile, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error saving function spec")
|
return fmt.Errorf("error saving function spec: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := opts.Client().FissionClientSet.CoreV1().Functions(opts.function.ObjectMeta.Namespace).Create(input.Context(), opts.function, metav1.CreateOptions{})
|
_, err := opts.Client().FissionClientSet.CoreV1().Functions(opts.function.ObjectMeta.Namespace).Create(input.Context(), opts.function, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating function")
|
return fmt.Errorf("error creating function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("function '%s' created\n", opts.function.ObjectMeta.Name)
|
fmt.Printf("function '%s' created\n", opts.function.ObjectMeta.Name)
|
||||||
@@ -420,7 +420,7 @@ func (opts *CreateSubCommand) run(input cli.Input) error {
|
|||||||
}
|
}
|
||||||
_, err = opts.Client().FissionClientSet.CoreV1().HTTPTriggers(opts.function.ObjectMeta.Namespace).Create(input.Context(), ht, metav1.CreateOptions{})
|
_, err = opts.Client().FissionClientSet.CoreV1().HTTPTriggers(opts.function.ObjectMeta.Namespace).Create(input.Context(), ht, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating HTTP trigger")
|
return fmt.Errorf("error creating HTTP trigger: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("route created: %s %s -> %s\n", methods, triggerUrl, opts.function.ObjectMeta.Name)
|
fmt.Printf("route created: %s %s -> %s\n", methods, triggerUrl, opts.function.ObjectMeta.Name)
|
||||||
@@ -490,7 +490,7 @@ func getExecutorType(input cli.Input) (executorType fv1.ExecutorType, err error)
|
|||||||
case string(fv1.ExecutorTypeContainer):
|
case string(fv1.ExecutorTypeContainer):
|
||||||
executorType = fv1.ExecutorTypeContainer
|
executorType = fv1.ExecutorTypeContainer
|
||||||
default:
|
default:
|
||||||
err = errors.Errorf("executor type must be one of '%v', '%v' or '%v'", fv1.ExecutorTypePoolmgr, fv1.ExecutorTypeNewdeploy, fv1.ExecutorTypeContainer)
|
err = fmt.Errorf("executor type must be one of '%v', '%v' or '%v'", fv1.ExecutorTypePoolmgr, fv1.ExecutorTypeNewdeploy, fv1.ExecutorTypeContainer)
|
||||||
}
|
}
|
||||||
return executorType, err
|
return executorType, err
|
||||||
}
|
}
|
||||||
@@ -501,7 +501,7 @@ func getExecutionStrategy(fnExecutor fv1.ExecutorType, input cli.Input) (strateg
|
|||||||
if input.IsSet(flagkey.FnSpecializationTimeout) {
|
if input.IsSet(flagkey.FnSpecializationTimeout) {
|
||||||
specializationTimeout = input.Int(flagkey.FnSpecializationTimeout)
|
specializationTimeout = input.Int(flagkey.FnSpecializationTimeout)
|
||||||
if specializationTimeout < fv1.DefaultSpecializationTimeOut {
|
if specializationTimeout < fv1.DefaultSpecializationTimeOut {
|
||||||
return nil, errors.Errorf("%v must be greater than or equal to 120 seconds", flagkey.FnSpecializationTimeout)
|
return nil, fmt.Errorf("%v must be greater than or equal to 120 seconds", flagkey.FnSpecializationTimeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -529,7 +529,7 @@ func getExecutionStrategy(fnExecutor fv1.ExecutorType, input cli.Input) (strateg
|
|||||||
if input.IsSet(flagkey.ReplicasMaxscale) {
|
if input.IsSet(flagkey.ReplicasMaxscale) {
|
||||||
maxScale = input.Int(flagkey.ReplicasMaxscale)
|
maxScale = input.Int(flagkey.ReplicasMaxscale)
|
||||||
if maxScale <= 0 {
|
if maxScale <= 0 {
|
||||||
return nil, errors.Errorf("%v must be greater than 0", flagkey.ReplicasMaxscale)
|
return nil, fmt.Errorf("%v must be greater than 0", flagkey.ReplicasMaxscale)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -573,7 +573,7 @@ func updateExecutionStrategy(input cli.Input, existingExecutionStrategy *fv1.Exe
|
|||||||
case string(fv1.ExecutorTypeContainer):
|
case string(fv1.ExecutorTypeContainer):
|
||||||
fnExecutor = fv1.ExecutorTypeContainer
|
fnExecutor = fv1.ExecutorTypeContainer
|
||||||
default:
|
default:
|
||||||
return nil, errors.Errorf("executor type must be one of '%v', %v or '%v'", fv1.ExecutorTypePoolmgr, fv1.ExecutorTypeNewdeploy, fv1.ExecutorTypeContainer)
|
return nil, fmt.Errorf("executor type must be one of '%v', %v or '%v'", fv1.ExecutorTypePoolmgr, fv1.ExecutorTypeNewdeploy, fv1.ExecutorTypeContainer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,7 +582,7 @@ func updateExecutionStrategy(input cli.Input, existingExecutionStrategy *fv1.Exe
|
|||||||
if input.IsSet(flagkey.FnSpecializationTimeout) {
|
if input.IsSet(flagkey.FnSpecializationTimeout) {
|
||||||
specializationTimeout = input.Int(flagkey.FnSpecializationTimeout)
|
specializationTimeout = input.Int(flagkey.FnSpecializationTimeout)
|
||||||
if specializationTimeout < fv1.DefaultSpecializationTimeOut {
|
if specializationTimeout < fv1.DefaultSpecializationTimeOut {
|
||||||
return nil, errors.Errorf("%v must be greater than or equal to 120 seconds", flagkey.FnSpecializationTimeout)
|
return nil, fmt.Errorf("%v must be greater than or equal to 120 seconds", flagkey.FnSpecializationTimeout)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if specializationTimeout < fv1.DefaultSpecializationTimeOut {
|
if specializationTimeout < fv1.DefaultSpecializationTimeOut {
|
||||||
@@ -618,7 +618,7 @@ func updateExecutionStrategy(input cli.Input, existingExecutionStrategy *fv1.Exe
|
|||||||
if input.IsSet(flagkey.ReplicasMaxscale) {
|
if input.IsSet(flagkey.ReplicasMaxscale) {
|
||||||
maxScale = input.Int(flagkey.ReplicasMaxscale)
|
maxScale = input.Int(flagkey.ReplicasMaxscale)
|
||||||
if maxScale <= 0 {
|
if maxScale <= 0 {
|
||||||
return nil, errors.Errorf("%v must be greater than 0", flagkey.ReplicasMaxscale)
|
return nil, fmt.Errorf("%v must be greater than 0", flagkey.ReplicasMaxscale)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if maxScale <= 0 {
|
if maxScale <= 0 {
|
||||||
@@ -655,7 +655,7 @@ func updateExecutionStrategy(input cli.Input, existingExecutionStrategy *fv1.Exe
|
|||||||
func getTargetCPU(input cli.Input) (int, error) {
|
func getTargetCPU(input cli.Input) (int, error) {
|
||||||
targetCPU := input.Int(flagkey.RuntimeTargetcpu)
|
targetCPU := input.Int(flagkey.RuntimeTargetcpu)
|
||||||
if targetCPU <= 0 || targetCPU > 100 {
|
if targetCPU <= 0 || targetCPU > 100 {
|
||||||
return 0, errors.Errorf("%v must be a value between 1 - 100", flagkey.RuntimeTargetcpu)
|
return 0, fmt.Errorf("%v must be a value between 1 - 100", flagkey.RuntimeTargetcpu)
|
||||||
}
|
}
|
||||||
return targetCPU, nil
|
return targetCPU, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package function
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -40,7 +39,7 @@ func (opts *DeleteSubCommand) do(input cli.Input) error {
|
|||||||
|
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in deleting function ")
|
return fmt.Errorf("error in deleting function : %w", err)
|
||||||
}
|
}
|
||||||
m := &metav1.ObjectMeta{
|
m := &metav1.ObjectMeta{
|
||||||
Name: input.String(flagkey.FnName),
|
Name: input.String(flagkey.FnName),
|
||||||
@@ -52,7 +51,7 @@ func (opts *DeleteSubCommand) do(input cli.Input) error {
|
|||||||
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.Wrap(err, fmt.Sprintf("delete function '%s'", m.Name))
|
return fmt.Errorf("delete function '%s': %w", m.Name, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("function '%s' deleted\n", m.Name)
|
fmt.Printf("function '%s' deleted\n", m.Name)
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ limitations under the License.
|
|||||||
package function
|
package function
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -38,16 +38,16 @@ func Get(input cli.Input) error {
|
|||||||
func (opts *GetSubCommand) do(input cli.Input) error {
|
func (opts *GetSubCommand) do(input cli.Input) error {
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in get function ")
|
return fmt.Errorf("error in get function : %w", err)
|
||||||
}
|
}
|
||||||
fn, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
fn, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting function")
|
return fmt.Errorf("error getting function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(fn.Spec.Package.PackageRef.Namespace).Get(input.Context(), fn.Spec.Package.PackageRef.Name, metav1.GetOptions{})
|
pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(fn.Spec.Package.PackageRef.Namespace).Get(input.Context(), fn.Spec.Package.PackageRef.Name, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting package")
|
return fmt.Errorf("error getting package: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Stdout.Write(pkg.Spec.Deployment.Literal)
|
os.Stdout.Write(pkg.Spec.Deployment.Literal)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package function
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -38,12 +37,12 @@ func GetMeta(input cli.Input) error {
|
|||||||
func (opts *GetMetaSubCommand) do(input cli.Input) error {
|
func (opts *GetMetaSubCommand) do(input cli.Input) error {
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in getting meta function ")
|
return fmt.Errorf("error in getting meta function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
fn, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting function")
|
return fmt.Errorf("error getting function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Name: %v\n", fn.ObjectMeta.Name)
|
fmt.Printf("Name: %v\n", fn.ObjectMeta.Name)
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -41,7 +40,7 @@ func List(input cli.Input) error {
|
|||||||
func (opts *ListSubCommand) do(input cli.Input) error {
|
func (opts *ListSubCommand) do(input cli.Input) error {
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in listing function ")
|
return fmt.Errorf("error in listing function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.Bool(flagkey.AllNamespaces) {
|
if input.Bool(flagkey.AllNamespaces) {
|
||||||
@@ -50,7 +49,7 @@ func (opts *ListSubCommand) do(input cli.Input) error {
|
|||||||
fns, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).List(input.Context(), metav1.ListOptions{})
|
fns, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).List(input.Context(), metav1.ListOptions{})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error listing functions")
|
return fmt.Errorf("error listing functions: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ package function
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -44,7 +44,7 @@ func Log(input cli.Input) error {
|
|||||||
func (opts *LogSubCommand) do(input cli.Input) error {
|
func (opts *LogSubCommand) do(input cli.Input) error {
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in logs for function ")
|
return fmt.Errorf("error in logs for function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dbType := input.String(flagkey.FnLogDBType)
|
dbType := input.String(flagkey.FnLogDBType)
|
||||||
@@ -60,7 +60,7 @@ func (opts *LogSubCommand) do(input cli.Input) error {
|
|||||||
|
|
||||||
f, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
f, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting function")
|
return fmt.Errorf("error getting function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
logDBOptions := logdb.LogDBOptions{
|
logDBOptions := logdb.LogDBOptions{
|
||||||
@@ -70,7 +70,7 @@ func (opts *LogSubCommand) do(input cli.Input) error {
|
|||||||
// request the controller to establish a proxy server to the database.
|
// request the controller to establish a proxy server to the database.
|
||||||
logDB, err := logdb.GetLogDB(dbType, input.Context(), logDBOptions)
|
logDB, err := logdb.GetLogDB(dbType, input.Context(), logDBOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "failed to get log from %s", dbType)
|
return fmt.Errorf("failed to get log from %s: %w", dbType, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
requestChan := make(chan struct{})
|
requestChan := make(chan struct{})
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
|
|
||||||
@@ -45,12 +44,12 @@ func (opts *ListPodsSubCommand) do(input cli.Input) error {
|
|||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in finding pod for function ")
|
return fmt.Errorf("error in finding pod for function : %w", err)
|
||||||
}
|
}
|
||||||
// validate function
|
// validate function
|
||||||
_, err = opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
_, err = opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting function")
|
return fmt.Errorf("error getting function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
selector := map[string]string{
|
selector := map[string]string{
|
||||||
@@ -64,7 +63,7 @@ func (opts *ListPodsSubCommand) do(input cli.Input) error {
|
|||||||
LabelSelector: labels.Set(selector).AsSelector().String(),
|
LabelSelector: labels.Set(selector).AsSelector().String(),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error listing environments")
|
return fmt.Errorf("error listing environments: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"errors"
|
||||||
|
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -57,7 +58,7 @@ func (opts *RunContainerSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
_, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in running container for function ")
|
return fmt.Errorf("error in running container for function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// user wants a spec, create a yaml file with package and function
|
// user wants a spec, create a yaml file with package and function
|
||||||
@@ -80,7 +81,7 @@ func (opts *RunContainerSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
fnTimeout := input.Int(flagkey.FnExecutionTimeout)
|
fnTimeout := input.Int(flagkey.FnExecutionTimeout)
|
||||||
if fnTimeout <= 0 {
|
if fnTimeout <= 0 {
|
||||||
return errors.Errorf("--%v must be greater than 0", flagkey.FnExecutionTimeout)
|
return fmt.Errorf("--%v must be greater than 0", flagkey.FnExecutionTimeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
fnIdleTimeout := input.Int(flagkey.FnIdleTimeout)
|
fnIdleTimeout := input.Int(flagkey.FnIdleTimeout)
|
||||||
@@ -132,7 +133,7 @@ func (opts *RunContainerSubCommand) complete(input cli.Input) error {
|
|||||||
if kerrors.IsNotFound(err) {
|
if kerrors.IsNotFound(err) {
|
||||||
console.Warn(fmt.Sprintf("Secret %s not found in Namespace: %s. Secret needs to be present in the same namespace as function", secretName, fnNamespace))
|
console.Warn(fmt.Sprintf("Secret %s not found in Namespace: %s. Secret needs to be present in the same namespace as function", secretName, fnNamespace))
|
||||||
} else {
|
} else {
|
||||||
return errors.Wrapf(err, "error checking secret %s", secretName)
|
return fmt.Errorf("error checking secret %s: %w", secretName, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,7 +157,7 @@ func (opts *RunContainerSubCommand) complete(input cli.Input) error {
|
|||||||
if kerrors.IsNotFound(err) {
|
if kerrors.IsNotFound(err) {
|
||||||
console.Warn(fmt.Sprintf("ConfigMap %s not found in Namespace: %s. ConfigMap needs to be present in the same namespace as function", cfgMapName, fnNamespace))
|
console.Warn(fmt.Sprintf("ConfigMap %s not found in Namespace: %s. ConfigMap needs to be present in the same namespace as function", cfgMapName, fnNamespace))
|
||||||
} else {
|
} else {
|
||||||
return errors.Wrapf(err, "error checking configmap %s", cfgMapName)
|
return fmt.Errorf("error checking configmap %s: %w", cfgMapName, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,14 +229,14 @@ func (opts *RunContainerSubCommand) run(input cli.Input) error {
|
|||||||
if input.Bool(flagkey.SpecSave) {
|
if input.Bool(flagkey.SpecSave) {
|
||||||
err := spec.SpecSave(*opts.function, opts.specFile, false)
|
err := spec.SpecSave(*opts.function, opts.specFile, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error saving function spec")
|
return fmt.Errorf("error saving function spec: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := opts.Client().FissionClientSet.CoreV1().Functions(opts.function.ObjectMeta.Namespace).Create(input.Context(), opts.function, metav1.CreateOptions{})
|
_, err := opts.Client().FissionClientSet.CoreV1().Functions(opts.function.ObjectMeta.Namespace).Create(input.Context(), opts.function, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating function")
|
return fmt.Errorf("error creating function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("function '%v' created\n", opts.function.ObjectMeta.Name)
|
fmt.Printf("function '%v' created\n", opts.function.ObjectMeta.Name)
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"errors"
|
||||||
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -53,12 +54,12 @@ func (opts *TestSubCommand) do(input cli.Input) error {
|
|||||||
fnName := input.String(flagkey.FnName)
|
fnName := input.String(flagkey.FnName)
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in testing function ")
|
return fmt.Errorf("error in testing function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
function, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), fnName, metav1.GetOptions{})
|
function, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), fnName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("read function '%s'", fnName))
|
return fmt.Errorf("read function '%s': %w", fnName, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
m := &metav1.ObjectMeta{
|
m := &metav1.ObjectMeta{
|
||||||
@@ -68,7 +69,7 @@ func (opts *TestSubCommand) do(input cli.Input) error {
|
|||||||
|
|
||||||
routerURL, err := util.GetRouterURL(input.Context(), opts.Client())
|
routerURL, err := util.GetRouterURL(input.Context(), opts.Client())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting router URL")
|
return fmt.Errorf("error getting router URL: %w", err)
|
||||||
}
|
}
|
||||||
fnURI := util.UrlForFunction(m.Name, m.Namespace)
|
fnURI := util.UrlForFunction(m.Name, m.Namespace)
|
||||||
if input.IsSet(flagkey.FnSubPath) {
|
if input.IsSet(flagkey.FnSubPath) {
|
||||||
@@ -129,7 +130,7 @@ func (opts *TestSubCommand) do(input cli.Input) error {
|
|||||||
if len(methods) == 0 {
|
if len(methods) == 0 {
|
||||||
return errors.New("HTTP method not mentioned")
|
return errors.New("HTTP method not mentioned")
|
||||||
} else if len(methods) > 1 {
|
} else if len(methods) > 1 {
|
||||||
return errors.New("More than one HTTP method not supported")
|
return errors.New("more than one HTTP method not supported")
|
||||||
}
|
}
|
||||||
method, err := httptrigger.GetMethod(methods[0])
|
method, err := httptrigger.GetMethod(methods[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -146,7 +147,7 @@ func (opts *TestSubCommand) do(input cli.Input) error {
|
|||||||
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error reading response from function")
|
return fmt.Errorf("error reading response from function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.StatusCode < 400 {
|
if resp.StatusCode < 400 {
|
||||||
@@ -186,7 +187,7 @@ func doHTTPRequest(ctx context.Context, url string, headers []string, method, bo
|
|||||||
|
|
||||||
req, err := http.NewRequest(method, url, strings.NewReader(body))
|
req, err := http.NewRequest(method, url, strings.NewReader(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error creating HTTP request")
|
return nil, fmt.Errorf("error creating HTTP request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
accesstoken, ok := os.LookupEnv(util.FISSION_AUTH_TOKEN)
|
accesstoken, ok := os.LookupEnv(util.FISSION_AUTH_TOKEN)
|
||||||
@@ -213,7 +214,7 @@ func doHTTPRequest(ctx context.Context, url string, headers []string, method, bo
|
|||||||
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
||||||
resp, err := hc.Do(req.WithContext(ctx))
|
resp, err := hc.Do(req.WithContext(ctx))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error executing HTTP request")
|
return nil, fmt.Errorf("error executing HTTP request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if console.Verbosity >= 2 {
|
if console.Verbosity >= 2 {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package function
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -55,7 +54,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
|||||||
fnName := input.String(flagkey.FnName)
|
fnName := input.String(flagkey.FnName)
|
||||||
_, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in updating function ")
|
return fmt.Errorf("error in updating function : %w", err)
|
||||||
}
|
}
|
||||||
if input.Bool(flagkey.SpecSave) {
|
if input.Bool(flagkey.SpecSave) {
|
||||||
opts.specFile = fmt.Sprintf("function-%s.yaml", fnName)
|
opts.specFile = fmt.Sprintf("function-%s.yaml", fnName)
|
||||||
@@ -63,7 +62,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
function, err := opts.Client().FissionClientSet.CoreV1().Functions(fnNamespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
function, err := opts.Client().FissionClientSet.CoreV1().Functions(fnNamespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("read function '%v'", fnName))
|
return fmt.Errorf("read function '%v': %w", fnName, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
envName := input.String(flagkey.FnEnvironmentName)
|
envName := input.String(flagkey.FnEnvironmentName)
|
||||||
@@ -135,7 +134,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
|||||||
if input.IsSet(flagkey.FnExecutionTimeout) {
|
if input.IsSet(flagkey.FnExecutionTimeout) {
|
||||||
fnTimeout := input.Int(flagkey.FnExecutionTimeout)
|
fnTimeout := input.Int(flagkey.FnExecutionTimeout)
|
||||||
if fnTimeout <= 0 {
|
if fnTimeout <= 0 {
|
||||||
return errors.Errorf("--%v must be greater than 0", flagkey.FnExecutionTimeout)
|
return fmt.Errorf("--%v must be greater than 0", flagkey.FnExecutionTimeout)
|
||||||
}
|
}
|
||||||
function.Spec.FunctionTimeout = fnTimeout
|
function.Spec.FunctionTimeout = fnTimeout
|
||||||
}
|
}
|
||||||
@@ -184,23 +183,23 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(fnNamespace).Get(input.Context(), pkgName, metav1.GetOptions{})
|
pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(fnNamespace).Get(input.Context(), pkgName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("read package '%v.%v'. Pkg should be present in the same ns as the function", pkgName, fnNamespace))
|
return fmt.Errorf("read package '%v.%v'. Pkg should be present in the same ns as the function: %w", pkgName, fnNamespace, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
forceUpdate := input.Bool(flagkey.PkgForce)
|
forceUpdate := input.Bool(flagkey.PkgForce)
|
||||||
|
|
||||||
fnList, err := _package.GetFunctionsByPackage(input.Context(), opts.Client(), pkg.ObjectMeta.Name, pkg.ObjectMeta.Namespace)
|
fnList, err := _package.GetFunctionsByPackage(input.Context(), opts.Client(), pkg.ObjectMeta.Name, pkg.ObjectMeta.Namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting function list")
|
return fmt.Errorf("error getting function list: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !forceUpdate && len(fnList) > 1 {
|
if !forceUpdate && len(fnList) > 1 {
|
||||||
return errors.Errorf("Package is used by multiple functions, use --%v to force update", flagkey.PkgForce)
|
return fmt.Errorf("package is used by multiple functions, use --%v to force update", flagkey.PkgForce)
|
||||||
}
|
}
|
||||||
|
|
||||||
newPkgMeta, err := _package.UpdatePackage(input, opts.Client(), opts.specFile, pkg)
|
newPkgMeta, err := _package.UpdatePackage(input, opts.Client(), opts.specFile, pkg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("error updating package '%v'", pkgName))
|
return fmt.Errorf("error updating package '%v': %w", pkgName, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// the package resource version of function has been changed,
|
// the package resource version of function has been changed,
|
||||||
@@ -217,7 +216,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
|||||||
}
|
}
|
||||||
err = _package.UpdateFunctionPackageResourceVersion(input.Context(), opts.Client(), newPkgMeta, fns...)
|
err = _package.UpdateFunctionPackageResourceVersion(input.Context(), opts.Client(), newPkgMeta, fns...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error updating function package reference resource version")
|
return fmt.Errorf("error updating function package reference resource version: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,13 +254,13 @@ func (opts *UpdateSubCommand) run(input cli.Input) error {
|
|||||||
}
|
}
|
||||||
err = spec.SpecSave(*opts.function, opts.specFile, false)
|
err = spec.SpecSave(*opts.function, opts.specFile, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error saving function spec")
|
return fmt.Errorf("error saving function spec: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
_, err := opts.Client().FissionClientSet.CoreV1().Functions(opts.function.Namespace).Update(input.Context(), opts.function, metav1.UpdateOptions{})
|
_, err := opts.Client().FissionClientSet.CoreV1().Functions(opts.function.Namespace).Update(input.Context(), opts.function, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error updating function")
|
return fmt.Errorf("error updating function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Function '%v' updated\n", opts.function.ObjectMeta.Name)
|
fmt.Printf("Function '%v' updated\n", opts.function.ObjectMeta.Name)
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -55,13 +54,13 @@ func (opts *UpdateContainerSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
_, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in updating container for function ")
|
return fmt.Errorf("error in updating container for function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
function, err := opts.Client().FissionClientSet.CoreV1().Functions(fnNamespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
function, err := opts.Client().FissionClientSet.CoreV1().Functions(fnNamespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("read function '%v'", fnName))
|
return fmt.Errorf("read function '%v': %w", fnName, err)
|
||||||
}
|
}
|
||||||
if fv1.ExecutorTypeContainer != function.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType {
|
if fv1.ExecutorTypeContainer != function.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType {
|
||||||
return fmt.Errorf("executor type for function is not %s", fv1.ExecutorTypeContainer)
|
return fmt.Errorf("executor type for function is not %s", fv1.ExecutorTypeContainer)
|
||||||
@@ -122,7 +121,7 @@ func (opts *UpdateContainerSubCommand) complete(input cli.Input) error {
|
|||||||
if input.IsSet(flagkey.FnExecutionTimeout) {
|
if input.IsSet(flagkey.FnExecutionTimeout) {
|
||||||
fnTimeout := input.Int(flagkey.FnExecutionTimeout)
|
fnTimeout := input.Int(flagkey.FnExecutionTimeout)
|
||||||
if fnTimeout <= 0 {
|
if fnTimeout <= 0 {
|
||||||
return errors.Errorf("--%v must be greater than 0", flagkey.FnExecutionTimeout)
|
return fmt.Errorf("--%v must be greater than 0", flagkey.FnExecutionTimeout)
|
||||||
}
|
}
|
||||||
function.Spec.FunctionTimeout = fnTimeout
|
function.Spec.FunctionTimeout = fnTimeout
|
||||||
}
|
}
|
||||||
@@ -146,7 +145,7 @@ func (opts *UpdateContainerSubCommand) complete(input cli.Input) error {
|
|||||||
function.Spec.Resources = *resReqs
|
function.Spec.Resources = *resReqs
|
||||||
|
|
||||||
if len(function.Spec.PodSpec.Containers) > 1 {
|
if len(function.Spec.PodSpec.Containers) > 1 {
|
||||||
return errors.Errorf("function %s has more than one container, only one container is supported", fnName)
|
return fmt.Errorf("function %s has more than one container, only one container is supported", fnName)
|
||||||
}
|
}
|
||||||
container := &function.Spec.PodSpec.Containers[0]
|
container := &function.Spec.PodSpec.Containers[0]
|
||||||
if imageName != "" {
|
if imageName != "" {
|
||||||
@@ -154,7 +153,7 @@ func (opts *UpdateContainerSubCommand) complete(input cli.Input) error {
|
|||||||
}
|
}
|
||||||
if port != 0 {
|
if port != 0 {
|
||||||
if len(container.Ports) > 1 {
|
if len(container.Ports) > 1 {
|
||||||
return errors.Errorf("function %s has more than one port, only one port is supported", fnName)
|
return fmt.Errorf("function %s has more than one port, only one port is supported", fnName)
|
||||||
}
|
}
|
||||||
container.Ports = []apiv1.ContainerPort{
|
container.Ports = []apiv1.ContainerPort{
|
||||||
{
|
{
|
||||||
@@ -186,7 +185,7 @@ func (opts *UpdateContainerSubCommand) complete(input cli.Input) error {
|
|||||||
func (opts *UpdateContainerSubCommand) run(input cli.Input) error {
|
func (opts *UpdateContainerSubCommand) run(input cli.Input) error {
|
||||||
_, err := opts.Client().FissionClientSet.CoreV1().Functions(opts.function.Namespace).Update(input.Context(), opts.function, metav1.UpdateOptions{})
|
_, err := opts.Client().FissionClientSet.CoreV1().Functions(opts.function.Namespace).Update(input.Context(), opts.function, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error updating function")
|
return fmt.Errorf("error updating function: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"errors"
|
||||||
|
|
||||||
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
userProvidedNS, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
userProvidedNS, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in deleting function ")
|
return fmt.Errorf("error in deleting function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerUrl := input.String(flagkey.HtUrl)
|
triggerUrl := input.String(flagkey.HtUrl)
|
||||||
@@ -125,7 +126,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
specIgnore := util.GetSpecIgnore(input)
|
specIgnore := util.GetSpecIgnore(input)
|
||||||
fr, err := spec.ReadSpecs(specDir, specIgnore, false)
|
fr, err := spec.ReadSpecs(specDir, specIgnore, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("error reading spec in '%v'", specDir))
|
return fmt.Errorf("error reading spec in '%v': %w", specDir, err)
|
||||||
}
|
}
|
||||||
for _, fn := range functionList {
|
for _, fn := range functionList {
|
||||||
exists, err := fr.ExistsInSpecs(fv1.Function{
|
exists, err := fr.ExistsInSpecs(fv1.Function{
|
||||||
@@ -167,7 +168,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
input.StringSlice(flagkey.HtIngressAnnotation), input.String(flagkey.HtIngressRule),
|
input.StringSlice(flagkey.HtIngressAnnotation), input.String(flagkey.HtIngressRule),
|
||||||
input.String(flagkey.HtIngressTLS), fallbackURL, nil)
|
input.String(flagkey.HtIngressTLS), fallbackURL, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error parsing ingress configuration")
|
return fmt.Errorf("error parsing ingress configuration: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
opts.trigger = &fv1.HTTPTrigger{
|
opts.trigger = &fv1.HTTPTrigger{
|
||||||
@@ -198,7 +199,7 @@ func (opts *CreateSubCommand) run(input cli.Input) error {
|
|||||||
specFile := fmt.Sprintf("route-%v.yaml", opts.trigger.ObjectMeta.Name)
|
specFile := fmt.Sprintf("route-%v.yaml", opts.trigger.ObjectMeta.Name)
|
||||||
err := spec.SpecSave(*opts.trigger, specFile, false)
|
err := spec.SpecSave(*opts.trigger, specFile, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error saving HTTP trigger spec")
|
return fmt.Errorf("error saving HTTP trigger spec: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -206,12 +207,12 @@ func (opts *CreateSubCommand) run(input cli.Input) error {
|
|||||||
// Ensure we don't have a duplicate HTTP route defined (same URL and method)
|
// Ensure we don't have a duplicate HTTP route defined (same URL and method)
|
||||||
err := util.CheckHTTPTriggerDuplicates(input.Context(), opts.Client(), opts.trigger)
|
err := util.CheckHTTPTriggerDuplicates(input.Context(), opts.Client(), opts.trigger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "Error while creating HTTP Trigger")
|
return fmt.Errorf("error while creating HTTP Trigger: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = opts.Client().FissionClientSet.CoreV1().HTTPTriggers(opts.trigger.Namespace).Create(input.Context(), opts.trigger, metav1.CreateOptions{})
|
_, err = opts.Client().FissionClientSet.CoreV1().HTTPTriggers(opts.trigger.Namespace).Create(input.Context(), opts.trigger, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "create HTTP trigger")
|
return fmt.Errorf("create HTTP trigger: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("trigger '%v' created\n", opts.trigger.ObjectMeta.Name)
|
fmt.Printf("trigger '%v' created\n", opts.trigger.ObjectMeta.Name)
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -53,14 +52,14 @@ func (opts *DeleteSubCommand) complete(input cli.Input) (err error) {
|
|||||||
opts.triggerName = input.String(flagkey.HtName)
|
opts.triggerName = input.String(flagkey.HtName)
|
||||||
opts.functionName = input.String(flagkey.HtFnName)
|
opts.functionName = input.String(flagkey.HtFnName)
|
||||||
if len(opts.triggerName) == 0 && len(opts.functionName) == 0 {
|
if len(opts.triggerName) == 0 && len(opts.functionName) == 0 {
|
||||||
return errors.Errorf("need --%v or --%v", flagkey.HtName, flagkey.HtFnName)
|
return fmt.Errorf("need --%v or --%v", flagkey.HtName, flagkey.HtFnName)
|
||||||
} else if len(opts.triggerName) > 0 && len(opts.functionName) > 0 {
|
} else if len(opts.triggerName) > 0 && len(opts.functionName) > 0 {
|
||||||
return errors.Errorf("need either of --%v or --%v and not both arguments", flagkey.HtName, flagkey.HtFnName)
|
return fmt.Errorf("need either of --%v or --%v and not both arguments", flagkey.HtName, flagkey.HtFnName)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, opts.namespace, err = opts.GetResourceNamespace(input, flagkey.NamespaceTrigger)
|
_, opts.namespace, err = opts.GetResourceNamespace(input, flagkey.NamespaceTrigger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in deleting function ")
|
return fmt.Errorf("error in deleting function : %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -68,7 +67,7 @@ func (opts *DeleteSubCommand) complete(input cli.Input) (err error) {
|
|||||||
func (opts *DeleteSubCommand) run(input cli.Input) error {
|
func (opts *DeleteSubCommand) run(input cli.Input) error {
|
||||||
triggers, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(opts.namespace).List(input.Context(), metav1.ListOptions{})
|
triggers, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(opts.namespace).List(input.Context(), metav1.ListOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting HTTP trigger list")
|
return fmt.Errorf("error getting HTTP trigger list: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var triggersToDelete []string
|
var triggersToDelete []string
|
||||||
@@ -99,7 +98,7 @@ func (opts *DeleteSubCommand) run(input cli.Input) error {
|
|||||||
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.Wrap(errs.ErrorOrNil(), "error deleting trigger(s)")
|
return fmt.Errorf("error deleting trigger(s): %w", errs.ErrorOrNil())
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -46,12 +45,12 @@ func (opts *GetSubCommand) do(input cli.Input) error {
|
|||||||
func (opts *GetSubCommand) run(input cli.Input) (err error) {
|
func (opts *GetSubCommand) run(input cli.Input) (err error) {
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in deleting function ")
|
return fmt.Errorf("error in deleting function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ht, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(namespace).Get(input.Context(), input.String(flagkey.HtName), metav1.GetOptions{})
|
ht, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(namespace).Get(input.Context(), input.String(flagkey.HtName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting http trigger")
|
return fmt.Errorf("error getting http trigger: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
printHtSummary([]fv1.HTTPTrigger{*ht})
|
printHtSummary([]fv1.HTTPTrigger{*ht})
|
||||||
@@ -95,7 +94,7 @@ func printHtSummary(triggers []fv1.HTTPTrigger) {
|
|||||||
methods = trigger.Spec.Methods
|
methods = trigger.Spec.Methods
|
||||||
}
|
}
|
||||||
fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n",
|
fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n",
|
||||||
trigger.ObjectMeta.Name, methods, trigger.Spec.RelativeURL, function, trigger.Spec.CreateIngress, host, path, trigger.Spec.IngressConfig.TLS, ann, trigger.ObjectMeta.Namespace)
|
trigger.Name, methods, trigger.Spec.RelativeURL, function, trigger.Spec.CreateIngress, host, path, trigger.Spec.IngressConfig.TLS, ann, trigger.ObjectMeta.Namespace)
|
||||||
}
|
}
|
||||||
w.Flush()
|
w.Flush()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ limitations under the License.
|
|||||||
package httptrigger
|
package httptrigger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"fmt"
|
||||||
|
|
||||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -42,7 +43,7 @@ func (opts *ListSubCommand) run(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceTrigger)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceTrigger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in deleting function ")
|
return fmt.Errorf("error in deleting function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.Bool(flagkey.AllNamespaces) {
|
if input.Bool(flagkey.AllNamespaces) {
|
||||||
@@ -51,7 +52,7 @@ func (opts *ListSubCommand) run(input cli.Input) (err error) {
|
|||||||
hts, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(namespace).List(input.Context(), v1.ListOptions{})
|
hts, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(namespace).List(input.Context(), v1.ListOptions{})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error listing HTTP triggers")
|
return fmt.Errorf("error listing HTTP triggers: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
filterFunctionName := input.String(flagkey.HtFnName)
|
filterFunctionName := input.String(flagkey.HtFnName)
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"errors"
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -54,12 +55,12 @@ func (opts *UpdateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
|
|
||||||
_, triggerNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceTrigger)
|
_, triggerNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceTrigger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in deleting function ")
|
return fmt.Errorf("error in deleting function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ht, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(triggerNamespace).Get(input.Context(), htName, metav1.GetOptions{})
|
ht, err := opts.Client().FissionClientSet.CoreV1().HTTPTriggers(triggerNamespace).Get(input.Context(), htName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error getting HTTP trigger")
|
return fmt.Errorf("error getting HTTP trigger: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerUrl := input.String(flagkey.HtUrl)
|
triggerUrl := input.String(flagkey.HtUrl)
|
||||||
@@ -113,7 +114,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
// set function reference
|
// set function reference
|
||||||
functionRef, err := setHtFunctionRef(functionList, functionWeightsList)
|
functionRef, err := setHtFunctionRef(functionList, functionWeightsList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error setting function weight")
|
return fmt.Errorf("error setting function weight: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ht.Spec.FunctionReference = *functionRef
|
ht.Spec.FunctionReference = *functionRef
|
||||||
@@ -138,7 +139,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) (err error) {
|
|||||||
input.StringSlice(flagkey.HtIngressAnnotation), input.String(flagkey.HtIngressRule),
|
input.StringSlice(flagkey.HtIngressAnnotation), input.String(flagkey.HtIngressRule),
|
||||||
input.String(flagkey.HtIngressTLS), fallbackURL, &ht.Spec.IngressConfig)
|
input.String(flagkey.HtIngressTLS), fallbackURL, &ht.Spec.IngressConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error parsing ingress configuration")
|
return fmt.Errorf("error parsing ingress configuration: %w", err)
|
||||||
}
|
}
|
||||||
ht.Spec.IngressConfig = *ingress
|
ht.Spec.IngressConfig = *ingress
|
||||||
}
|
}
|
||||||
@@ -157,18 +158,18 @@ func (opts *UpdateSubCommand) run(input cli.Input) error {
|
|||||||
specFile := fmt.Sprintf("route-%s.yaml", opts.trigger.ObjectMeta.Name)
|
specFile := fmt.Sprintf("route-%s.yaml", opts.trigger.ObjectMeta.Name)
|
||||||
err = spec.SpecSave(*opts.trigger, specFile, true)
|
err = spec.SpecSave(*opts.trigger, specFile, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error saving HTTP trigger spec")
|
return fmt.Errorf("error saving HTTP trigger spec: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
err := util.CheckHTTPTriggerDuplicates(input.Context(), opts.Client(), opts.trigger)
|
err := util.CheckHTTPTriggerDuplicates(input.Context(), opts.Client(), opts.trigger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "Error while creating HTTP Trigger")
|
return fmt.Errorf("error while creating HTTP Trigger: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = opts.Client().FissionClientSet.CoreV1().HTTPTriggers(opts.trigger.ObjectMeta.Namespace).Update(input.Context(), opts.trigger, metav1.UpdateOptions{})
|
_, err = opts.Client().FissionClientSet.CoreV1().HTTPTriggers(opts.trigger.ObjectMeta.Namespace).Update(input.Context(), opts.trigger, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error updating the HTTP trigger")
|
return fmt.Errorf("error updating the HTTP trigger: %w", err)
|
||||||
}
|
}
|
||||||
fmt.Printf("trigger '%v' updated\n", opts.trigger.ObjectMeta.Name)
|
fmt.Printf("trigger '%v' updated\n", opts.trigger.ObjectMeta.Name)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package kubewatch
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -59,7 +58,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
|
|
||||||
_, namespace, err := opts.GetResourceNamespace(input, flagkey.KwNamespace)
|
_, namespace, err := opts.GetResourceNamespace(input, flagkey.KwNamespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in listing function ")
|
return fmt.Errorf("error in listing function : %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
objType := input.String(flagkey.KwObjType)
|
objType := input.String(flagkey.KwObjType)
|
||||||
@@ -69,7 +68,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
|||||||
specIgnore := util.GetSpecIgnore(input)
|
specIgnore := util.GetSpecIgnore(input)
|
||||||
fr, err := spec.ReadSpecs(specDir, specIgnore, false)
|
fr, err := spec.ReadSpecs(specDir, specIgnore, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, fmt.Sprintf("error reading spec in '%v'", specDir))
|
return fmt.Errorf("error reading spec in '%v': %w", specDir, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
exists, err := fr.ExistsInSpecs(fv1.Function{
|
exists, err := fr.ExistsInSpecs(fv1.Function{
|
||||||
@@ -117,14 +116,14 @@ func (opts *CreateSubCommand) run(input cli.Input) error {
|
|||||||
specFile := fmt.Sprintf("kubewatch-%v.yaml", opts.watcher.ObjectMeta.Name)
|
specFile := fmt.Sprintf("kubewatch-%v.yaml", opts.watcher.ObjectMeta.Name)
|
||||||
err := spec.SpecSave(*opts.watcher, specFile, false)
|
err := spec.SpecSave(*opts.watcher, specFile, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error saving kubewatch spec")
|
return fmt.Errorf("error saving kubewatch spec: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := opts.Client().FissionClientSet.CoreV1().KubernetesWatchTriggers(opts.watcher.ObjectMeta.Namespace).Create(input.Context(), opts.watcher, metav1.CreateOptions{})
|
_, err := opts.Client().FissionClientSet.CoreV1().KubernetesWatchTriggers(opts.watcher.ObjectMeta.Namespace).Create(input.Context(), opts.watcher, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error creating kubewatch")
|
return fmt.Errorf("error creating kubewatch: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("trigger '%v' created\n", opts.watcher.ObjectMeta.Name)
|
fmt.Printf("trigger '%v' created\n", opts.watcher.ObjectMeta.Name)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package kubewatch
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
@@ -50,7 +49,7 @@ func (opts *DeleteSubCommand) complete(input cli.Input) (err error) {
|
|||||||
opts.name = input.String(flagkey.KwName)
|
opts.name = input.String(flagkey.KwName)
|
||||||
_, opts.namespace, err = opts.GetResourceNamespace(input, flagkey.NamespaceTrigger)
|
_, opts.namespace, err = opts.GetResourceNamespace(input, flagkey.NamespaceTrigger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "error in deleting kubewatch")
|
return fmt.Errorf("error in deleting kubewatch: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -61,7 +60,7 @@ func (opts *DeleteSubCommand) run(input cli.Input) error {
|
|||||||
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.Wrap(err, "error deleting kubewatch")
|
return fmt.Errorf("error deleting kubewatch: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("trigger '%v' deleted\n", opts.name)
|
fmt.Printf("trigger '%v' deleted\n", opts.name)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user