pipelineruninternal

package
v0.14.0 Latest Latest
Warning

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

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

Documentation

Overview

Package pipelineruninternal holds helpers shared by `krci pipelinerun` verbs (validation, shared column headers, key=value parsing).

Index

Constants

View Source
const (
	KindParameter = "parameter"
	KindLabel     = "label"
)

Kinds for ParseKeyValueList error messages.

View Source
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

View Source
var Headers = []string{"NAME", "STATUS", "PROJECT", "PR", "AUTHOR", "TYPE", "STARTED", "DURATION"}

Headers is the shared column set for `pipelinerun list` and `pipelinerun start`. The two verbs must emit byte-identical headers; a header-equality regression test enforces parity.

Functions

func HandleAuthError

func HandleAuthError(err error) error

HandleAuthError maps portal.ErrUnauthorized to the auth-required remediation hint; other errors pass through unchanged.

func ParseKeyValueList

func ParseKeyValueList(values []string, kind string) (map[string]string, error)

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 ValidateOutputAndDryRun

func ValidateOutputAndDryRun(format string, dryRun bool) error

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.

func ValidatePipelineName

func ValidatePipelineName(name string) error

ValidatePipelineName returns an error when name does not match the DNS-1123 subdomain shape. Tekton Pipeline objects follow Kubernetes resource-name conventions, which allow up to 253 chars (subdomain shape), not the tighter 63-char label ceiling used for codebase/sonar names.

Types

This section is empty.

Jump to

Keyboard shortcuts

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