nodeselector

package
v0.0.0-...-e053da5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClusterNodeCacheEmpty = fmt.Errorf("cluster nodes cache is empty (unreadable cluster config or not a cluster node)")
)

Functions

func Expand

func Expand(s string) ([]string, error)

Expand resolves a selector expression into a list of object paths

func WithClient

func WithClient(v *client.T) funcopt.O

WithClient is the api client to use when a clientcontext is set.

func WithLogger

func WithLogger(log zerolog.Logger) funcopt.O

WithLogger sets the logger

func WithNodesInfo

func WithNodesInfo(v node.NodesInfo) funcopt.O

WithNodesInfo allow in-daemon callers to bypass nodesinfo.Load as they can access the NodesInfo faster from the data bus.

Types

type ResultMap

type ResultMap map[string]any

func (ResultMap) Has

func (m ResultMap) Has(s string) bool

type T

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

func New

func New(selector string, opts ...funcopt.O) *T

New allocates a new node selector

func (*T) Expand

func (t *T) Expand() ([]string, error)

Expand resolves a selector expression into a list of nodes.

First try to resolve using the daemon (remote or local), as the daemons know all cluster objects, even remote ones. If executed on a cluster node, fallback to a local selector, which looks up knownNodes state files.

func (*T) ExpandMap

func (t *T) ExpandMap() (ResultMap, error)

func (T) KnownLocalNodes

func (t T) KnownLocalNodes() ([]string, error)

func (T) KnownNodes

func (t T) KnownNodes() ([]string, error)

func (T) KnownRemoteNodes

func (t T) KnownRemoteNodes() ([]string, error)

func (T) String

func (t T) String() string

Jump to

Keyboard shortcuts

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