diff

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 12 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 diff compares two rendered manifests the way an operator needs to see them before an upgrade or a rollback: what is added, removed or changed, and which changes Kubernetes cannot apply in place. Secret values are compared but never shown.

The blocking rules match the chart's own render-diff gate, so a change the chart's CI calls breaking is one ntctl refuses to apply silently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	Kind string `json:"kind"`
	Name string `json:"name"`
	Op   Op     `json:"op"`
	// Blocking says why Kubernetes cannot apply the change in place, or why
	// it loses data. Empty when the change is safe.
	Blocking []string `json:"blocking,omitempty"`
	// Secret keys added, removed or with a new value. Values are never kept.
	SecretKeys *SecretKeys `json:"secretKeys,omitempty"`
	// Images are the containers whose image changes.
	Images []ImageChange `json:"images,omitempty"`
	// Unified is the diff of the resource, with Secret values hidden.
	Unified string `json:"-"`
}

Change is one resource that differs.

type ImageChange added in v0.10.0

type ImageChange struct {
	Container string `json:"container"`
	From      string `json:"from"`
	To        string `json:"to"`
}

ImageChange is one container's image before and after.

func (ImageChange) String added in v0.10.0

func (i ImageChange) String() string

String names the image once and shows the tag change, or both references when the repository changes too.

type Op

type Op string

Op is what happens to a resource.

const (
	Added   Op = "added"
	Removed Op = "removed"
	Changed Op = "changed"
)

Operations.

type Result

type Result struct {
	Changes []Change `json:"changes"`
}

Result is every change between two manifests.

func Compare

func Compare(from, to []manifest.Object) Result

Compare returns what changes when a release goes from one manifest to the other.

func (Result) Blocking

func (r Result) Blocking() []Change

Blocking returns the changes that cannot be applied safely.

func (Result) Components added in v0.10.0

func (r Result) Components() []ImageChange

Components returns each image whose version changes, once however many workloads run it: what an upgrade moves, independent of how many releases it spans. Images of added or removed workloads are not counted.

func (Result) Empty

func (r Result) Empty() bool

Empty reports whether nothing changes.

func (Result) Print

func (r Result) Print(w io.Writer, full bool)

Print writes a summary grouped by kind, the blocking changes, and with full set, each changed resource's diff.

type SecretKeys

type SecretKeys struct {
	Added   []string `json:"added,omitempty"`
	Removed []string `json:"removed,omitempty"`
	Changed []string `json:"changed,omitempty"`
}

SecretKeys summarises a Secret's change by key.

func (*SecretKeys) String

func (k *SecretKeys) String() string

Jump to

Keyboard shortcuts

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