agenttags

package
v2.0.0-...-04e5d85 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JobTagsMatchAgentTags

func JobTagsMatchAgentTags(jobTags, agentTags map[string]string) bool

JobTagsMatchAgentTags returns true if and only if, for each tag key in `jobTags`: either the tag key is also present in `agentTags`, and the tag value in `jobTags` is "*" or the same as the tag value in `agentTags`

In the future, this may be expanded to: if the tag value `agentTags` is in some set of strings defined by the tag value in `jobTags` (eg a glob or regex) See https://buildkite.com/docs/agent/v3/cli-start#agent-targeting

func ToLabels

func ToLabels(tags []string) (map[string]string, []error)

ToLabels converts a slice of strings of the form `k=v` to a map where the key is `k` and the value is `v`. If any element of the slice does not have that form or if `k` is not a valid kubernetes label name or if `v` is not a valid kubernetes label value, it will not be inserted into the map and instead generate an error which will be appended to the second return value.

See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set

func ToMap

func ToMap(tags []string) (map[string]string, []error)

ToMap converts a slice of strings of the form `k=v` to a map where the key is `k` and the value is `v`. If any element of the slice does not have that form, it will not be inserted into the map and instead generate an error which will be appended to the second return value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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