Make NewDeployment specialization timeout configurable (#1260)

* Add specializationtimeout flag to function create/update
* Set specialization timeout of 120 seconds if not present
* Add default newdeploy timeout for rest of the test cases
* Comment out specialization timeout in validations for compatibility
* Add warning if specializationtimeout is lower than default value
This commit is contained in:
Suraj Banakar
2019-08-16 23:15:17 +08:00
committed by Ta-Ching Chen
parent 88b5343775
commit 80910562b3
7 changed files with 177 additions and 68 deletions
+5 -4
View File
@@ -167,10 +167,11 @@ type (
and resources allocated to the function pod.
*/
ExecutionStrategy struct {
ExecutorType ExecutorType
MinScale int
MaxScale int
TargetCPUPercent int
ExecutorType ExecutorType
MinScale int
MaxScale int
TargetCPUPercent int
SpecializationTimeout int
}
FunctionReferenceType string
+5
View File
@@ -346,6 +346,11 @@ func (es ExecutionStrategy) Validate() error {
if es.TargetCPUPercent <= 0 || es.TargetCPUPercent > 100 {
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "ExecutionStrategy.TargetCPUPercent", es.TargetCPUPercent, "TargetCPUPercent must be a value between 1 - 100"))
}
// TODO Add validation warning
//if es.SpecializationTimeout < 120 {
// result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "ExecutionStrategy.SpecializationTimeout", es.SpecializationTimeout, "SpecializationTimeout must be a value equal to or greater than 120"))
//}
}
return result.ErrorOrNil()