Compare commits

...
103 Commits
Author SHA1 Message Date
Sanket SudakeandGitHub 9f0bb6d11f Update chart version v1.21.0-rc1 (#3143)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2025-01-13 18:44:50 +05:30
a8157e94a9 PR-3051: Fix download deploy package out of k8s cluster (#3136)
* Fix download deploy package out of k8s cluster

Signed-off-by: LiuXiang <lx1036@126.com>

* Fix pkg getdeploy cli command to fetch pkgs stored in storagesvc and remote pkgs

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Instead of Contains, parse url and check path for better validation

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: LiuXiang <lx1036@126.com>
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Co-authored-by: LiuXiang <lx1036@126.com>
2025-01-13 12:55:50 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
cd23fc6f63 Bump the github-actions group with 4 updates (#3140)
Bumps the github-actions group with 4 updates: [step-security/harden-runner](https://github.com/step-security/harden-runner), [github/codeql-action](https://github.com/github/codeql-action), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action).


Updates `step-security/harden-runner` from 2.10.2 to 2.10.3
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](https://github.com/step-security/harden-runner/compare/0080882f6c36860b6ba35c610c98ce87d4e2f26f...c95a14d0e5bab51a9f56296a4eb0e416910cd350)

Updates `github/codeql-action` from 3.28.0 to 3.28.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/48ab28a6f5dbc2a99bf1e0131198dd8f1df78169...b6a472f63d85b9c78a3ac5e89422239fc15e9b3c)

Updates `actions/upload-artifact` from 4.5.0 to 4.6.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/6f51ac03b9356f520e9adb1b1b7802705f340c2b...65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08)

Updates `docker/setup-qemu-action` from 3.2.0 to 3.3.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/49b3bc8e6bdd4a60e6116a5414239cba5943d3cf...53851d14592bedcffcf25ea515637cff71ef929a)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 10:57:52 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
40678800e6 Bump the go-dependencies group with 4 updates (#3141)
Bumps the go-dependencies group with 4 updates: [github.com/IBM/sarama](https://github.com/IBM/sarama), [github.com/mholt/archives](https://github.com/mholt/archives), [golang.org/x/net](https://github.com/golang/net) and [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime).


Updates `github.com/IBM/sarama` from 1.44.0 to 1.45.0
- [Release notes](https://github.com/IBM/sarama/releases)
- [Changelog](https://github.com/IBM/sarama/blob/main/CHANGELOG.md)
- [Commits](https://github.com/IBM/sarama/compare/v1.44.0...v1.45.0)

Updates `github.com/mholt/archives` from 0.0.0-20241226194006-fc8400ac3529 to 0.1.0
- [Release notes](https://github.com/mholt/archives/releases)
- [Commits](https://github.com/mholt/archives/commits/v0.1.0)

Updates `golang.org/x/net` from 0.33.0 to 0.34.0
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.34.0)

Updates `sigs.k8s.io/controller-runtime` from 0.19.3 to 0.19.4
- [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.19.3...v0.19.4)

---
updated-dependencies:
- dependency-name: github.com/IBM/sarama
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: github.com/mholt/archives
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: sigs.k8s.io/controller-runtime
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 10:26:21 +05:30
Sanket SudakeandGitHub 6acb59f979 Update k8s versions and set minimum version to 1.27.0 (#3134)
* Update Kind Kuberntes versions
* Minimum k8s version to 1.27.0
* Pin ubuntu version in actions

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2025-01-08 12:49:54 +05:30
Sanket SudakeandGitHub 4bce904c96 Use mholt/archives instead of mholt/archiver (#3128)
* Use mholt/archives instead of mholt/archiver
* Fix validations
* Fix iszip function
* Fix directory
* Add better path sanitization
* ensure safe dir is passed
* Fix file permissions
* Fix config path
* Sanitize builder source path

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2025-01-08 11:00:54 +05:30
Sanket SudakeandGitHub 54b67b5171 Use controller-gen and code-generator latest version (#3133)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2025-01-06 23:27:26 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
96b07bf9a8 Bump the go-dependencies group with 3 updates (#3131)
Bumps the go-dependencies group with 3 updates: [github.com/go-git/go-git/v5](https://github.com/go-git/go-git), [sigs.k8s.io/controller-tools](https://github.com/kubernetes-sigs/controller-tools) and [sigs.k8s.io/structured-merge-diff/v4](https://github.com/kubernetes-sigs/structured-merge-diff).


Updates `github.com/go-git/go-git/v5` from 5.13.0 to 5.13.1
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](https://github.com/go-git/go-git/compare/v5.13.0...v5.13.1)

Updates `sigs.k8s.io/controller-tools` from 0.16.5 to 0.17.0
- [Release notes](https://github.com/kubernetes-sigs/controller-tools/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-tools/blob/main/envtest-releases.yaml)
- [Commits](https://github.com/kubernetes-sigs/controller-tools/compare/v0.16.5...v0.17.0)

Updates `sigs.k8s.io/structured-merge-diff/v4` from 4.4.2 to 4.5.0
- [Release notes](https://github.com/kubernetes-sigs/structured-merge-diff/releases)
- [Changelog](https://github.com/kubernetes-sigs/structured-merge-diff/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/structured-merge-diff/compare/v4.4.2...v4.5.0)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-git/v5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: sigs.k8s.io/controller-tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: sigs.k8s.io/structured-merge-diff/v4
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-06 15:51:26 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b156625997 Bump the docker-images group across 5 directories with 1 update (#3132)
Bumps the docker-images group with 1 update in the /cmd/builder directory: [chainguard/static](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /cmd/fetcher directory: [chainguard/static](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /cmd/fission-bundle directory: [chainguard/static](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /cmd/preupgradechecks directory: [chainguard/static](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /cmd/reporter directory: [chainguard/static](https://github.com/chainguard-images/images).


Updates `chainguard/static` from `f5fe67a` to `f96b5a6`
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `chainguard/static` from `f5fe67a` to `f96b5a6`
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `chainguard/static` from `f5fe67a` to `f96b5a6`
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `chainguard/static` from `f5fe67a` to `f96b5a6`
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `chainguard/static` from `f5fe67a` to `f96b5a6`
- [Commits](https://github.com/chainguard-images/images/commits)

---
updated-dependencies:
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-06 15:05:50 +05:30
sofsmsandGitHub 6cf15f6cec Update create.go to handle namespace isolation (#3130) 2025-01-03 23:28:02 +05:30
Dnowan MethyandGitHub 3f0e4f5e81 fix: fix slice init length (#3064)
Signed-off-by: occupyhabit <wangmengjiao@outlook.com>
2025-01-01 22:26:18 +05:30
LiuXiangandGitHub 1358aa2a81 Log only related configmap and secret (#3049)
Signed-off-by: LiuXiang <lx1036@126.com>
2025-01-01 22:13:36 +05:30
Simon EmmsandGitHub f0aaef203e fix: apply kubernetes resources to the webhook-server (#3084) 2024-12-30 14:59:56 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Sanket Sudake
77d24fc544 Bump the go-dependencies group across 1 directory with 25 updates (#3125)
* Bump the go-dependencies group across 1 directory with 25 updates

Bumps the go-dependencies group with 13 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [github.com/IBM/sarama](https://github.com/IBM/sarama) | `1.43.3` | `1.44.0` |
| [github.com/fatih/color](https://github.com/fatih/color) | `1.17.0` | `1.18.0` |
| [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) | `1.7.0` | `1.8.0` |
| [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) | `5.12.0` | `5.13.0` |
| [github.com/influxdata/influxdb](https://github.com/influxdata/influxdb) | `1.11.6` | `1.11.8` |
| [github.com/kedacore/keda/v2](https://github.com/kedacore/keda) | `2.15.1` | `2.16.1` |
| [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib) | `0.55.0` | `0.58.0` |
| [go.opentelemetry.io/contrib/propagators/autoprop](https://github.com/open-telemetry/opentelemetry-go-contrib) | `0.55.0` | `0.58.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace](https://github.com/open-telemetry/opentelemetry-go) | `1.32.0` | `1.33.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) | `1.32.0` | `1.33.0` |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.31.3` | `0.32.0` |
| [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver) | `0.31.3` | `0.32.0` |
| [k8s.io/metrics](https://github.com/kubernetes/metrics) | `0.31.3` | `0.32.0` |



Updates `github.com/IBM/sarama` from 1.43.3 to 1.44.0
- [Release notes](https://github.com/IBM/sarama/releases)
- [Changelog](https://github.com/IBM/sarama/blob/main/CHANGELOG.md)
- [Commits](https://github.com/IBM/sarama/compare/v1.43.3...v1.44.0)

Updates `github.com/fatih/color` from 1.17.0 to 1.18.0
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.17.0...v1.18.0)

Updates `github.com/fsnotify/fsnotify` from 1.7.0 to 1.8.0
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.7.0...v1.8.0)

Updates `github.com/go-git/go-git/v5` from 5.12.0 to 5.13.0
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](https://github.com/go-git/go-git/compare/v5.12.0...v5.13.0)

Updates `github.com/influxdata/influxdb` from 1.11.6 to 1.11.8
- [Release notes](https://github.com/influxdata/influxdb/releases)
- [Commits](https://github.com/influxdata/influxdb/compare/v1.11.6...v1.11.8)

Updates `github.com/kedacore/keda/v2` from 2.15.1 to 2.16.1
- [Release notes](https://github.com/kedacore/keda/releases)
- [Changelog](https://github.com/kedacore/keda/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kedacore/keda/compare/v2.15.1...v2.16.1)

Updates `github.com/prometheus/common` from 0.59.1 to 0.61.0
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.59.1...v0.61.0)

Updates `github.com/stretchr/testify` from 1.9.0 to 1.10.0
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0)

Updates `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` from 0.55.0 to 0.58.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.55.0...zpages/v0.58.0)

Updates `go.opentelemetry.io/contrib/propagators/autoprop` from 0.55.0 to 0.58.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.55.0...zpages/v0.58.0)

Updates `go.opentelemetry.io/otel` from 1.32.0 to 1.33.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.32.0...v1.33.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from 1.32.0 to 1.33.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.32.0...v1.33.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` from 1.32.0 to 1.33.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.32.0...v1.33.0)

Updates `go.opentelemetry.io/otel/sdk` from 1.32.0 to 1.33.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.32.0...v1.33.0)

Updates `go.opentelemetry.io/otel/trace` from 1.32.0 to 1.33.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.32.0...v1.33.0)

Updates `golang.org/x/net` from 0.30.0 to 0.33.0
- [Commits](https://github.com/golang/net/compare/v0.30.0...v0.33.0)

Updates `google.golang.org/grpc` from 1.67.1 to 1.69.2
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.67.1...v1.69.2)

Updates `k8s.io/api` from 0.31.3 to 0.32.0
- [Commits](https://github.com/kubernetes/api/compare/v0.31.3...v0.32.0)

Updates `k8s.io/apiextensions-apiserver` from 0.31.3 to 0.32.0
- [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases)
- [Commits](https://github.com/kubernetes/apiextensions-apiserver/compare/v0.31.3...v0.32.0)

Updates `k8s.io/apimachinery` from 0.31.3 to 0.32.0
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.31.3...v0.32.0)

Updates `k8s.io/client-go` from 0.31.3 to 0.32.0
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.31.3...v0.32.0)

Updates `k8s.io/code-generator` from 0.31.3 to 0.32.0
- [Commits](https://github.com/kubernetes/code-generator/compare/v0.31.3...v0.32.0)

Updates `k8s.io/metrics` from 0.31.3 to 0.32.0
- [Commits](https://github.com/kubernetes/metrics/compare/v0.31.3...v0.32.0)

Updates `sigs.k8s.io/controller-tools` from 0.16.3 to 0.16.5
- [Release notes](https://github.com/kubernetes-sigs/controller-tools/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-tools/blob/main/envtest-releases.yaml)
- [Commits](https://github.com/kubernetes-sigs/controller-tools/compare/v0.16.3...v0.16.5)

Updates `sigs.k8s.io/structured-merge-diff/v4` from 4.4.1 to 4.4.2
- [Release notes](https://github.com/kubernetes-sigs/structured-merge-diff/releases)
- [Changelog](https://github.com/kubernetes-sigs/structured-merge-diff/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/structured-merge-diff/compare/v4.4.1...v4.4.2)

---
updated-dependencies:
- dependency-name: github.com/IBM/sarama
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: github.com/fatih/color
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: github.com/fsnotify/fsnotify
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: github.com/go-git/go-git/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: github.com/influxdata/influxdb
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: github.com/kedacore/keda/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: go.opentelemetry.io/contrib/propagators/autoprop
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: go.opentelemetry.io/otel
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: go.opentelemetry.io/otel/sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: go.opentelemetry.io/otel/trace
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: k8s.io/apiextensions-apiserver
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: k8s.io/code-generator
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: k8s.io/metrics
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-dependencies
- dependency-name: sigs.k8s.io/controller-tools
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
- dependency-name: sigs.k8s.io/structured-merge-diff/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* Lint fixes

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* Few more lint fixes

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2024-12-30 14:49:14 +05:30
Sanket SudakeandGitHub a083ba3de5 Update Go version to 1.23.4 (#3126)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-12-30 11:21:21 +05:30
Sanket SudakeandGitHub 6a50eac9eb Fix SBOM and provenance for releases (#3124)
* Provenance generation fixes
* try sbom flags
* remove unwanted changes
* add container sbom support
* Fix more labels
* Fix env variable
* revert local changes

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-12-30 09:21:01 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
b954eedff7 Bump helm/kind-action from 1.11.0 to 1.12.0 in the github-actions group (#3122)
Bumps the github-actions group with 1 update: [helm/kind-action](https://github.com/helm/kind-action).


Updates `helm/kind-action` from 1.11.0 to 1.12.0
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](https://github.com/helm/kind-action/compare/ae94020eaf628e9b9b9f341a10cc0cdcf5c018fb...a1b0e391336a6ee6713a0583f8c6240d70863de3)

---
updated-dependencies:
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-26 12:59:35 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
0247627494 Bump the docker-images group across 5 directories with 1 update (#3121)
Bumps the docker-images group with 1 update in the /cmd/builder directory: [chainguard/static](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /cmd/fetcher directory: [chainguard/static](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /cmd/fission-bundle directory: [chainguard/static](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /cmd/preupgradechecks directory: [chainguard/static](https://github.com/chainguard-images/images).
Bumps the docker-images group with 1 update in the /cmd/reporter directory: [chainguard/static](https://github.com/chainguard-images/images).


Updates `chainguard/static` from `5ff428f` to `f5fe67a`
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `chainguard/static` from `5ff428f` to `f5fe67a`
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `chainguard/static` from `5ff428f` to `f5fe67a`
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `chainguard/static` from `5ff428f` to `f5fe67a`
- [Commits](https://github.com/chainguard-images/images/commits)

Updates `chainguard/static` from `5ff428f` to `f5fe67a`
- [Commits](https://github.com/chainguard-images/images/commits)

---
updated-dependencies:
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
- dependency-name: chainguard/static
  dependency-type: direct:production
  dependency-group: docker-images
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-26 12:53:48 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
158c40a7af Bump golang.org/x/crypto from 0.28.0 to 0.31.0 in the go_modules group (#3110)
Bumps the go_modules group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).


Updates `golang.org/x/crypto` from 0.28.0 to 0.31.0
- [Commits](https://github.com/golang/crypto/compare/v0.28.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-26 12:06:59 +05:30
Sanket SudakeandGitHub 699011e18e Update dependabot.yml grouping (#3119) 2024-12-26 12:03:49 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
e7dc87843a Bump Github Actions versions (#3118)
Bumps the global group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.1.1` | `4.2.2` |
| [actions/setup-go](https://github.com/actions/setup-go) | `5.1.0` | `5.2.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.26.9` | `3.28.0` |
| [codecov/codecov-action](https://github.com/codecov/codecov-action) | `5.1.1` | `5.1.2` |
| [helm/kind-action](https://github.com/helm/kind-action) | `1.10.0` | `1.11.0` |
| [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) | `6.0.0` | `6.1.0` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.4.3` | `4.5.0` |
| [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.17.8` | `0.17.9` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.3.1` | `2.4.0` |


Updates `actions/checkout` from 4.1.1 to 4.2.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.1...11bd71901bbe5b1630ceea73d27597364c9af683)

Updates `actions/setup-go` from 5.1.0 to 5.2.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed...3041bf56c941b39c61721a86cd11f3bb1338122a)

Updates `github/codeql-action` from 3.26.9 to 3.28.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.9...48ab28a6f5dbc2a99bf1e0131198dd8f1df78169)

Updates `codecov/codecov-action` from 5.1.1 to 5.1.2
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/7f8b4b4bde536c465e797be725718b88c5d95e0e...1e68e06f1dbfde0e4cefc87efeba9e4643565303)

Updates `helm/kind-action` from 1.10.0 to 1.11.0
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](https://github.com/helm/kind-action/compare/0025e74a8c7512023d06dc019c617aa3cf561fde...ae94020eaf628e9b9b9f341a10cc0cdcf5c018fb)

Updates `goreleaser/goreleaser-action` from 6.0.0 to 6.1.0
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](https://github.com/goreleaser/goreleaser-action/compare/286f3b13b1b49da4ac219696163fb8c1c93e1200...9ed2f89a662bf1735a48bc8557fd212fa902bebf)

Updates `actions/upload-artifact` from 4.4.3 to 4.5.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882...6f51ac03b9356f520e9adb1b1b7802705f340c2b)

Updates `anchore/sbom-action` from 0.17.8 to 0.17.9
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md)
- [Commits](https://github.com/anchore/sbom-action/compare/v0.17.8...v0.17.9)

Updates `ossf/scorecard-action` from 2.3.1 to 2.4.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/0864cf19026789058feabb7e87baa5f140aac736...62b2cac7ed8198b15735ed49ab1e5cf35480ba46)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: global
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: global
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: global
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: global
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: global
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: global
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: global
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: global
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: global
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-23 17:21:14 +05:30
Sanket SudakeandGitHub e67c3b7945 Grouped dependabot updates for dockerfile and github-actions (#3111)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-12-23 10:22:04 +05:30
Sanket SudakeandGitHub 36ed2e44aa Update dependabot.yml (#3094) 2024-12-09 11:54:23 +05:30
Sanket SudakeandGitHub 38779b9318 Add provenance steps for release (#3083)
* Add provenance steps for release
* Update release workflow
* Fix branch filters
* Cleanup release code
* Fix attestation steps
* Add SBOM and disable image provenance
* Disable image provenance
* fix sbom install
* Add sboms to goreleaser
* Update SLSA version to v2.0.0

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-12-09 00:41:24 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7058130c3b Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (#3077)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.4 to 1.20.5.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.4...v1.20.5)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-08 13:51:32 +05:30
Sanket SudakeandGitHub 9644477d08 Update Go dependencies (#3081)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-12-08 12:59:56 +05:30
Sanket SudakeandGitHub 87cac28cad Skip CI for dependabot PR and remove manual dispatch (#3080)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-12-08 12:06:17 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
238cfd854b Bump golangci/golangci-lint-action from 6.1.0 to 6.1.1 (#3070)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/aaa42aa0628b4ae2578232a66b541047968fac86...971e284b6050e8a5849b72094c50ab08da042db8)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-08 11:21:01 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
f7cc0ac32d Bump codecov/codecov-action from 4.5.0 to 5.1.1 (#3071)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.5.0 to 5.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/e28ff129e5465c2c0dcc6f003fc735cb6ae0c673...7f8b4b4bde536c465e797be725718b88c5d95e0e)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-08 11:20:38 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d8108c6742 Bump sigstore/cosign-installer from 3.6.0 to 3.7.0 (#3072)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/4959ce089c160fddf62f7b42464195ba1a56d382...dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-08 11:20:11 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
d5eafded1a Bump actions/upload-artifact from 4.4.0 to 4.4.3 (#3073)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.0 to 4.4.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.4.0...b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-08 11:19:46 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
48e8acedfb Bump actions/setup-go from 5.0.2 to 5.1.0 (#3074)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.2 to 5.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32...41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-08 11:19:16 +05:30
11a2fdbdab Apply best security practices for OpenSSF (#3069)
* [StepSecurity] Apply security best practices
* Keep needed check in precommit

---------

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: StepSecurity Bot <bot@stepsecurity.io>
2024-12-08 11:07:14 +05:30
Sanket SudakeandGitHub 0aa1a12cdc Add OpenSSF scorecard badge (#3067)
* Add OpenSSF scorecard badge
* Run CodeQL on all commits

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-12-08 09:30:53 +05:30
Sanket SudakeandGitHub f37c5ee102 Add OpenSSF Scorecard action (#3066) 2024-12-08 09:01:44 +05:30
Sanket SudakeandGitHub 59267e3a6b Add path safety fixes (#3061)
* Add path safety fixes

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* minor changes

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* revert test_huge_response test

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-11-18 12:19:34 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
82c0fbaeda Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (#3056)
Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 11:06:42 +05:30
soharab-icandGitHub 2d70c9d65f Remove unreachable code from fission-cli (#3039)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-10-11 13:01:36 +05:30
soharab-icandGitHub c43f6fe9c0 Update K8s version for envtest to 1.30.x (#3038)
* Update K8s version for envtest to 1.30.x
* Minor change to trigger tests

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-10-10 11:47:36 +05:30
soharab-icandGitHub 36f318186b Add podSpec to generated environment manifest (#3033)
* Use builder and container names when creating environment K8s object instead of keeping it empty.
Add skeleton for podSpec field to give user an idea of how to use podSpec field.
* Add a positive test for env podSpec
* Add the test to CI tests
* Remove duplicate wait_for_builder function
* Fix CI tests failure
* Fix CI tests failure
* Add a negative test for env podSpec
* Fix issues with negative test
* Removing negative test as it may break executor which will affect other tests
* Rebase with main as executor issue is fixed.
Add the negative test.
* Fix negative test


---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-10-09 11:11:19 +05:30
soharab-icandGitHub fe7f1b07c9 Fix cleanup in executortype poolmgr on invalid manifest (#3034)
The bug breaks the poolmgr service which stops the deletion and creation of new environments.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-10-08 19:10:08 +05:30
soharab-icandGitHub 352090d092 Updated app version and chart version to v1.20.5 (#3032)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-10-04 13:03:02 +05:30
soharab-icandGitHub db2b0ad4a0 Use os.RemoveAll to ignore path does not exist error (#3031)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-10-01 22:27:41 +05:30
soharab-icandGitHub 4b76ec9057 Update Keda-connectors version and go packages (#3029)
* Update keda-connectors version
* Update github actions
* Fix github workflow lint issues
* Updated following go packages
```
* dario.cat/mergo: v1.0.0 -> v1.0.1
* github.com/IBM/sarama: v1.43.2 -> v1.43.3
* github.com/influxdata/influxdb: v1.11.5 -> v1.11.6
* github.com/prometheus/client_golang: v1.19.1 -> v1.20.4
* github.com/prometheus/common: v0.55.0 -> v0.59.1
* go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.53.0 -> v0.55.0
* go.opentelemetry.io/contrib/propagators/autoprop: v0.51.0 -> v0.55.0
* go.opentelemetry.io/otel: v1.28.0 -> v1.30.0
* go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.28.0 -> v1.30.0
* go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.27.0 -> v1.30.0
* go.opentelemetry.io/otel/sdk: v1.28.0 -> v1.30.0
* go.opentelemetry.io/otel/trace: v1.28.0 -> v1.30.0
* golang.org/x/net: v0.28.0 -> v0.29.0
* google.golang.org/grpc: v1.65.0 -> v1.67.1
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* The `set-output` command is deprecated.
Fix typos in release workflow.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-10-01 14:12:51 +05:30
Sanket SudakeandGitHub 15857b02d9 Use typed rate limiting queue (#3028)
* Use typed rate limiting queue
* update skaffold version
* Update code-generator to 1.31

---------

Signed-off-by: Sanket <sanketsudake@gmail.com>
2024-10-01 12:05:55 +05:30
soharab-icandGitHub 9bdac9a334 Upgraded to Go latest version 1.23.1 (#3027)
* Upgraded to latest go version 1.23.1
* Fix lint failure
* Fix lint failures
* Remove unnecessary formatting

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-09-30 19:33:10 +05:30
soharab-icandGitHub 2f8ad16639 Warning: Deprecation warning for cross namespace parameters (#3026)
* Deprecation warning for cross namespace parameters `builderNamespace`, `functionNamespace`
and `disableOwnerReference` flag.
* Do not mention the version

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-09-30 16:42:19 +05:30
Sanket SudakeandGitHub 687a84a2d6 Update codeql action version to 3.26.9 (#3025)
* Update codeql action version to 3.26.9

* Update checkout and setup-go version
2024-09-30 11:25:45 +05:30
cui fliterandGitHub 2db9db0b38 Fix slice init length (#3018)
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-09-30 10:13:12 +05:30
soharab-icandGitHub 2bf00025ed Fixed: Allow to disable owner references for cross namespace access with builder and function namespace (#3024)
* Add DISABLE_OWNER_REFERENCES env variable to executor and buildermgr deployment.
Use this env var to decide adding ownerReferences to K8s resources created by fission CRD.
* Resolve review comments
* Fix lint failure

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-09-27 15:11:07 +05:30
waitstoryandGitHub b8f746cb98 Fixed: Print pod log error when response status is 404 returned by te… (#3021)
* Fixed: Print pod log error when response status is 404 returned by test function
* Update util.go

---------

Signed-off-by: waitstory <waitstory@163.com>
2024-09-26 13:21:50 +05:30
soharab-icandGitHub 93869d3bc8 Add method and subpath flags to timetrigger object for triggering a function (#3017)
* Update timetrigger crd and add method and subpath fields in spec.
Update fission-cli to accept user input for method and subpath fields.
Update publisher package to utilize these fields for triggering a function.
Update timer controller to use method and subpath fields for publishing a request.
Add a new test TestPublisherSubpath in pulisher package.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Use kubebuilder default annotation.
Update test for fission-cli timetrigger create, update command to support method and subpath flags.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-09-16 17:15:54 +05:30
5d580e01aa Fix the error printing in error handling (#3013)
* 去除environment创建操作中的注释及更新过程中存在的冗余代码

* Remove redundant code and simplify input parsing during HTTPTrigger creation

* Fix error handling in package update logic implementation

* Fix the error printing in error handling

---------

Co-authored-by: yufu huang <yufu.huang@gientech.com>
2024-09-13 10:43:41 +05:30
1f41de9991 Fix error handling in package update logic implementation (#3012)
* 去除environment创建操作中的注释及更新过程中存在的冗余代码

* Remove redundant code and simplify input parsing during HTTPTrigger creation

* Fix error handling in package update logic implementation

---------

Co-authored-by: yufu huang <yufu.huang@gientech.com>
2024-09-11 13:38:31 +05:30
waitstoryandGitHub 5cdecefc49 The function is updated without an "envNamespace" argument, so we need to remove that logic (#3010)
Signed-off-by: waitstory <waitstory@163.com>
2024-09-11 13:37:09 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
21bccdaecf Bump github.com/opencontainers/runc from 1.1.12 to 1.1.14 (#3008)
Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.12 to 1.1.14.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/opencontainers/runc/compare/v1.1.12...v1.1.14)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 08:33:35 +05:30
soharab-icandGitHub cf55fbecea Update chart version and app version to v1.20.4 (#3006)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-09-02 12:14:23 +05:30
b80437b78c Configure user ID for logger container's securityContext using helm values.yaml (#3005)
* Run logger as root to allow access to log files from host

* Add to connect part of yaml

* Change fission folder to allow non-root to write
into folder instead

* Configure user ID for logger from helm values.yaml

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
Co-authored-by: Mark Retallack <mark.retallack@yunextraffic.com>
2024-09-02 11:06:55 +05:30
waitstoryandGitHub 11baffc92c Fixed time unit loss problem after converting time (#3004)
The time unit of 'function.Spec.FunctionTimeout' is second, but after conversion from the function time.Duration, the unit becomes nanosecond. So it needs to be repaired.

Signed-off-by: waitstory <waitstory@163.com>
2024-08-30 16:54:41 +05:30
markretallackandGitHub ce49eb3e18 Add resource namespace to logger (#2999)
* Add fission resource namespace to logger pod

* Corrected indent

* Fix formating
2024-08-30 16:53:57 +05:30
soharab-icandGitHub bf19e2fae2 Use in-cluster config when kubeconfig file is not found (#2996)
* Use in-cluster config if KUBECONFIG env is not set.
Or when kubeconfig file is not found in user's home directory.
* Fixed e2e cli tests failure
* Resolve review comments
* Join kubeconfig not found and failed to load in-cluster config errors


---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-08-24 09:01:27 +05:30
soharab-icandGitHub 26f964886e Fix: Message queue trigger update (#2991)
* Handle mqt update
* Update scalemanager to support mqtkind update
* Short circuit evalution may fail metadata update
* Updated mqtmanager test

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-08-16 11:33:36 +05:30
soharab-icandGitHub cb3a765495 Fix storagesvc url in archive (#2982)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-08-14 18:02:05 +05:30
7203cbf846 Remove redundant code and simplify input parsing during HTTPTrigger creation (#2990)
* 去除environment创建操作中的注释及更新过程中存在的冗余代码

* Remove redundant code and simplify input parsing during HTTPTrigger creation

---------

Co-authored-by: yufu huang <yufu.huang@gientech.com>
2024-08-14 18:00:22 +05:30
soharab-icandGitHub 0b9d4c6f5a Use typed client from Keda instead of unstructured (#2989)
* Use typed client for Keda
* Downgraded apimachinery version to v0.30.0 because of compilation error
* Upgrade golanggci-lint version to v1.57.0
* Skip cache for golanggci-lint-action
* grpc.WithBlock is deprecated

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-08-14 16:52:31 +05:30
c6beb29f5a Code cleanup from Fission CLI (#2983)
Co-authored-by: yufu huang <yufu.huang@gientech.com>
2024-08-12 19:11:56 +05:30
soharab-icandGitHub 13abb2e905 Creating large number of MQTs takes time (#2984)
* Implementing workqueue for MessageQueueTriggers
* Fixing some issues with informers and deleteQueue
* Fixing fission_mqt_created metrics
* Rebase with main

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-08-12 18:00:41 +05:30
soharab-icandGitHub 54db275dc2 Removed armv7 references from goreleaser file (#2988)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-08-12 12:08:49 +05:30
soharab-icandGitHub 0159802497 Update chart version to v1.20.3 (#2987)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-08-09 13:38:40 +05:30
soharab-icandGitHub 90d781ca2d Fixed mqtrigger scaling issue (#2986)
* Fixed mqtrigger scaling issue

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Resolve review comments

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Set goreleaser version to v1
Remove armv7 references from goreleaser file

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-08-09 11:58:44 +05:30
Boluwatife VictorandGitHub 1732d9f4b0 Update README.md (#2738)
I added more context to the introduction section
2024-07-20 10:36:16 +05:30
soharab-icandGitHub 8de5a5b0f3 Fix: Storage leak in Builder and Fetcher (#2979)
* Fix storage leak in builder
```
builder pod keeps old src and deployment packages irrespective of build status.
delete src package after every build request is completed.
delete deployment package after package is uploaded.
```
* Optimized src/deploy cleanup pkg code
* Fix high severity security issue
* Add a test for builder's Clean API
* Resolve review comments

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-07-15 18:28:42 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
35276a503b Bump golang.org/x/image from 0.10.0 to 0.18.0 (#2972)
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.10.0 to 0.18.0.
- [Commits](https://github.com/golang/image/compare/v0.10.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-13 19:23:12 +05:30
soharab-icandGitHub c6c811ea76 Show warning that --yolo, --concurrency and --rpp fields are valid for executortype poolmgr only (#2971)
* yolo, concurrency and rpp are specifically introduced for executortype poolmgr
```
Show warning if these fields are used with other executortype.
Update CLI with this information.
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Add warning for fn update too

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Show warning while updating `--yolo`, `--con` and `--rpp` to an already created newdeploy function.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Fixed a minor bug

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Optmize and increase code readability

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Rename function to checkExecutorPoolManager

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-07-08 12:04:43 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
f2baa17131 Bump github.com/hashicorp/go-retryablehttp from 0.7.5 to 0.7.7 (#2970)
Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.5 to 0.7.7.
- [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.5...v0.7.7)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-retryablehttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 12:26:51 +05:30
soharab-icandGitHub a34840b0a7 Set OwnerReferences to K8s resources created by Fission (#2964)
* Poolmanager deployment is created based on environment.
Set environment as owner to poolmanager deployment.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Set OwnerReferences to K8s resources created by fission resources.
```
Set OwnerReferences to deployment, service and HPA created by newdeploy function.
Set OwnerReferences to builderManager deployment and service created by environment.
Set OwnerReferences to deployment, service and HPA created by container function.
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Use ControllerRef

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-06-25 12:25:12 +05:30
soharab-icandGitHub 06b52e3631 Update keda connectors image tag (#2963) 2024-06-21 15:13:02 +05:30
jaynisandGitHub 19858521fd added http status code error handling to DownloadUrl function (#2959)
Signed-off-by: jaynis <kranz.jannis@googlemail.com>
2024-06-20 18:43:46 +05:30
soharab-icandGitHub 4c4b574d07 Fix fission-cli cmd pkg getdeploy (#2960)
```
If deployment archive is empty then command will return source archive.
Deployment can be empty if pkg build failed or in running state.
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-06-20 18:36:35 +05:30
waitstoryandGitHub 9b978cf2fd Fixed an error when using the command to download src (#2940)
* Fixed an error when using the command to download src

issue: #2938

Signed-off-by: waitstory <waitstory@163.com>

* Fixed an error when using the command to download src

issue: #2938

Signed-off-by: waitstory <waitstory@163.com>

---------

Signed-off-by: waitstory <waitstory@163.com>
2024-06-10 10:00:31 +05:30
pengpengfuandGitHub ef05e242e4 fetcher when call uploadHandler ,archive zip, Use newZip instead of the default DefaultZip to improve the fetcher to accept more upload requests. (#2955) 2024-06-10 09:01:26 +05:30
soharab-icandGitHub 156c1ac2e6 Pin goreleaser version to v1 in github actions (#2956)
```
Latest goreleaser version v2 has some breaking changes.
Due to this CI tests failed.
Therefore, setting goreleaser version to v1.
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-06-06 19:49:04 +05:30
soharab-icandGitHub ade2daa013 Make image description template variables less from goreleaser configuration (#2954)
```
Remove variables field from .goreleaser.yml
```

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-06-03 19:32:11 +05:30
soharab-icandGitHub 6a84cee1d8 Add description label to docker images (#2952)
* Add description label to docker images
* Update descriptions

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-29 14:26:29 +05:30
soharab-icandGitHub b95e317a20 fix: Router failed to create ingress resource in fission namespace (#2951)
* Router failed to create ingress resource in `fission` namespace
```
fission-router has access to create ingress in default namespace.
fission is creating ingress in namespace where fission is installed.
updated the helm chart to give fission-router access to create ingress in release namespace.
```
* Add a todo comment for modifying router's permissions


---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-28 19:47:44 +05:30
soharab-icandGitHub 0cfe08df55 Update chart version and app version to v1.20.2 (#2950)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-27 15:51:19 +05:30
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
4e0643eed7 Bump github.com/opencontainers/runc from 1.1.5 to 1.1.12 (#2912)
Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.5 to 1.1.12.
- [Release notes](https://github.com/opencontainers/runc/releases)
- [Changelog](https://github.com/opencontainers/runc/blob/v1.1.12/CHANGELOG.md)
- [Commits](https://github.com/opencontainers/runc/compare/v1.1.5...v1.1.12)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 12:58:58 +05:30
soharab-icandGitHub 103c7d57e4 Upgrade libs and go version (#2949)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-27 12:51:54 +05:30
Robbie CroninandGitHub c6d01827b0 Fix: MutatingWebhookConfiguration naming conflict (#2948) 2024-05-27 11:53:53 +05:30
Robbie CroninandGitHub d8fe37e736 Fix: ValidatingWebhookConfiguration conflict (#2947) 2024-05-27 11:24:51 +05:30
soharab-icandGitHub c126298db4 Revert "Remove deprecated mqtrigger with kind fission (#2875)" (#2946)
* Revert "Remove deprecated mqtrigger with kind fission (#2875)"

This reverts commit f44174debc.

* Upgrade sarama version to v1.43.2

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-27 10:21:51 +05:30
soharab-icandGitHub f7e9e71ee1 Set latest envVersion 3 as default (#2945)
Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-22 14:06:36 +05:30
eveneastandGitHub 3e43c07e5a Fix code comments function names (#2927)
Signed-off-by: eveneast <qcqs@foxmail.com>
2024-05-20 19:22:22 +05:30
robbellMFandGitHub 932be4eb38 Fix fission spec apply --delete deleting environments (#2943) 2024-05-17 22:22:50 +05:30
soharab-icandGitHub 8bfe2d0ed1 Fix CLI pkg getsrc returns deploy archive instead of source archive (#2941)
* CLI command `pkg getsrc` returns deploy archive

```
Fix CLI command to return source archive instead of deploy archive.
If source archive is not available then return deploy archive.
```

* Add e2e tests for `fission package` CLI commands
* Cleanup environments created for pkg test
* Fix unit test failures


---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-16 18:29:58 +05:30
soharab-icandGitHub 9cea0d2b32 Upgrade kind version to v0.23.0 (#2937)
* Upgrade kind version to v0.23.0
```
Upgraded kind version to github workflow push_pr.yaml
Upgraded kind version to github workflow release.yaml
Upgraded kind version to github workflow upgrade_test.yaml
```
* Minor change to trigger CI
* Upgrade kind node image to v1.25.16

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-15 13:21:46 +05:30
soharab-icandGitHub 5337dbfd0b Update Go packages (#2933)
* Update Go packages

```
github.com/elastic/crd-ref-docs: v0.0.10 -> v0.0.12
github.com/go-git/go-git/v5: v5.11.0 -> v5.12.0
github.com/prometheus/client_golang: v1.18.0 -> v1.19.0
github.com/prometheus/common: v0.46.0 -> v0.53.0
github.com/stretchr/testify: v1.8.4 -> v1.9.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.48.0 -> v0.51.0
go.opentelemetry.io/contrib/propagators/autoprop: v0.48.0 -> v0.51.0
go.opentelemetry.io/otel: v1.23.1 -> v1.26.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.23.1 -> v1.26.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.23.1 -> v1.26.0
go.opentelemetry.io/otel/sdk: v1.23.1 -> v1.26.0
go.opentelemetry.io/otel/trace: v1.23.1 -> v1.26.0
go.uber.org/zap: v1.26.0 -> v1.27.0
golang.org/x/net: v0.21.0 -> v0.25.0
google.golang.org/grpc: v1.61.1 -> v1.63.2
k8s.io/api: v0.29.2 -> v0.30.0
k8s.io/apiextensions-apiserver: v0.29.2 -> v0.30.0
k8s.io/apimachinery: v0.29.2 -> v0.30.0
k8s.io/client-go: v0.29.2 -> v0.30.0
k8s.io/code-generator: v0.29.2 -> v0.30.0
k8s.io/metrics: v0.29.2 -> v0.30.0
sigs.k8s.io/controller-runtime: v0.17.1 -> v0.18.2
sigs.k8s.io/controller-tools: v0.14.0 -> v0.15.0
```
* update Makefile and update-codegen.sh with latest packages
* Run `make all-generators`

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-08 11:03:00 +05:30
guangwuandGitHub 08c662bc11 fix: close tmp file (#2931) 2024-05-07 12:51:43 +05:30
soharab-icandGitHub 241983d2f7 Fix fission check command doesnt work for namespace other than fission (#2932)
* Fix `fission check` command which does not work outside of `fission` namespace

If user provide namespace then use it for running `fission check` command.
If user does not provide namespace then use `fission` as default namespace.

* Update go version to 1.22.2

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
2024-05-07 11:18:22 +05:30
Sanket SudakeandGitHub 63864a91f2 Update Go to 1.22 and dependencies (#2915)
Go depenencies updated
```
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.47.0 -> v0.48.0
go.opentelemetry.io/contrib/propagators/autoprop: v0.47.0 -> v0.48.0
go.opentelemetry.io/otel: v1.22.0 -> v1.23.1
go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.22.0 -> v1.23.1
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.22.0 -> v1.23.1
go.opentelemetry.io/otel/sdk: v1.22.0 -> v1.23.1
go.opentelemetry.io/otel/trace: v1.22.0 -> v1.23.1
golang.org/x/net: v0.20.0 -> v0.21.0
google.golang.org/grpc: v1.61.0 -> v1.61.1
k8s.io/api: v0.29.1 -> v0.29.2
k8s.io/apiextensions-apiserver: v0.29.1 -> v0.29.2
k8s.io/apimachinery: v0.29.1 -> v0.29.2
k8s.io/client-go: v0.29.1 -> v0.29.2
k8s.io/code-generator: v0.29.1 -> v0.29.2
k8s.io/metrics: v0.29.1 -> v0.29.2
sigs.k8s.io/controller-runtime: v0.17.0 -> v0.17.1
```

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-02-15 20:39:03 +05:30
Sanket SudakeandGitHub 579d46cc1b Use code-generator v1.29.1 for code-generation (#2908)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2024-02-06 14:00:16 +05:30
Sanket SudakeandGitHub dcecb10e6c Update Go deps (#2907)
github.com/google/uuid: v1.5.0 -> v1.6.0
github.com/prometheus/common: v0.45.0 -> v0.46.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.46.1 -> v0.47.0
go.opentelemetry.io/contrib/propagators/autoprop: v0.46.1 -> v0.47.0
go.opentelemetry.io/otel: v1.21.0 -> v1.22.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.21.0 -> v1.22.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.21.0 -> v1.22.0
go.opentelemetry.io/otel/sdk: v1.21.0 -> v1.22.0
go.opentelemetry.io/otel/trace: v1.21.0 -> v1.22.0
google.golang.org/grpc: v1.60.1 -> v1.61.0
k8s.io/api: v0.29.0 -> v0.29.1
k8s.io/apiextensions-apiserver: v0.29.0 -> v0.29.1
k8s.io/apimachinery: v0.29.0 -> v0.29.1
k8s.io/client-go: v0.29.0 -> v0.29.1
k8s.io/metrics: v0.29.0 -> v0.29.1
sigs.k8s.io/controller-runtime: v0.16.3 -> v0.17.0

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

Some files were not shown because too many files have changed in this diff Show More