loader

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package loader parses one or more Tekton YAML files into a Bundle of typed resources keyed by name. Multi-document YAML is supported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	Tasks        map[string]tektontypes.Task
	Pipelines    map[string]tektontypes.Pipeline
	PipelineRuns []tektontypes.PipelineRun // ordered as found
	TaskRuns     []tektontypes.TaskRun
	// StepActions are referenceable Step shapes (apiVersion
	// tekton.dev/v1beta1, kind StepAction). The engine inlines them
	// into Steps that carry `ref:` before stepTemplate / substitution.
	StepActions map[string]tektontypes.StepAction
	// RawTasks holds the original YAML bytes for each Task by name.
	// The validator uses this to inspect raw map shapes for fields
	// that sigs.k8s.io/yaml drops during typed unmarshaling
	// (e.g. unknown keys under Step.ref like resolver/params/bundle —
	// see validator rule 17).
	RawTasks map[string][]byte
	// ConfigMaps and Secrets are bytes-by-key, populated from any
	// `kind: ConfigMap` / `kind: Secret` (apiVersion: v1) doc found in
	// the loaded YAML. They are intended to be poured into the
	// volumes.Store at run time, where the precedence layering with
	// inline (--configmap) and on-disk (--configmap-dir) overrides
	// happens. Map shape: name -> key -> bytes.
	ConfigMaps map[string]map[string][]byte
	Secrets    map[string]map[string][]byte
}

Bundle holds all resources loaded from one or more files.

func LoadBytes

func LoadBytes(data []byte) (*Bundle, error)

LoadBytes parses one byte slice (possibly multi-doc) into a Bundle.

func LoadFiles

func LoadFiles(paths []string) (*Bundle, error)

LoadFiles loads every resource from the given file paths, returning a merged Bundle. Duplicate names within the same kind are an error.

type UnresolvedRef added in v1.6.0

type UnresolvedRef struct {
	Pipeline     string
	PipelineTask string
	Kind         string
	Resolver     string
}

UnresolvedRef describes a single resolver-backed taskRef or pipelineRef found in a Bundle. PipelineTask names the PipelineTask that carries the resolver block; for the top-level pipelineRef on a PipelineRun, it's "". Pipeline names the enclosing Pipeline (or empty for the top-level PipelineRun.spec.pipelineRef case). Kind is "Task" or "Pipeline".

func HasUnresolvedRefs added in v1.6.0

func HasUnresolvedRefs(b *Bundle) []UnresolvedRef

HasUnresolvedRefs lists every taskRef.resolver / pipelineRef.resolver found in the Bundle. Used by validate -o json and --offline pre-flight to tell users exactly which references would need to resolve.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL