Make configuration truthful and clean remote session files
This commit is contained in:
@@ -122,13 +122,20 @@ func validatePipeline(cfg *PipelineConfig) error {
|
||||
if err := validateScriptorium(cfg.Scriptorium, cfg.Notarius); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateDuration("pipeline.notification.timeout", cfg.Notification.Timeout); err != nil {
|
||||
if err := validateNotification(cfg.Notification); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateNotification(cfg NotificationConfig) error {
|
||||
if strings.EqualFold(strings.TrimSpace(cfg.Mode), DefaultNotificationMode) {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("pipeline.notification.mode must be %q until a notification provider is configured", DefaultNotificationMode)
|
||||
}
|
||||
|
||||
func validateStorage(cfg StorageConfig) error {
|
||||
backend := strings.ToLower(strings.TrimSpace(cfg.Backend))
|
||||
switch backend {
|
||||
|
||||
Reference in New Issue
Block a user