Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Consul Config Sourcer Plugin #4045

Merged
merged 10 commits into from
Oct 20, 2022
Merged

Consul Config Sourcer Plugin #4045

merged 10 commits into from
Oct 20, 2022

Conversation

paladin-devops
Copy link
Contributor

This PR adds a new config sourcer plugin to support dynamic configuration from the Consul KV data store.

Example config source settings:
waypoint config source-set -type=consul -config=address=$CONSUL_HTTP_ADDR -config=token=$CONSUL_HTTP_TOKEN

Example waypoint.hcl snippet using this plugin:

  config {
    env = {
      "TEST" = dynamic("consul", {
        key  = "paladin"
      })
    }
  }

This plugin was authored by @mkeeler! 🎉

@paladin-devops paladin-devops changed the title [WIP] Consul Config Sourcer Plugin Consul Config Sourcer Plugin Oct 12, 2022
@paladin-devops paladin-devops marked this pull request as ready for review October 12, 2022 20:21
@paladin-devops paladin-devops requested review from a team October 12, 2022 20:21
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of nit-pick things, most of which are inconsequential but a few I'd like your thoughts on before 👍

builtin/consul/config_sourcer.go Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
builtin/consul/config_sourcer.go Outdated Show resolved Hide resolved
The function to start a Consul blocking query will now be called via a goroutine, rather than the contents of the function being entirely wrapped inside an anonymous function, called via a goroutine.
Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

Update Consul config sourcer plugin to sleep for 5 seconds before hitting the Consul KV API again, if there is no value change.
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants