output

package
v0.0.0-...-1709b1e Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JSONFormat json output format
	JSONFormat = "json"
	// TableFormat table/csv output format
	TableFormat = "table"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CombinedOutputFormat

type CombinedOutputFormat struct {
	Helm       []ReleaseOutput `json:"helm"`
	IncludeAll bool            `json:"include_all"`
	Container  struct {
		ContainerImages   []ContainerOutput          `json:"container_images"`
		ErrImages         []*containers.ErroredImage `json:"err_images"`
		LatestStringFound bool                       `json:"latest_string_found"`
	} `json:"container"`
}

CombinedOutputFormat has both helm releases and containers info in a backwards compatible way

type ContainerOutput

type ContainerOutput struct {
	Name               string           `json:"name"`
	CurrentVersion     string           `json:"current_version"`
	LatestVersion      string           `json:"latest_version"`
	LatestMinorVersion string           `json:"latest_minor_version"`
	LatestPatchVersion string           `json:"latest_patch_version"`
	IsOld              bool             `json:"outdated"`
	AffectedWorkloads  []WorkloadOutput `json:"affectedWorkloads"`
}

ContainerOutput represents all the data we need for a single container image

type ContainersOutput

type ContainersOutput struct {
	ContainerImages   []ContainerOutput          `json:"container_images"`
	ErrImages         []*containers.ErroredImage `json:"err_images"`
	IncludeAll        bool                       `json:"include_all"`
	LatestStringFound bool                       `json:"latest_string_found"`
}

ContainersOutput represents the output data we need for displaying a table of out of date container images

func NewContainersOutput

func NewContainersOutput(containers []*containers.Image, errImages []*containers.ErroredImage, showNonSemver, showErrored, includeAll bool) *ContainersOutput

NewContainersOutput creates a new ContainersOutput object ready to be printed

func (ContainersOutput) Print

func (output ContainersOutput) Print(format string)

Print prints the ContainersOutput to STDOUT

type HelmAndContainersOutput

type HelmAndContainersOutput struct {
	Helm      Output
	Container ContainersOutput
}

HelmAndContainersOutput represents the output data we need for displaying a table of out of date container images

func NewHelmAndContainersOutput

func NewHelmAndContainersOutput(helm Output, container ContainersOutput) *HelmAndContainersOutput

NewHelmAndContainersOutput creates a new HelmAndContainersOutput object ready to be printed

func (HelmAndContainersOutput) Print

func (output HelmAndContainersOutput) Print(format string, wide, showOld bool)

Print prints the HelmAndContainersOutput to STDOUT

func (HelmAndContainersOutput) ToFile

func (output HelmAndContainersOutput) ToFile(filename string) error

ToFile writes the output to a file

type Output

type Output struct {
	HelmReleases []ReleaseOutput `json:"helm"`
	IncludeAll   bool            `json:"include_all"`
}

Output is the object that Nova outputs

func NewOutputWithHelmReleases

func NewOutputWithHelmReleases(helmReleases []*release.Release) Output

NewOutputWithHelmReleases creates a new output object with the given helm releases pre-populated with the installed version

func (*Output) Dedupe

func (output *Output) Dedupe()

Dedupe will remove duplicate releases from the output if both artifacthub and a custom URL to a helm repository find matches. this will always override any found by artifacthub with the version from a custom helm repo url because those are found last and will therefore always be at the end of the output.HelmReleases array.

func (Output) Print

func (output Output) Print(format string, wide, showOld bool)

Print sends the output to STDOUT

func (Output) ToFile

func (output Output) ToFile(filename string) error

ToFile dispatches a message to file

type ReleaseOutput

type ReleaseOutput struct {
	ReleaseName string `json:"release"`
	ChartName   string `json:"chartName"`
	Namespace   string `json:"namespace,omitempty"`
	Description string `json:"description"`
	Home        string `json:"home,omitempty"`
	Icon        string `json:"icon,omitempty"`
	Installed   VersionInfo
	Latest      VersionInfo
	IsOld       bool   `json:"outdated"`
	Deprecated  bool   `json:"deprecated"`
	HelmVersion string `json:"helmVersion"`
	Overridden  bool   `json:"overridden"`
}

ReleaseOutput represents a release

type VersionInfo

type VersionInfo struct {
	Version     string `json:"version"`
	AppVersion  string `json:"appVersion"`
	KubeVersion string `json:"kubeVersion"`
}

VersionInfo contains both a chart version and an app version

type WorkloadOutput

type WorkloadOutput struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Kind      string `json:"kind"`
	Container string `json:"container"`
}

WorkloadOutput represents a workload

Jump to

Keyboard shortcuts

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