kustomizeinput

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package kustomizeinput classifies Kustomize's direct file and configuration inputs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kustomization

func Kustomization(k *types.Kustomization) iter.Seq[Reference]

Kustomization returns direct inputs without mutating the typed document.

func Local

func Local(root, dir, raw string) (string, bool)

Local resolves an input inside its source and returns source-relative coordinates.

func MappingValue

func MappingValue(node *yaml.Node, key string) *yaml.Node

MappingValue follows upstream's case-insensitive JSON field precedence.

func MetadataOnly

func MetadataOnly(doc *yaml.Node) bool

MetadataOnly reports whether a plugin can only change configuration metadata.

func PreservesOperands

func PreservesOperands(k *types.Kustomization) bool

PreservesOperands proves the narrow metadata-only configuration wrapper case.

func Resources

func Resources(body []byte) ([]*resource.Resource, error)

Resources uses the same inline resource grammar as Kustomize's plugin loader.

Types

type GitBase

type GitBase struct {
	RepoURL    string
	SubPath    string
	Ref        string
	Timeout    time.Duration
	Submodules bool
}

GitBase carries the effective repository, root and command policy of a remote operand.

func ParseGitBase

func ParseGitBase(raw string) (GitBase, bool)

ParseGitBase follows kustomize/api v0.21.2 internal/git.NewRepoSpecFromURL; Go's internal visibility requires adapting its grammar at this seam.

type HTTPPrefix

type HTTPPrefix struct{ Scheme, Rest string }

HTTPPrefix keeps the matched scheme separate from its remaining operand.

func CutHTTPScheme

func CutHTTPScheme(s string) (HTTPPrefix, bool)

CutHTTPScheme splits the HTTP scheme used by file acquisition.

type Reference

type Reference struct {
	Node      *yaml.Node
	Path      string
	Field     string
	Role      Role
	Inline    bool
	Resources []*resource.Resource
	Indices   [2]int
	// contains filtered or unexported fields
}

Reference retains an operand's immutable classification and its rewrite location.

func Plugin

func Plugin(doc *yaml.Node) ([]Reference, bool)

Plugin returns builtin configuration operands and whether the kind is known.

func (*Reference) Bind

func (r *Reference) Bind(doc *yaml.Node)

Bind attaches an input to a private render tree so rewrites retain comments.

func (*Reference) FieldPath

func (r *Reference) FieldPath() string

FieldPath returns the indexed selector for a diagnostic.

func (*Reference) Rewrite

func (r *Reference) Rewrite(value string)

Rewrite updates a private render input, retaining any generator key.

type Role

type Role uint8

Role distinguishes terminal inputs from accumulated resources and configurations.

const (
	// Resource is an accumulated resource file or directory.
	Resource Role = iota
	// Component is an accumulated component directory.
	Component
	// Configuration is a plugin configuration file, directory or inline resource.
	Configuration
	// File is a terminal input, never a resource to admit.
	File
)

Jump to

Keyboard shortcuts

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