target

package
v0.0.0-...-12a582f Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespace is the default value when no namespace is set
	DefaultNamespace string = "default"
)

Variables

This section is empty.

Functions

func FromLabels

func FromLabels(l labels.Labels) *selectors

FromLabels converts a collection of selectors from the much richer labels type to selectors

Types

type Resource

type Resource struct {
	Name   string
	ID     string
	Meta   interface{}
	Labels labels.Labels
	Config interface{}
}

Resource is a general representation of some kind of resource which a provider might handle (ec2 instance, k8s pod, lambda function)

type Resources

type Resources []Resource

Resources are a collection of Resource items

type Selection

type Selection struct {
	Data     Resources
	Selected Resources
}

Selection is the selection result of a select operation which uses target rules to grab a set of resources

func (*Selection) Add

func (s *Selection) Add(r Resource)

Add will add another resource to an entry in data but not selected

func (*Selection) Select

func (s *Selection) Select(p parameters.Parameters) []Resource

Select will take a list of resources in data, and apply selection criteria to those in order to segment and select a set of resources to include in selection

type Target

type Target struct {
	// ID (optional) should be set if we
	// are targeting an existing resource (ie: lambda, ec2)
	// that we want to make a clone of for seeding the base configuration
	// of variants with
	//
	// +optional
	ID string `json:"id,omitempty"`

	// Namespace represents a specific namespace you want to target
	// resources in, usually only applicable to kubernetes
	//
	// +optional
	Namespace string

	// Resource (optional) a specific external resource
	// such as ec2, lambda
	//
	// +optional
	Resource string `json:"resource,omitempty"`

	// Kind (optional) represents a Kubernetes specific kind/resource
	//
	// +optional
	Kind string `json:"kind,omitempty"`

	// Selectors
	// +optional
	Selectors *selectors `yaml:"selectors,omitempty" json:"selectors,omitempty"`

	// Count is the number to select from a collection target
	Count int

	// Selection is the criteria for fulfilling the count number when
	// we are selecting a collection and that size exceeds the count
	// possible options are random, oldest, newest
	Selection string
}

Target is a set of rules for targetting a resource, or collection of resources for performing some experiment operation

func (*Target) DeepCopy

func (t *Target) DeepCopy() *Target

DeepCopy is generated, don't edit

func (*Target) DeepCopyInto

func (t *Target) DeepCopyInto(out *Target)

DeepCopyInto is generated, don't edit

func (*Target) Empty

func (t *Target) Empty() bool

Empty returns true if all selector rules are unset or nil, ie: there are no selection criteria

func (*Target) SafeNamespace

func (t *Target) SafeNamespace() string

SafeNamespace returns the set namespace or 'default' in the case it is not set

func (*Target) Single

func (t *Target) Single() bool

Single returns true if we are targeting a single resource by its unique identifier

Jump to

Keyboard shortcuts

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