pub fn normalize(app: AppConfig) -> Result<ResolvedApp, NormalizeError>Expand description
Validates one app config
§Errors
NormalizeError::MissingName:nameis empty.NormalizeError::InvalidName:namecontains a path separator or a colon, or is./...NormalizeError::ReservedEnvVar:envsetsSHEP_INSTANCEorSHEP_NAME, which shep injects itself (carries the app name and the variable).NormalizeError::IncrementVarRemoved:increment_varis set. It was removed in favour of{{instance}}templating (carries the app name and the variable the app named).NormalizeError::MissingScript:scriptis empty.NormalizeError::ZeroInstances:instances == 0.NormalizeError::InvalidCron:cron_restartis not valid in croner’s dialect (carries the pattern and the rejection reason).NormalizeError::InvalidTimezone:cron_timezoneis not a name in the IANA time-zone database.NormalizeError::InvalidProbe:readiness_probeorliveness_probehas a targetProbeTarget::parserejects (carries which probe and the rendered reason).NormalizeError::ZeroFailureThreshold: a probe’sfailure_thresholdis explicitly0.NormalizeError::IntervalBelowMinimum: a probe’sintervalis under the floor its own loop honours: a full second forliveness_probe, and only “greater than zero” forreadiness_probe(carries which probe, the value and the floor).NormalizeError::ZeroMaxMemory:max_memoryis0.NormalizeError::ActionTimeoutTooLong:action_timeoutis at or above the ceiling no RPC caller could ever be given room to wait past (carries the app name, the value and the ceiling).NormalizeError::InvalidKillSignal:kill_signalnames a signal the daemon’s stop ladder cannot send (carries the app name and the value).NormalizeError::WatchWithoutCwd:watchistruewith nocwdset.NormalizeError::ZeroWatchDelay:watch_delayis0.NormalizeError::InvalidWatchGlob: awatch_optionsorignore_watchpattern globset will not compile (carries the app name, which of the two lists, the pattern and the reason).NormalizeError::BadTemplate: anenvvalue, anargsentry, or anout_file/err_filepath carries a{{...}}naming somethingcrate::config::templatedoes not define, or a{{that is never closed by a}}(carries the app name, which field, and the rejection).NormalizeError::SharedLogPath:out_fileorerr_filerenders to the SAME path for two different slots, withinstances > 1andmerge_logsoff, so every instance would write to one file without having asked to. Rendered, not searched: a path with no{{instance}}in it collides, and so does one carrying only{{name}}, or an escaped{{{{instance}}}}, which spells the token but renders as a literal.