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: ? 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

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