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>
This commit is contained in:
soharab-ic
2024-07-08 12:04:43 +05:30
committed by GitHub
parent f2baa17131
commit c6c811ea76
3 changed files with 40 additions and 3 deletions
+5
View File
@@ -154,6 +154,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)
}