Skip to main content

validate_server

Function validate_server 

Source
pub fn validate_server(
    server: &ServerSpec,
    mode: RepositoryMode,
) -> Vec<ValidationError>
Expand description

The shared spec.server rules the type system can’t express (server addendum):

  • auth.insecure requires acknowledgeInsecure: true — a no-auth server exposes full read/read of the repository, so it must be explicit.
  • service.port must be non-zero.
  • readOnly: false is contradictory on a mode: ReadOnly repository — a ReadOnly repo can never serve a writable UI, so the explicit denial is rejected (omitting the field is fine; the mode forces read-only).

mode is the parent repository’s RepositoryMode (both callers have it). Accumulates so a user sees every server problem at once. The PVC ReadWriteMany requirement for filesystem-backend servers is not here — it needs a live PVC read and is enforced at reconcile, not admission.