Help us shape the future of Go! Take the 2026 Go Developer Survey

compare

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package compare flattens rendered manifests into comparable snapshots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(a, b Snapshot, noise map[string]bool) bool

func Noise

func Noise(a, b Snapshot) map[string]bool

Noise returns the paths that differ between two renders of the same input, e.g. randAlphaNum secrets, generated certificates and their checksum annotations.

Types

type Change

type Change struct {
	Object string `json:"object"`
	Field  string `json:"field"`
	Before string `json:"before,omitempty"`
	After  string `json:"after,omitempty"`
}

Change is one field that differs between two snapshots. An empty Before or After means the field is absent on that side.

func Changes

func Changes(before, after Snapshot, noise map[string]bool) []Change

type Snapshot

type Snapshot map[string]string

Snapshot is a rendered release flattened to "<object id>:<field path>" -> JSON value. Keying by object identity instead of template file makes the comparison immune to resources moving between templates.

func Flatten

func Flatten(manifests map[string]string) (Snapshot, error)

Jump to

Keyboard shortcuts

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