discovery

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package discovery holds the table cells, section output and empty-result note shared by the deployment-discovery verbs. Importable only from packages below pkg/cmd/.

Index

Constants

View Source
const MaxIngressHostLen = 50

MaxIngressHostLen caps the visible width of an ingress hostname in table mode. The OSC 8 hyperlink target carries the full URL regardless.

View Source
const ShortDigestLen = len("sha256:") + 8

ShortDigestLen is the maximum length of an image digest in table mode: the `sha256:` prefix plus the first 8 hex characters.

Variables

This section is empty.

Functions

func Bullet added in v0.20.0

func Bullet(text string) string

Bullet returns a PrintSection line: " - " followed by text on one row with its control characters visible. The prefix stays outside SingleLine.

func ColorForArgoStatus

func ColorForArgoStatus(s string) output.Cell

ColorForArgoStatus colors an ArgoCD health status: healthy → green, degraded/missing → red, progressing → blue. Anything else (including suspended/unknown) is left unstyled.

func ExpandIngressRows

func ExpandIngressRows(cells []output.Cell, ingressLines []output.Cell) [][]output.Cell

ExpandIngressRows turns one logical row (cells without INGRESS) plus a list of ingress lines into N visual rows. The first visual row carries the full data; subsequent rows blank out every cell except INGRESS, producing a vertically-stacked layout:

project1   …    ingress1
                ingress2
project2   …    ingress1

When ingressLines is empty, a single row is emitted with "-" in INGRESS.

func HostnameFromURL

func HostnameFromURL(u string) string

HostnameFromURL strips the scheme and the path from a URL, returning host[:port]. Input without "://" has only its path stripped.

func IngressLines

func IngressLines(urls []string) []output.Cell

IngressLines renders an ingress-URL slice as one cell per URL: the hostname (no scheme) truncated to MaxIngressHostLen visible characters. The styled form is an OSC 8 hyperlink to the full URL. Returns nil when urls is empty; callers display a single "-" row in that case.

func OptCell

func OptCell(s *string) string

OptCell renders an optional string field, output.EmptyCell when the pointer is nil or the value is empty.

func OptStatusCell

func OptStatusCell(s *string) output.Cell

OptStatusCell renders an ArgoCD health-status cell, output.EmptyCell when the pointer is nil or the value is empty.

func OptTimeCell added in v0.20.0

func OptTimeCell(at *string) string

OptTimeCell renders an optional RFC 3339 timestamp as a relative time, output.EmptyCell when the pointer is nil.

func PrintEmptyNote added in v0.20.0

func PrintEmptyNote(ios *iostreams.IOStreams, outputFormat, note string) error

PrintEmptyNote writes the note of an empty result to stderr. Under -o json it writes nothing: the empty array is the answer.

func PrintSection added in v0.20.0

func PrintSection(w io.Writer, isTTY bool, title string, lines []string) error

PrintSection prints a blank line, the heading "<title> (<number of lines>)" and the lines. It prints nothing when there are no lines.

func ShortDigestCell

func ShortDigestCell(digest *string) string

ShortDigestCell truncates a digest to ShortDigestLen characters for table display. output.EmptyCell when the pointer is nil or the value is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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