label

package
v0.0.0-...-33ef25c Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance string

Instance is a label instance.

const (
	// Postsubmit indicates that the test should be run as part of a postsubmit run only.
	Postsubmit Instance = "postsubmit"

	// CustomSetup indicates that the test requires a custom Istio installation.
	CustomSetup Instance = "customsetup"

	// IPv4 indicates a test is only compatible with IPv4 clusters.
	// Any usage of this should have an associated GitHub issue to make it compatible with IPv6
	IPv4 Instance = "ipv4"
)

func Find

func Find(name string) (Instance, bool)

Find the label with the given name

type Selector

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

Selector is a Set of label filter expressions that get applied together to decide whether tests should be selected for execution or not.

func NewSelector

func NewSelector(present []Instance, absent []Instance) Selector

NewSelector returns a new selector based on the given presence/absence predicates.

func ParseSelector

func ParseSelector(s string) (Selector, error)

ParseSelector parses and returns a new instance of Selector.

func (*Selector) Excludes

func (f *Selector) Excludes(inputs Set) bool

Excludes returns false, if the given set of labels, even combined with new ones, could end up satisfying the Selector. It returns false, if Matches would never return true, even if new labels are added to the input set.

func (*Selector) Selects

func (f *Selector) Selects(inputs Set) bool

Selects returns true, if the given label set satisfies the Selector.

func (Selector) String

func (f Selector) String() string

type Set

type Set map[Instance]struct{}

Set is a set of labels

func NewSet

func NewSet(labels ...Instance) Set

NewSet returns a new label set.

func (Set) Add

func (l Set) Add(labels ...Instance) Set

Add adds the given labels and returns a new, combined set

func (Set) All

func (l Set) All() []Instance

All returns all labels in this set.

func (Set) Clone

func (l Set) Clone() Set

Clone this set of labels

func (Set) Merge

func (l Set) Merge(s Set) Set

Merge returns a set that is merging of l and s.

Jump to

Keyboard shortcuts

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