Documentation
¶
Overview ¶
Package volumes resolves Tekton TaskSpec.Volumes into host directories the docker backend can bind-mount.
Four volume kinds are supported:
emptyDir fresh per-Task tmpdir under the run cache hostPath literal host path (path mode honored only as diagnostic) configMap bytes from a Store (file-backed dir + inline overrides) secret same, with separate Store
The validator rejects any other kind before this package sees it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaterializeForTask ¶
func MaterializeForTask( taskName string, vs []tektontypes.Volume, baseDir string, cm, sec *Store, ) (map[string]string, error)
MaterializeForTask resolves every Volume in spec into a host directory and returns map[volumeName] -> hostPath. baseDir is a per-task scratch dir under which emptyDir / configMap / secret subdirs are created.
Types ¶
type Store ¶
type Store struct {
Dir string // <root>/<name>/<key> per source
Inline map[string]map[string]string // name -> key -> value
Bundle map[string]map[string][]byte // name -> key -> bytes
}
Store is a configMap-or-secret bytes-source.
Lookup precedence (highest first):
- Inline overrides (Add) — typically from `--configmap` / `--secret`.
- On-disk Dir layout — typically from `--configmap-dir` / `--secret-dir`.
- Bundle-loaded bytes (LoadBytes) — typically from `kind: ConfigMap` / `kind: Secret` resources found in the `-f` YAML stream.
Each layer is checked per (name, key); a key present at a higher layer hides the same key at lower layers.
func NewStore ¶
NewStore returns an empty Store rooted at dir. Inline overrides may be added via Add and bundle-loaded data via LoadBytes. dir may be empty (no on-disk layout).
func (*Store) Add ¶
Add records an inline override; later Lookup calls for (name, key) return the inline value instead of consulting the on-disk dir.
func (*Store) LoadBytes ¶ added in v1.5.0
LoadBytes records bundle-loaded bytes for every key under `name`. These sit at the lowest precedence layer: a key present here is shadowed by the same key in either the on-disk Dir layout or the inline overrides.
Calling LoadBytes twice for the same name is a merge (later keys overwrite earlier ones); duplicate-name detection happens at the loader layer, not here.
func (*Store) Reset ¶ added in v1.5.0
func (s *Store) Reset()
Reset clears every Inline and Bundle entry, leaving the Dir layout (which is on-disk state, not part of the in-memory mutable surface) untouched. Intended for test harnesses that share one Store across a table of subtests and need per-subtest isolation without rebuilding the Backend that holds a pointer to this Store.
Resetting is destructive of in-memory state (Inline + Bundle); the Dir layer is preserved. Callers that want to keep the existing entries must build a fresh Store with NewStore instead.
Intended for test use only.