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

diff

package
v7.3.3 Latest Latest
Warning

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

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

Documentation

Overview

Package diff provides a DiffEngine that computes configuration differences between old and new ClusterSpec values and classifies their update impact into in-place, reboot-required, and recreate-required categories.

It also provides helpers for merging provisioner-specific diffs into a single UpdateResult, deduplicating overlapping field names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeProvisionerDiff

func MergeProvisionerDiff(main, provisioner *clusterupdate.UpdateResult)

MergeProvisionerDiff merges provisioner-specific diff results into the main diff. Provisioner diffs may contain distribution-specific changes (node counts, etc.) that the Engine doesn't track. We avoid duplicating fields already covered by Engine by checking field names.

Types

type Engine

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

Engine computes configuration differences and classifies their impact.

func NewEngine

func NewEngine(distribution v1alpha1.Distribution, provider v1alpha1.Provider) *Engine

NewEngine creates a new diff engine for the given distribution and provider.

func (*Engine) CheckWorkloadTag

func (e *Engine) CheckWorkloadTag(
	oldTag, newTag string,
	gitOpsEngine v1alpha1.GitOpsEngine,
	result *clusterupdate.UpdateResult,
)

CheckWorkloadTag compares the currently deployed GitOps sync ref against the desired workload tag and appends an in-place change when they differ. This detects stale sync refs left by pre-v6.7.1 cluster creation. The caller is responsible for querying the cluster for oldTag and resolving newTag from the configuration.

func (*Engine) ComputeDiff

func (e *Engine) ComputeDiff(
	oldSpec, newSpec *v1alpha1.ClusterSpec,
	oldProvider, newProvider *v1alpha1.ProviderSpec,
) *clusterupdate.UpdateResult

ComputeDiff compares old and new ClusterSpec and ProviderSpec, and categorizes all changes.

Jump to

Keyboard shortcuts

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