matcher

package
v0.9.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleMatch

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

BundleMatch stores the bundle and the matcher for the bundle

func New

func New(bundle *fleet.Bundle) (*BundleMatch, error)

func (*BundleMatch) Match

func (a *BundleMatch) Match(clusterName string, clusterGroups map[string]map[string]string, clusterLabels map[string]string) *fleet.BundleTarget

Match returns the first BundleTarget that matches the target criteria. Targets are evaluated in order. It checks for restrictions, which means that just targets included in the GitRepo can be returned. TargetCustomizations described in the fleet.yaml will be ignored. All GitRepo targets are added as TargetRestrictions, which acts as a whitelist.

func (*BundleMatch) MatchForTarget

func (a *BundleMatch) MatchForTarget(name string) *fleet.BundleTarget

func (*BundleMatch) MatchTargetCustomizations

func (a *BundleMatch) MatchTargetCustomizations(clusterName string, clusterGroups map[string]map[string]string, clusterLabels map[string]string) *fleet.BundleTarget

MatchTargetCustomizations returns the first BundleTarget that matches the target criteria. Targets are evaluated in order. It doesn't check for restrictions, which means TargetCustomizations described in the fleet.yaml are considered.

type ClusterMatcher

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

func NewClusterMatcher

func NewClusterMatcher(clusterName, clusterGroup string, clusterGroupSelector *metav1.LabelSelector, clusterSelector *metav1.LabelSelector) (*ClusterMatcher, error)

func (*ClusterMatcher) Match

func (t *ClusterMatcher) Match(clusterName, clusterGroup string, clusterGroupLabels, clusterLabels map[string]string) bool

Jump to

Keyboard shortcuts

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