Documentation
¶
Overview ¶
Package repositoryconfig reads the Chainloop configuration committed to a repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrChainloopYMLNotFound = errors.New(".chainloop.yml not found")
ErrChainloopYMLNotFound indicates that neither supported config filename exists.
Functions ¶
func LoadProjectFromYML ¶
LoadProjectFromYML returns projectName from the nearest repository config.
Types ¶
type ChainloopYML ¶
type ChainloopYML struct {
ProjectName string `yaml:"projectName"`
ProjectVersion string `yaml:"projectVersion"`
Organization string `yaml:"organization,omitempty"`
WorkflowName string `yaml:"workflowName,omitempty"`
// TraceStorage selects where Chainloop Trace stores a session's evidence:
// "CONTROL_PLANE" (the default) uploads a signed attestation, "LOCAL" writes
// the evidence set to disk with no control plane. It is a committed, shared
// repository policy, so a local-trace repository is the same for every clone.
TraceStorage string `yaml:"traceStorage,omitempty"`
// TracePath names the trace state directory, where Chainloop Trace keeps
// its data in every storage mode. LOCAL mode writes the sessions to its
// local-sessions folder. A relative path resolves against the repository
// root. Empty means <git dir>/chainloop-trace.
TracePath string `yaml:"tracePath,omitempty"`
// TraceRequired blocks a push when a required trace is missing. It replaces
// the deprecated RequireTrace with the same meaning.
TraceRequired *bool `yaml:"traceRequired,omitempty"`
// RequireTrace is deprecated in favor of TraceRequired and kept only so an
// older .chainloop.yml keeps working until it is dropped.
RequireTrace *bool `yaml:"requireTrace,omitempty"`
}
ChainloopYML represents the relevant fields in .chainloop.yml.
func FindChainloopYML ¶
func FindChainloopYML(dir string) *ChainloopYML
FindChainloopYML returns the nearest repository config, or nil when it cannot be loaded. Call LoadChainloopYML when the path or error is needed.
func LoadChainloopYML ¶
func LoadChainloopYML(dir string) (*ChainloopYML, string, error)
LoadChainloopYML loads the nearest .chainloop.yml (or .chainloop.yaml), walking from dir to the git repository root. In each directory, .yml takes precedence over .yaml. A config without projectName is still valid.
Click to show internal directories.
Click to hide internal directories.