Serve only one request and garbage collect (#1978)
Adding once only execution pattern to pool manager based functions. This is for use cases where you don't want to share the samne pod for another execution instance!
This commit is contained in:
@@ -36,6 +36,7 @@ func Commands() *cobra.Command {
|
||||
flag.FnExecutorType, flag.FnCfgMap, flag.FnSecret,
|
||||
flag.FnSpecializationTimeout, flag.FnExecutionTimeout,
|
||||
flag.FnIdleTimeout, flag.FnConcurrency, flag.FnRequestsPerPod,
|
||||
flag.FnOnceOnly,
|
||||
|
||||
// TODO retired pkg & trigger related flags from function cmd
|
||||
flag.PkgCode, flag.PkgSrcArchive, flag.PkgDeployArchive,
|
||||
@@ -87,6 +88,7 @@ func Commands() *cobra.Command {
|
||||
flag.FnExecutorType, flag.FnSecret, flag.FnCfgMap,
|
||||
flag.FnSpecializationTimeout, flag.FnExecutionTimeout,
|
||||
flag.FnIdleTimeout, flag.FnConcurrency, flag.FnRequestsPerPod,
|
||||
flag.FnOnceOnly,
|
||||
|
||||
flag.PkgCode, flag.PkgSrcArchive, flag.PkgDeployArchive,
|
||||
flag.PkgSrcChecksum, flag.PkgDeployChecksum, flag.PkgInsecure,
|
||||
|
||||
@@ -104,6 +104,8 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
|
||||
requestsPerPod := input.Int(flagkey.FnRequestsPerPod)
|
||||
|
||||
fnOnceOnly := input.Bool(flagkey.FnOnceOnly)
|
||||
|
||||
pkgName := input.String(flagkey.FnPackageName)
|
||||
|
||||
secretNames := input.StringSlice(flagkey.FnSecret)
|
||||
@@ -304,6 +306,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) error {
|
||||
IdleTimeout: &fnIdleTimeout,
|
||||
Concurrency: fnConcurrency,
|
||||
RequestsPerPod: requestsPerPod,
|
||||
OnceOnly: fnOnceOnly,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -163,6 +163,9 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
||||
function.Spec.RequestsPerPod = input.Int(flagkey.FnRequestsPerPod)
|
||||
}
|
||||
|
||||
if input.IsSet(flagkey.FnOnceOnly) {
|
||||
function.Spec.OnceOnly = input.Bool(flagkey.FnOnceOnly)
|
||||
}
|
||||
if len(pkgName) == 0 {
|
||||
pkgName = function.Spec.Package.PackageRef.Name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user