Expand description
Go-style duration strings used across the CRDs (30m, 1h, 90s).
Lives in kopiur-api (not the controller) so the admission validators and
the reconcilers parse the exact same grammar — a value the webhook admits
must never fail to parse at reconcile time.
Functions§
- parse_
go_ duration - Parse a Go-style duration string used in the CRDs (
30m,1h,90s, or a bare number of seconds). ReturnsNonefor unparseable input. - render_
go_ duration - Render a
Durationback to a Go-style duration string, using the largest unit that divides it exactly (21600s→"6h",1200s→"20m", else"{n}s"). - resolve_
timeout - Resolve an optional policy timeout string to an effective deadline duration,
with the semantics every
*.timeoutfield shares (spec.preflight.timeout,spec.staging.timeout): absent ⇒default; parsed-zero (0/0s) ⇒None(indefinite — never expires); unparseable ⇒default(defensive only — the webhook rejects unparseable values at admission).