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

Closed
wants to merge 1 commit into 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

@creachadair creachadair requested a review from danderson August 20, 2024 15:37
// 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
@creachadair creachadair deleted the mjf/static-watcher branch September 24, 2024 00:46
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