Documentation
¶
Overview ¶
Package pipelinerun holds helpers shared by the `krci pipelinerun` verbs and `krci project build` (validation, shared column headers, key=value parsing, row and dry-run rendering).
Index ¶
Constants ¶
const ( KindParameter = "parameter" KindLabel = "label" )
Kinds for ParseKeyValueList error messages.
const SchemaVersion = "1"
SchemaVersion is the JSON envelope schema tag for pipelinerun command output. Matches the per-group pattern used by sonar, sca, and discovery.
Variables ¶
var Headers = []string{"NAME", "STATUS", "PROJECT", "PR", "AUTHOR", "TYPE", "STARTED", "DURATION"}
Headers is the shared column set for `pipelinerun list`, `pipelinerun start` and `project build`.
Functions ¶
func HandleAuthError ¶
HandleAuthError maps portal.ErrUnauthorized to the auth-required remediation hint; other errors pass through unchanged.
func ParseKeyValueList ¶
ParseKeyValueList parses a list of `--param key=value` (or `--label key=value`) strings into a map.
Rules:
- Split on the first `=` only (so values containing `=` are preserved).
- Trim surrounding whitespace from key and value.
- Empty key after trim → error.
- Duplicate keys → error (no last-wins).
- Malformed entry (no `=`) → error.
kind is used in error messages and SHOULD be one of KindParameter or KindLabel.
func PresentResult ¶
func PresentResult(ios *iostreams.IOStreams, format string, dryRun bool, result *portal.StartResult) error
PresentResult writes a start or build result: the dry-run manifest, the JSON envelope, or the table row followed by a stderr note that the controller may briefly 404 on the new run until its labels reconcile.
func ValidateOutputAndDryRun ¶
ValidateOutputAndDryRun enforces the joint contract between -o and --dry-run.
- "", "table", "json" → ok (table only when not dry-run).
- "yaml" → ok only when --dry-run is set.
- --dry-run + "table" → rejected (no row to render for a manifest).
- any other -o value → rejected as unknown.
Types ¶
This section is empty.