diff

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintFull

func PrintFull(results []Result)

PrintFull prints out a table and the raw diffs for a results slice.

func PrintSummary

func PrintSummary(results []Result)

PrintSummary prints out a summary table for a results slice.

func ResultsTable

func ResultsTable(results []Result) string

ResultsTable returns a table that summarizes a slice of result diffs.

Types

type Result

type Result struct {
	Object     *apply.TypedKubeObj `json:"object"`
	Name       string              `json:"name"`
	RawDiff    string              `json:"rawDiff"`
	NumAdded   int                 `json:"numAdded"`
	NumRemoved int                 `json:"numRemoved"`
}

Result contains the results of diffing a single object.

func DiffKube

func DiffKube(oldRoot string, newRoot string) ([]Result, error)

DiffKube processes the results of a kubectl diff call in place of the default 'diff' command.

func (*Result) ClippedRawDiff

func (r *Result) ClippedRawDiff(maxLen int) string

ClippedRawDiff returns a clipped version of the raw diff for this result. Used in the Github diff comment template.

func (*Result) NumChangedLines

func (r *Result) NumChangedLines() int

NumChangedLines returns the rough number of lines changed (taken as the max of the num added and num removed).

func (*Result) PrintRaw

func (r *Result) PrintRaw(useColors bool)

PrintRaw prints out the raw diffs for a single resource.

type Results

type Results struct {
	Results []Result `json:"results"`
}

Results contains all results from a given diff run. It's used for wrapping so that everything can be put in a single struct when exported by kubeapply kdiff.

Jump to

Keyboard shortcuts

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