plan

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

pkg/plan

Computes the structured diff between two parsed Katalogs. Used by ork plan to show what would change if a local Katalog were applied to a cluster.

Usage

from, _ := katalog.ParseBytes(deployedYAML, ".")
to, _ := katalog.ParseFile("katalog.yaml")

diff := plan.ComputeKatalogDiff(from, to)
if diff.Empty() {
    fmt.Println("No changes.")
    return
}
diff.Print()

What the diff covers

Field Description
Added CRDs CRDs present in the local Katalog but not in the deployed one
Removed CRDs CRDs present in the deployed Katalog but not in the local one
Changed workers Per-CRD worker count change
Changed resync Per-CRD resync interval change
Changed crdFile crdFile path change
operatorBox resource counts Count changes per resource type in onCreate / onReconcile

The diff does not compare template internals — only the structural fields that affect operator behaviour.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDDiff

type CRDDiff struct {
	Name    string
	Changes []FieldChange
}

type FieldChange

type FieldChange struct {
	Path string
	From string // "" means new
	To   string // "" means removed
}

type KatalogDiff

type KatalogDiff struct {
	AddedCRDs   []string
	RemovedCRDs []string
	ChangedCRDs []CRDDiff
}

KatalogDiff holds the structured difference between two Katalogs.

func ComputeKatalogDiff

func ComputeKatalogDiff(from, to *katalog.Katalog) *KatalogDiff

ComputeKatalogDiff computes the structured diff between two Katalogs.

func (*KatalogDiff) Empty

func (d *KatalogDiff) Empty() bool

func (*KatalogDiff) Print

func (d *KatalogDiff) Print()

Jump to

Keyboard shortcuts

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