Documentation
¶
Overview ¶
Package groups resolves the @group references of a node set expression.
A group source is one of three things: a table written in the configuration, one group per value of a node attribute, which is what the genders file used to provide, or the output of a command run on an infrastructure host, which is how the workload manager is asked what it currently knows.
Index ¶
- Constants
- type Options
- type Resolver
- func (r *Resolver) All(source string) (string, error)
- func (r *Resolver) DefaultSource() string
- func (r *Resolver) GroupsOf(node string) (map[string][]string, error)
- func (r *Resolver) List(source string) ([]string, error)
- func (r *Resolver) Resolve(source, group string) (string, error)
- func (r *Resolver) Sources() []string
- type TargetFunc
Constants ¶
const ( PlaceholderGroup = "$GROUP" PlaceholderNode = "$NODE" )
Placeholders an exec source's argument vector may carry. They are substituted as whole arguments, never expanded by a shell, so a group name cannot turn into a command.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Spec is the group configuration of the cluster.
Spec v1alpha1.GroupsSpec
// Inventory backs the attribute sources.
Inventory *inventory.Inventory
// Runner runs the commands of an exec source.
Runner transport.Runner
// Target resolves the host role an exec source runs on.
Target TargetFunc
// CacheDir holds the resolved groups of sources that ask to be cached.
// An empty directory keeps the cache in memory only.
CacheDir string
// Context bounds the commands an exec source runs. The nodeset resolver
// interface carries no context of its own, so it is held here.
Context context.Context
}
Options configure a resolver.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver implements nodeset.Resolver over the configured group sources.
func (*Resolver) DefaultSource ¶
DefaultSource implements nodeset.Resolver.
func (*Resolver) GroupsOf ¶
GroupsOf returns the groups of one node, across every source that can answer the question.