merge

package
v0.0.0-...-c7d747a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MergeCommentPrefix = "kpt-merge:"
)

Variables

This section is empty.

Functions

func NsAndNameForMerge

func NsAndNameForMerge(metadataComment string) []string

NsAndNameForMerge returns the namespace and name for merge from the line comment on the metadata field e.g. metadata: # kpt-merge: default/foo returns [default, foo]

Types

type Merge3

type Merge3 struct {
	OriginalPath       string
	UpdatedPath        string
	DestPath           string
	MatchFilesGlob     []string
	MergeOnPath        bool
	IncludeSubPackages bool
}

Merge3 performs a 3-way merge on the original, upstream and destination packages. It provides support for doing this only for the parent package and ignore any subpackages. Whenever the boundaries of a package differs between original, upstream and destination, the boundaries in destination will be used.

func (Merge3) Merge

func (m Merge3) Merge() error

type PruningLocalPackageReader

type PruningLocalPackageReader struct {
	LocalPackageReader kio.LocalPackageReader
	Exclusions         []string
}

PruningLocalPackageReader implements the Reader interface. It is similar to the LocalPackageReader but allows for exclusion of subdirectories.

func (PruningLocalPackageReader) Read

func (p PruningLocalPackageReader) Read() ([]*yaml.RNode, error)

type ResourceMergeMatcher

type ResourceMergeMatcher struct {
	MergeOnPath bool
}

func (*ResourceMergeMatcher) IsSameResource

func (rm *ResourceMergeMatcher) IsSameResource(node1, node2 *yaml.RNode) bool

IsSameResource determines if 2 resources are same to be merged by matching GKNN+filepath Group, Kind are derived from resource metadata directly, Namespace and Name are derived from merge comment which is of format "kpt-merge: namespace/name", if the merge comment is not present, then it falls back to Namespace and Name on the resource meta

Jump to

Keyboard shortcuts

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