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
+4
View File
@@ -437,6 +437,10 @@ func (fr *FissionResources) validate(c *cli.Context) error {
if _, ok := environments[fmt.Sprintf("%s:%s", f.Spec.Environment.Name, f.Spec.Environment.Namespace)]; !ok {
log.Warn(fmt.Sprintf("Environment %s is referenced in function %s but not declared in specs", f.Spec.Environment.Name, f.Metadata.Name))
}
strategy := f.Spec.InvokeStrategy.ExecutionStrategy
if strategy.ExecutorType == fv1.ExecutorTypeNewdeploy && strategy.SpecializationTimeout < DEFAULT_SPECIALIZATION_TIMEOUT {
log.Warn(fmt.Sprintf("SpecializationTimeout in function spec.InvokeStrategy.ExecutionStrategy should be a value equal to or greater than %v", DEFAULT_SPECIALIZATION_TIMEOUT))
}
}
// (ErrorOrNil returns nil if there were no errors appended.)