filters

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 8

Documentation

Overview

Package filters contains core implementations of the ComponentFilterStrategy interface.

Package filters contains core implementations of the ComponentFilterStrategy interface.

Package filters contains core implementations of the ComponentFilterStrategy interface.

Package filters contains core implementations of the ComponentFilterStrategy interface.

Package filters contains core implementations of the ComponentFilterStrategy interface.

Package filters contains core implementations of the ComponentFilterStrategy interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMultipleSameGroup    = fmt.Errorf("cannot specify multiple components from the same group")
	ErrNoDefaultOrSelection = fmt.Errorf("no default or selected component found")
	ErrNotFound             = fmt.Errorf("no compatible components found")
)

Errors for the deployment filter.

View Source
var ErrLocalOSRequired = errors.New("localOS is required")

ErrLocalOSRequired is returned when localOS is not set.

Functions

func Apply added in v0.84.0

func Apply(definition api.Package, filter ComponentFilterStrategy) (api.Package, error)

Apply returns a filtered package, retaining existing provenance and recording selectors from a successful ForDeploy application, including within Combine.

func NormalizeComponentSelectorList added in v1.0.0

func NormalizeComponentSelectorList(selectors []string) ([]string, error)

NormalizeComponentSelectorList returns a detached, normalized selector list. Entries are individual patterns, not comma-separated strings. Order and repetitions are preserved, and empty entries are discarded.

func NormalizeComponentSelectors added in v1.0.0

func NormalizeComponentSelectors(selectors string) (string, error)

NormalizeComponentSelectors normalizes selectors while preserving their order and repetitions.

func ParseComponentSelectors added in v1.0.0

func ParseComponentSelectors(selectors string) ([]string, error)

ParseComponentSelectors parses comma-separated selectors into a normalized, ordered list, preserving repetitions.

Types

type ComponentFilterStrategy

type ComponentFilterStrategy interface {
	// Apply returns the components to keep, in order.
	// Use the package-level Apply function to retain deployment selection provenance.
	Apply(api.Package) ([]api.Component, error)
}

ComponentFilterStrategy is a strategy interface for filtering components.

func ByComponentSelectors added in v1.0.0

func ByComponentSelectors(selectors []string) ComponentFilterStrategy

ByComponentSelectors selects components using an ordered list of names, globs, and exclusions. It takes a detached snapshot; invalid patterns fail on Apply.

func ByLocalOS

func ByLocalOS(localOS string) ComponentFilterStrategy

ByLocalOS creates a new filter that filters components based on local (runtime) OS.

func BySelectState

func BySelectState(optionalComponents string) ComponentFilterStrategy

BySelectState creates a new simple included filter.

func Combine

Combine creates a new filter that applies a sequence of filters.

func Empty

Empty returns a filter that does nothing.

func ForDeploy

func ForDeploy(optionalComponents string) ComponentFilterStrategy

ForDeploy creates a noninteractive deployment filter using explicit selectors, required components, and legacy v1alpha1 defaults and choice groups. An explicit group selection replaces other group members. Selectors are normalized when applied: case and surrounding whitespace are ignored, empty entries are discarded, and invalid glob patterns return an error. Use the package-level Apply function or a package layout's Filter method to record the selectors for deployment. A second deployment selection on the same package is rejected rather than replacing its provenance.

Jump to

Keyboard shortcuts

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