Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: add a StaticWatcher utility constructor #116

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

creachadair
Copy link
Member

This helps with migration of secrets that need a Watcher in production, but
which still need static values for development and testing. The resulting
Watcher never notifies an update, but is valid and vends the provided secret.

While here, pull all the static constructors out into their own file, as the
store file is getting a bit unwieldy.

Updates tailscale/corp#22445

// This is useful as a placeholder for development, migration, and testing.
// The value reported by a static watcher never changes, and the watcher
// channel is never ready.
func StaticWatcher(value string) Watcher {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only new bit, the rest is moved from store.go

Copy link
Member Author

Choose a reason for hiding this comment

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

After discussion, I am going to propose a different approach.

This helps with migration of secrets that need a Watcher in production, but
which still need static values for development and testing. The resulting
Watcher never notifies an update, but is valid and vends the provided secret.

While here, pull all the static constructors out into their own file, as the
store file is getting a bit unwieldy.

Updates tailscale/corp#22445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants