diff

package
v3.15.15 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 27 Imported by: 9 modules, 4 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

View Source
const (
	// DiffToolEnvVar holds the diff tool command line when no flag is given.
	// Setting it is by itself a request to render the diff with that command.
	DiffToolEnvVar = "HELM_DIFF_TOOL"
)

Variables

This section is empty.

Functions

func Manifests

func Manifests(oldIndex, newIndex map[string]*manifest.MappingResult, options *Options, to io.Writer) bool

Manifests diff on manifests

func ManifestsOwnership added in v3.11.0

func ManifestsOwnership(oldIndex, newIndex map[string]*manifest.MappingResult, newOwnedReleases map[string]OwnershipDiff, options *Options, to io.Writer) bool

func Releases

func Releases(oldIndex, newIndex map[string]*manifest.MappingResult, options *Options, to io.Writer) bool

Releases reindex the content based on the template names and pass it to Manifests

Types

type ChangeStyle

type ChangeStyle struct {
	// contains filtered or unexported fields
}

ChangeStyle for styling the report

type FieldChange added in v3.15.0

type FieldChange struct {
	Path     string      `json:"path,omitempty"`
	Field    string      `json:"field,omitempty"`
	Change   string      `json:"change"`
	OldValue interface{} `json:"oldValue,omitempty"`
	NewValue interface{} `json:"newValue,omitempty"`
}

FieldChange stores a JSON-Pointer path and the change that occurred.

type Options added in v3.4.0

type Options struct {
	OutputFormat              string
	OutputContext             int
	StripTrailingCR           bool
	ShowSecrets               bool
	ShowSecretsDecoded        bool
	SuppressedKinds           []string
	FindRenames               float32
	SuppressedOutputLineRegex []string
	DiffToolCommand           string
	// contains filtered or unexported fields
}

Options are all the options to be passed to generate a diff

func (*Options) DiffTool added in v3.15.12

func (o *Options) DiffTool() bool

DiffTool reports whether the diff is rendered by an external tool, requested either with --diff-tool or through the HELM_DIFF_TOOL environment variable. The external tool overrides the built-in outputs, except that an explicit flag supersedes the environment variable (see IgnoreDiffToolEnvVar).

func (*Options) IgnoreDiffToolEnvVar added in v3.15.12

func (o *Options) IgnoreDiffToolEnvVar()

IgnoreDiffToolEnvVar stops the HELM_DIFF_TOOL environment variable from being consulted. It implements the "explicit flag over environment" precedence: a command requested with --diff-tool is authoritative even when empty, and an explicitly requested built-in output must not be silently overridden by a variable inherited e.g. from a shell profile.

func (*Options) StructuredOutput added in v3.15.0

func (o *Options) StructuredOutput() bool

StructuredOutput returns true when the structured JSON output is requested except when using a diff tool, whose input is the line diffs that structured output skips.

type OwnershipDiff added in v3.11.0

type OwnershipDiff struct {
	OldRelease string
	NewRelease string
}

type Report

type Report struct {
	Entries []ReportEntry
	// contains filtered or unexported fields
}

Report to store report data and format

func ManifestReport added in v3.13.1

func ManifestReport(oldIndex, newIndex map[string]*manifest.MappingResult, options *Options) (*Report, error)

type ReportEntry

type ReportEntry struct {
	Key             string
	SuppressedKinds []string
	Kind            string
	Context         int
	Diffs           []difflib.DiffRecord
	ChangeType      string
	Structured      *StructuredEntry
}

ReportEntry to store changes between releases

type ReportFormat

type ReportFormat struct {
	// contains filtered or unexported fields
}

ReportFormat to the context to make a changes report

type ReportTemplateSpec

type ReportTemplateSpec struct {
	Namespace string
	Name      string
	Kind      string
	API       string
	Change    string
}

ReportTemplateSpec for common template spec

type ResourceStatus added in v3.15.0

type ResourceStatus struct {
	OldExists bool `json:"oldExists"`
	NewExists bool `json:"newExists"`
}

ResourceStatus indicates whether manifests existed before or after the diff.

type StructuredEntry added in v3.15.0

type StructuredEntry struct {
	APIVersion        string         `json:"apiVersion,omitempty"`
	Kind              string         `json:"kind,omitempty"`
	Namespace         string         `json:"namespace,omitempty"`
	Name              string         `json:"name,omitempty"`
	ChangeType        string         `json:"changeType,omitempty"`
	ResourceStatus    ResourceStatus `json:"resourceStatus"`
	Changes           []FieldChange  `json:"changes,omitempty"`
	ChangesSuppressed bool           `json:"changesSuppressed,omitempty"`
}

StructuredEntry captures machine-readable diff information for a resource.

Jump to

Keyboard shortcuts

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