Compare commits

..
8 Commits
Author SHA1 Message Date
Shubham BansalandGitHub deb3523b59 update chart version to 1.18.0 (#2687) 2023-01-12 23:35:51 +05:30
Nikhil SharmaandGitHub 0635a6a644 remove .* suffix after Dockerfile (#2685)
Signed-off-by: Nikhl Sharma <nikhilsharma230303@gmail.com>

Signed-off-by: Nikhl Sharma <nikhilsharma230303@gmail.com>
2023-01-11 14:04:56 +05:30
Nikhil SharmaandGitHub a9d55423ae update vulnerable dependencies (#2684)
Signed-off-by: Nikhl Sharma <nikhilsharma230303@gmail.com>

Signed-off-by: Nikhl Sharma <nikhilsharma230303@gmail.com>
2023-01-10 15:40:44 +05:30
Shubham NazareandGitHub 496e4e3162 feat(cli): provide imagepullsecret option for container as function (#2680)
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
2023-01-09 16:18:56 +05:30
AmborandGitHub 6667d7e383 fix: nil panic for the latestDepl.Name if not return in the for cycle (#2682)
Signed-off-by: saltbo <saltbo@foxmail.com>

Signed-off-by: saltbo <saltbo@foxmail.com>
2023-01-09 16:18:15 +05:30
Shubham NazareandGitHub 922cb34243 Change cron syntax to standard format (#2678)
* Change cron syntax to standard format
* Add standard cron example in showschedule command

Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
2023-01-02 20:05:58 +05:30
Nico FeulnerandGitHub fcf4fd2e63 fix: add missing imagePullSecrets sections to pods (#2675) 2022-12-28 15:42:04 +05:30
Shubham NazareandGitHub 69470a68d0 Fix issue with updating timetrigger without --cron flag (#2677)
* Fix issue with updating time trigger without --cron flag
* Add check with ResourceVersion
* Change in UpdateFunc

Signed-off-by: Shubham Nazare <shubham4443@gmail.com>

Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
2022-12-28 14:12:19 +05:30
30 changed files with 101 additions and 67 deletions
+15 -15
View File
@@ -84,7 +84,7 @@ dockers:
image_templates:
- "fission/builder:latest-amd64"
- "fission/builder:{{ .Tag }}-amd64"
dockerfile: cmd/builder/Dockerfile.fission-builder
dockerfile: cmd/builder/Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
@@ -96,28 +96,28 @@ dockers:
image_templates:
- "fission/fetcher:latest-amd64"
- "fission/fetcher:{{ .Tag }}-amd64"
dockerfile: cmd/fetcher/Dockerfile.fission-fetcher
dockerfile: cmd/fetcher/Dockerfile
- <<: *docker-amd64
ids:
- fission-bundle
image_templates:
- "fission/fission-bundle:latest-amd64"
- "fission/fission-bundle:{{ .Tag }}-amd64"
dockerfile: cmd/fission-bundle/Dockerfile.fission-bundle
dockerfile: cmd/fission-bundle/Dockerfile
- <<: *docker-amd64
ids:
- pre-upgrade-checks
image_templates:
- "fission/pre-upgrade-checks:latest-amd64"
- "fission/pre-upgrade-checks:{{ .Tag }}-amd64"
dockerfile: cmd/preupgradechecks/Dockerfile.fission-preupgradechecks
dockerfile: cmd/preupgradechecks/Dockerfile
- <<: *docker-amd64
ids:
- reporter
image_templates:
- "fission/reporter:latest-amd64"
- "fission/reporter:{{ .Tag }}-amd64"
dockerfile: cmd/reporter/Dockerfile.reporter
dockerfile: cmd/reporter/Dockerfile
- &docker-arm64
use: buildx
goos: linux
@@ -127,7 +127,7 @@ dockers:
image_templates:
- "fission/builder:latest-arm64"
- "fission/builder:{{ .Tag }}-arm64"
dockerfile: cmd/builder/Dockerfile.fission-builder
dockerfile: cmd/builder/Dockerfile
build_flag_templates:
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
@@ -139,28 +139,28 @@ dockers:
image_templates:
- "fission/fetcher:latest-arm64"
- "fission/fetcher:{{ .Tag }}-arm64"
dockerfile: cmd/fetcher/Dockerfile.fission-fetcher
dockerfile: cmd/fetcher/Dockerfile
- <<: *docker-arm64
ids:
- fission-bundle
image_templates:
- "fission/fission-bundle:latest-arm64"
- "fission/fission-bundle:{{ .Tag }}-arm64"
dockerfile: cmd/fission-bundle/Dockerfile.fission-bundle
dockerfile: cmd/fission-bundle/Dockerfile
- <<: *docker-arm64
ids:
- pre-upgrade-checks
image_templates:
- "fission/pre-upgrade-checks:latest-arm64"
- "fission/pre-upgrade-checks:{{ .Tag }}-arm64"
dockerfile: cmd/preupgradechecks/Dockerfile.fission-preupgradechecks
dockerfile: cmd/preupgradechecks/Dockerfile
- <<: *docker-arm64
ids:
- reporter
image_templates:
- "fission/reporter:latest-arm64"
- "fission/reporter:{{ .Tag }}-arm64"
dockerfile: cmd/reporter/Dockerfile.reporter
dockerfile: cmd/reporter/Dockerfile
- &docker-armv7
use: buildx
goos: linux
@@ -171,7 +171,7 @@ dockers:
image_templates:
- "fission/builder:latest-armv7"
- "fission/builder:{{ .Tag }}-armv7"
dockerfile: cmd/builder/Dockerfile.fission-builder
dockerfile: cmd/builder/Dockerfile
build_flag_templates:
- "--platform=linux/arm/v7"
- "--label=org.opencontainers.image.created={{.Date}}"
@@ -183,28 +183,28 @@ dockers:
image_templates:
- "fission/fetcher:latest-armv7"
- "fission/fetcher:{{ .Tag }}-armv7"
dockerfile: cmd/fetcher/Dockerfile.fission-fetcher
dockerfile: cmd/fetcher/Dockerfile
- <<: *docker-armv7
ids:
- fission-bundle
image_templates:
- "fission/fission-bundle:latest-armv7"
- "fission/fission-bundle:{{ .Tag }}-armv7"
dockerfile: cmd/fission-bundle/Dockerfile.fission-bundle
dockerfile: cmd/fission-bundle/Dockerfile
- <<: *docker-armv7
ids:
- pre-upgrade-checks
image_templates:
- "fission/pre-upgrade-checks:latest-armv7"
- "fission/pre-upgrade-checks:{{ .Tag }}-armv7"
dockerfile: cmd/preupgradechecks/Dockerfile.fission-preupgradechecks
dockerfile: cmd/preupgradechecks/Dockerfile
- <<: *docker-armv7
ids:
- reporter
image_templates:
- "fission/reporter:latest-armv7"
- "fission/reporter:{{ .Tag }}-armv7"
dockerfile: cmd/reporter/Dockerfile.reporter
dockerfile: cmd/reporter/Dockerfile
docker_manifests:
- name_template: fission/builder:{{ .Tag }}
image_templates:
+5 -5
View File
@@ -112,11 +112,11 @@ all-generators: codegen generate-crds generate-swagger-doc generate-cli-docs gen
skaffold-prebuild:
@GOOS=linux GOARCH=amd64 GORELEASER_CURRENT_TAG=$(VERSION) goreleaser build --snapshot --rm-dist --single-target
@cp -v cmd/builder/Dockerfile.fission-builder dist/builder_linux_amd64_v1/Dockerfile
@cp -v cmd/fetcher/Dockerfile.fission-fetcher dist/fetcher_linux_amd64_v1/Dockerfile
@cp -v cmd/fission-bundle/Dockerfile.fission-bundle dist/fission-bundle_linux_amd64_v1/Dockerfile
@cp -v cmd/reporter/Dockerfile.reporter dist/reporter_linux_amd64_v1/Dockerfile
@cp -v cmd/preupgradechecks/Dockerfile.fission-preupgradechecks dist/pre-upgrade-checks_linux_amd64_v1/Dockerfile
@cp -v cmd/builder/Dockerfile dist/builder_linux_amd64_v1/Dockerfile
@cp -v cmd/fetcher/Dockerfile dist/fetcher_linux_amd64_v1/Dockerfile
@cp -v cmd/fission-bundle/Dockerfile dist/fission-bundle_linux_amd64_v1/Dockerfile
@cp -v cmd/reporter/Dockerfile dist/reporter_linux_amd64_v1/Dockerfile
@cp -v cmd/preupgradechecks/Dockerfile dist/pre-upgrade-checks_linux_amd64_v1/Dockerfile
skaffold-deploy: skaffold-prebuild
skaffold run -p $(SKAFFOLD_PROFILE)
+2 -2
View File
@@ -1,7 +1,7 @@
apiVersion: v2
name: fission-all
version: v1.18.0-rc2
appVersion: v1.18.0-rc2
version: v1.18.0
appVersion: v1.18.0
description: Fission is a fast serverless framework for Kubernetes.
home: https://fission.io/
icon: https://fission.io/images/fission-logo-white.svg
@@ -37,4 +37,8 @@ spec:
env:
- name: GA_TRACKING_ID
value: "{{ .Values.gaTrackingID }}"
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -47,4 +47,8 @@ spec:
{{- if .Values.terminationMessagePolicy }}
terminationMessagePolicy: {{ .Values.terminationMessagePolicy }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -47,4 +47,8 @@ spec:
{{- if .Values.terminationMessagePolicy }}
terminationMessagePolicy: {{ .Values.terminationMessagePolicy }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -185,6 +185,10 @@ spec:
- name: fluentbit-config
configMap:
name: {{ .Release.Name }}-fission-fluentbit
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
updateStrategy:
type: RollingUpdate
{{- end }}
@@ -49,6 +49,10 @@ spec:
secretKeyRef:
name: influxdb
key: password
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.extraCoreComponentPodConfig }}
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
{{- end }}
@@ -44,4 +44,8 @@ spec:
terminationMessagePolicy: {{ .Values.terminationMessagePolicy }}
{{- end }}
serviceAccountName: fission-preupgrade
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
+3 -3
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.18.0-rc2
imageTag: v1.18.0
## pullPolicy represents the pull policy to use for images in the chart.
##
@@ -104,7 +104,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.18.0-rc2
imageTag: v1.18.0
## Fetcher is only for to downloading or uploading archive.
## Normally, you don't need to change the value here, unless necessary.
@@ -686,7 +686,7 @@ preUpgradeChecks:
image: fission/pre-upgrade-checks
## pre-install/pre-upgrade checks image version
##
imageTag: v1.18.0-rc2
imageTag: v1.18.0
## Fission post-install/post-upgrade reporting live in this image
##
+2 -2
View File
@@ -29,7 +29,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
github.com/prometheus/common v0.37.0
github.com/robfig/cron v1.2.0
github.com/robfig/cron/v3 v3.0.0
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/spf13/cobra v1.6.1
@@ -65,7 +65,7 @@ require (
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Masterminds/goutils v1.1.0 // 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.5.2 // indirect
+4 -4
View File
@@ -75,8 +75,8 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=
@@ -607,8 +607,8 @@ github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0ua
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E=
github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+2 -3
View File
@@ -17,7 +17,6 @@ limitations under the License.
package v1
import (
"github.com/robfig/cron"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
@@ -59,7 +58,7 @@ func (r *TimeTrigger) ValidateCreate() error {
return err
}
_, err = cron.Parse(r.Spec.Cron)
err = IsValidCronSpec(r.Spec.Cron)
if err != nil {
err = ferror.MakeError(ferror.ErrorInvalidArgument, "TimeTrigger cron spec is not valid")
return err
@@ -76,7 +75,7 @@ func (r *TimeTrigger) ValidateUpdate(old runtime.Object) error {
return err
}
_, err = cron.Parse(r.Spec.Cron)
err = IsValidCronSpec(r.Spec.Cron)
if err != nil {
err = ferror.MakeError(ferror.ErrorInvalidArgument, "TimeTrigger cron spec is not valid")
return err
+3 -2
View File
@@ -25,7 +25,7 @@ import (
"strings"
"github.com/hashicorp/go-multierror"
"github.com/robfig/cron"
"github.com/robfig/cron/v3"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/validation"
@@ -170,7 +170,8 @@ func ValidateKubeReference(refName string, name string, namespace string) error
}
func IsValidCronSpec(spec string) error {
_, err := cron.Parse(spec)
cronSpecParser := cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
_, err := cronSpecParser.Parse(spec)
return err
}
+2 -3
View File
@@ -25,7 +25,6 @@ import (
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
"github.com/robfig/cron"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
fv1 "github.com/fission/fission/pkg/apis/core/v1"
@@ -135,7 +134,7 @@ func (a *API) TimeTriggerApiCreate(w http.ResponseWriter, r *http.Request) {
}
// validate
_, err = cron.Parse(t.Spec.Cron)
err = fv1.IsValidCronSpec(t.Spec.Cron)
if err != nil {
err = ferror.MakeError(ferror.ErrorInvalidArgument, "TimeTrigger cron spec is not valid")
a.respondWithError(w, err)
@@ -211,7 +210,7 @@ func (a *API) TimeTriggerApiUpdate(w http.ResponseWriter, r *http.Request) {
return
}
_, err = cron.Parse(t.Spec.Cron)
err = fv1.IsValidCronSpec(t.Spec.Cron)
if err != nil {
err = ferror.MakeError(ferror.ErrorInvalidArgument, "TimeTrigger cron spec is not valid")
a.respondWithError(w, err)
@@ -139,7 +139,7 @@ func (cn *Container) waitForDeploy(ctx context.Context, depl *appsv1.Deployment,
}
for i := 0; i < specializationTimeout; i++ {
latestDepl, err := cn.kubernetesClient.AppsV1().Deployments(depl.ObjectMeta.Namespace).Get(ctx, depl.Name, metav1.GetOptions{})
latestDepl, err = cn.kubernetesClient.AppsV1().Deployments(depl.ObjectMeta.Namespace).Get(ctx, depl.Name, metav1.GetOptions{})
if err != nil {
return nil, err
}
+1
View File
@@ -173,6 +173,7 @@ func Commands() *cobra.Command {
flag.RunTimeMinCPU, flag.RunTimeMaxCPU, flag.RunTimeMinMemory,
flag.RunTimeMaxMemory, flag.ReplicasMin,
flag.ReplicasMax, flag.RunTimeTargetCPU,
flag.RunImagePullSecret,
flag.NamespaceFunction, flag.SpecSave, flag.SpecDry,
},
@@ -106,6 +106,8 @@ func (opts *RunContainerSubCommand) complete(input cli.Input) error {
console.Warn("grace period must be a non-negative integer, using default value (6 mins)")
}
pullSecret := []apiv1.LocalObjectReference{{Name: input.String(flagkey.RunImagePullSecret)}}
var imageName string
var port int
var command, args string
@@ -208,6 +210,7 @@ func (opts *RunContainerSubCommand) complete(input cli.Input) error {
opts.function.Spec.PodSpec = &apiv1.PodSpec{
Containers: []apiv1.Container{*container},
TerminationGracePeriodSeconds: &fnGracePeriod,
ImagePullSecrets: pullSecret,
}
return nil
+4 -3
View File
@@ -23,7 +23,7 @@ import (
"github.com/fission/fission/pkg/fission-cli/cmd"
"github.com/pkg/errors"
"github.com/robfig/cron"
"github.com/robfig/cron/v3"
uuid "github.com/satori/go.uuid"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -74,7 +74,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) (err error) {
cronSpec := input.String(flagkey.TtCron)
if len(cronSpec) == 0 {
return errors.New("Need a cron spec like '0 30 * * * *', '@every 1h30m', or '@hourly'; use --cron")
return errors.New("Need a cron spec like '30 * * * *', '@every 1h30m', or '@hourly'; use --cron")
}
if input.Bool(flagkey.SpecSave) {
@@ -160,7 +160,8 @@ func (opts *CreateSubCommand) run(input cli.Input) error {
}
func getCronNextNActivationTime(cronSpec string, serverTime time.Time, round int) error {
sched, err := cron.Parse(cronSpec)
cronSpecParser := cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
sched, err := cronSpecParser.Parse(cronSpec)
if err != nil {
return err
}
+1 -1
View File
@@ -42,7 +42,7 @@ func (opts *ShowSubCommand) run(flaginput cli.Input) error {
cronSpec := flaginput.String(flagkey.TtCron)
if len(cronSpec) == 0 {
return errors.New("need a cron spec like '0 30 * * * *', '@every 1h30m', or '@hourly'; use --cron")
return errors.New("need a cron spec like '0 30 * * * *', '*/2 * * * *', '@every 1h30m', or '@hourly'; use --cron")
}
t := util.GetServerInfo(flaginput, opts.Client()).ServerTime.CurrentTime.UTC()
+1
View File
@@ -96,6 +96,7 @@ var (
RunTimeTargetCPU = Flag{Type: Int, Name: flagkey.RuntimeTargetcpu, Usage: "Target average CPU usage percentage across pods for scaling", DefaultValue: 80}
RunTimeMinMemory = Flag{Type: Int, Name: flagkey.RuntimeMinmemory, Usage: "Minimum memory to be assigned to pod (In megabyte)"}
RunTimeMaxMemory = Flag{Type: Int, Name: flagkey.RuntimeMaxmemory, Usage: "Maximum memory to be assigned to pod (In megabyte)"}
RunImagePullSecret = Flag{Type: String, Name: flagkey.RunImagePullSecret, Usage: "Secret for Kubernetes to pull an image from a private registry"}
ReplicasMin = Flag{Type: Int, Name: flagkey.ReplicasMinscale, Usage: "Minimum number of pods (Uses resource inputs to configure HPA)", DefaultValue: 1}
ReplicasMax = Flag{Type: Int, Name: flagkey.ReplicasMaxscale, Usage: "Maximum number of pods (Uses resource inputs to configure HPA)", DefaultValue: 1}
+6 -5
View File
@@ -44,11 +44,12 @@ const (
NamespacePod = "pod-namespace"
ForceDelete = "force"
RuntimeMincpu = "mincpu"
RuntimeMaxcpu = "maxcpu"
RuntimeMinmemory = "minmemory"
RuntimeMaxmemory = "maxmemory"
RuntimeTargetcpu = "targetcpu"
RuntimeMincpu = "mincpu"
RuntimeMaxcpu = "maxcpu"
RuntimeMinmemory = "minmemory"
RuntimeMaxmemory = "maxmemory"
RuntimeTargetcpu = "targetcpu"
RunImagePullSecret = "imagepullsecret"
ReplicasMinscale = "minscale"
ReplicasMaxscale = "maxscale"
+5 -2
View File
@@ -17,7 +17,7 @@ limitations under the License.
package timer
import (
"github.com/robfig/cron"
"github.com/robfig/cron/v3"
"go.uber.org/zap"
fv1 "github.com/fission/fission/pkg/apis/core/v1"
@@ -54,7 +54,10 @@ func MakeTimer(logger *zap.Logger, publisher publisher.Publisher) *Timer {
}
func (timer *Timer) newCron(t fv1.TimeTrigger) *cron.Cron {
c := cron.New()
c := cron.New(
cron.WithParser(
cron.NewParser(
cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)))
c.AddFunc(t.Spec.Cron, func() { //nolint: errCheck
headers := map[string]string{
"X-Fission-Timer-Name": t.Name,
+11 -10
View File
@@ -61,14 +61,12 @@ func (ws *TimerSync) AddUpdateTimeTrigger(timeTrigger *fv1.TimeTrigger) {
ws.logger.Debug("cron event")
if item, ok := ws.timer.triggers[crd.CacheKeyUID(&timeTrigger.ObjectMeta)]; ok {
if item.trigger.Spec.Cron != timeTrigger.Spec.Cron {
if item.cron != nil {
item.cron.Stop()
}
item.trigger = *timeTrigger
item.cron = ws.timer.newCron(*timeTrigger)
logger.Debug("cron updated")
if item.cron != nil {
item.cron.Stop()
}
item.trigger = *timeTrigger
item.cron = ws.timer.newCron(*timeTrigger)
logger.Debug("cron updated")
} else {
ws.timer.triggers[crd.CacheKeyUID(&timeTrigger.ObjectMeta)] = &timerTriggerWithCron{
trigger: *timeTrigger,
@@ -98,9 +96,12 @@ func (ws *TimerSync) TimeTriggerEventHandlers(ctx context.Context) {
timeTrigger := obj.(*fv1.TimeTrigger)
ws.AddUpdateTimeTrigger(timeTrigger)
},
UpdateFunc: func(_ interface{}, obj interface{}) {
timeTrigger := obj.(*fv1.TimeTrigger)
ws.AddUpdateTimeTrigger(timeTrigger)
UpdateFunc: func(oldObj interface{}, newObj interface{}) {
oldTimeTrigger := oldObj.(*fv1.TimeTrigger)
newTimeTrigger := newObj.(*fv1.TimeTrigger)
if oldTimeTrigger.ObjectMeta.ResourceVersion != newTimeTrigger.ObjectMeta.ResourceVersion {
ws.AddUpdateTimeTrigger(newTimeTrigger)
}
},
DeleteFunc: func(obj interface{}) {
timeTrigger := obj.(*fv1.TimeTrigger)
+6 -6
View File
@@ -74,9 +74,9 @@ build_and_push_go_mod_cache_image() {
gcloud_login
if ! gcloud docker -- pull $image_tag >/dev/null 2>&1 ; then
docker build -q -t $image_tag -f $ROOT/cmd/fission-bundle/Dockerfile.fission-bundle --target godep --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
docker build -q -t $image_tag -f $ROOT/cmd/fission-bundle/Dockerfile --target godep --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
else
docker build -q -t $image_tag -f $ROOT/cmd/fission-bundle/Dockerfile.fission-bundle --cache-from ${image_tag} --target godep --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
docker build -q -t $image_tag -f $ROOT/cmd/fission-bundle/Dockerfile --cache-from ${image_tag} --target godep --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
fi
gcloud docker -- push $image_tag &
@@ -88,7 +88,7 @@ build_and_push_pre_upgrade_check_image() {
cache_image=$2
travis_fold_start build_and_push_pre_upgrade_check_image $image_tag
docker build -q -t $image_tag -f $ROOT/cmd/preupgradechecks/Dockerfile.fission-preupgradechecks --cache-from ${cache_image} --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
docker build -q -t $image_tag -f $ROOT/cmd/preupgradechecks/Dockerfile --cache-from ${cache_image} --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
gcloud_login
@@ -101,7 +101,7 @@ build_and_push_fission_bundle() {
cache_image=$2
travis_fold_start build_and_push_fission_bundle $image_tag
docker build -q -t $image_tag -f $ROOT/cmd/fission-bundle/Dockerfile.fission-bundle --cache-from ${cache_image} --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
docker build -q -t $image_tag -f $ROOT/cmd/fission-bundle/Dockerfile --cache-from ${cache_image} --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
gcloud_login
@@ -114,7 +114,7 @@ build_and_push_fetcher() {
cache_image=$2
travis_fold_start build_and_push_fetcher $image_tag
docker build -q -t $image_tag -f $ROOT/cmd/fetcher/Dockerfile.fission-fetcher --cache-from ${cache_image} --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
docker build -q -t $image_tag -f $ROOT/cmd/fetcher/Dockerfile --cache-from ${cache_image} --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
gcloud_login
@@ -128,7 +128,7 @@ build_and_push_builder() {
cache_image=$2
travis_fold_start build_and_push_builder $image_tag
docker build -q -t $image_tag -f $ROOT/cmd/builder/Dockerfile.fission-builder --cache-from ${cache_image} --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
docker build -q -t $image_tag -f $ROOT/cmd/builder/Dockerfile --cache-from ${cache_image} --build-arg GITCOMMIT=$(getGitCommit) --build-arg BUILDDATE=$(getDate) --build-arg BUILDVERSION=$(getVersion) .
gcloud_login