kubernetes

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClientArguments = ClientArguments{
	HTTPClientConfig: commoncfg.DefaultHTTPClientConfig,
}

DefaultClientArguments holds default values for Arguments.

Functions

func ConvertSelectorToListOptions

func ConvertSelectorToListOptions(selector LabelSelector) (labels.Selector, error)

func NewQueuedEventHandler

func NewQueuedEventHandler(log log.Logger, queue workqueue.RateLimitingInterface) *queuedEventHandler

Types

type ClientArguments

type ClientArguments struct {
	APIServer        commoncfg.URL              `alloy:"api_server,attr,optional"`
	KubeConfig       string                     `alloy:"kubeconfig_file,attr,optional"`
	HTTPClientConfig commoncfg.HTTPClientConfig `alloy:",squash"`
}

ClientArguments controls how to connect to a Kubernetes cluster.

func (*ClientArguments) BuildRESTConfig

func (args *ClientArguments) BuildRESTConfig(l log.Logger) (*rest.Config, error)

BuildRESTConfig converts ClientArguments to a Kubernetes REST config.

func (*ClientArguments) SetToDefault

func (args *ClientArguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

func (*ClientArguments) Validate

func (args *ClientArguments) Validate() error

Validate implements syntax.Validator.

type Event

type Event struct {
	Typ       EventType
	ObjectKey string
}

This type must be hashable, so it is kept simple. The indexer will maintain a cache of current state, so this is mostly used for logging.

type EventType

type EventType string
const (
	EventTypeResourceChanged EventType = "resource-changed"
)

type LabelSelector

type LabelSelector struct {
	MatchLabels      map[string]string `alloy:"match_labels,attr,optional"`
	MatchExpressions []MatchExpression `alloy:"match_expression,block,optional"`
}

type MatchExpression

type MatchExpression struct {
	Key      string   `alloy:"key,attr"`
	Operator string   `alloy:"operator,attr"`
	Values   []string `alloy:"values,attr,optional"`
}

type RuleGroupDiff

type RuleGroupDiff struct {
	Kind    RuleGroupDiffKind
	Actual  rulefmt.RuleGroup
	Desired rulefmt.RuleGroup
}

type RuleGroupDiffKind

type RuleGroupDiffKind string
const (
	RuleGroupDiffKindAdd    RuleGroupDiffKind = "add"
	RuleGroupDiffKindRemove RuleGroupDiffKind = "remove"
	RuleGroupDiffKindUpdate RuleGroupDiffKind = "update"
)

type RuleGroupDiffsByNamespace

type RuleGroupDiffsByNamespace map[string][]RuleGroupDiff

func DiffRuleState

func DiffRuleState(desired, actual RuleGroupsByNamespace) RuleGroupDiffsByNamespace

type RuleGroupsByNamespace

type RuleGroupsByNamespace map[string][]rulefmt.RuleGroup

Jump to

Keyboard shortcuts

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