-
Notifications
You must be signed in to change notification settings - Fork 330
waypoint.hcl: "labels" variable and selector functions #2065
Conversation
hclCtx, labels, err := cc.labels(hclCtx, app) | ||
if err != nil { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewers: the main reason I did it this way here is because I know we're going to introduce label filters and so on into choosing what plugin to use and various other things. So I set it up so that we already have the labels at the beginning of an operation (rather than say... figuring this out purely in the config package) so we can make those decisions for future features.
Note also, the docs here are focused on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏷️ 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sick.
This PR introduces the
labels
HCL variable that is a mapping of the finalized label set for an operation. "Finalized" here means: it has merged all the labels from various sources and this is the final set that will be stored in the database. This variable has multiple uses:To support these use cases, this PR also introduces the
selectormatch
andselectorlookup
functions. Please see the docs/examples for their usage.