diff

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffContext

type DiffContext struct {
	Store store.Storer[store.Storer[data.BlockData]]
	// contains filtered or unexported fields
}

func NewDiffContext

func NewDiffContext(prefix string, s store.Storer[store.Storer[data.BlockData]]) (*DiffContext, error)

func (*DiffContext) DeleteDir

func (r *DiffContext) DeleteDir() error

func (*DiffContext) DeleteStoreItem

func (r *DiffContext) DeleteStoreItem(ctx context.Context, pkgName, blockName string, rn *yaml.RNode) error

func (*DiffContext) GetStoreItem

func (r *DiffContext) GetStoreItem(ctx context.Context, pkgName, blockName string, rn *yaml.RNode) runtime.Object

func (*DiffContext) Path

func (r *DiffContext) Path() string

func (*DiffContext) Print

func (r *DiffContext) Print(fileName string, obj runtime.Object) error

type Differ

type Differ struct {
	From *DiffContext
	To   *DiffContext
}

func NewDiffer

func NewDiffer(from, to store.Storer[store.Storer[data.BlockData]]) (*Differ, error)

func (*Differ) FromPath

func (r *Differ) FromPath() string

func (*Differ) GetResourceToPrune

func (r *Differ) GetResourceToPrune() store.Storer[store.Storer[data.BlockData]]

func (*Differ) Run

func (r *Differ) Run(ctx context.Context) error

Run first prints the files in the respective directories and applies masking if needed for sensitive data On top we prune the from with the netries that are in common Afterwards the

func (*Differ) TearDown

func (r *Differ) TearDown()

func (*Differ) ToPath

func (r *Differ) ToPath() string

type Masker

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

Masker masks sensitive values in an object while preserving diff-able changes.

All sensitive values in the object will be masked with a fixed-length asterisk mask. If two values are different, an additional suffix will be added so they can be diff-ed.

func NewMasker

func NewMasker(from, to runtime.Object) (*Masker, error)

func (*Masker) From

func (r *Masker) From() runtime.Object

From returns the masked version of the 'from' object.

func (*Masker) To

func (r *Masker) To() runtime.Object

To returns the masked version of the 'to' object.

Jump to

Keyboard shortcuts

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