-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow predefining targets at startup #16
Conversation
- Use of spf13/cobra for command line parsing - Moved actual proxying code to own package - Added golangci config - Upgraded golang version to 1.16 Signed-off-by: Jeroen van Erp <jeroen@hierynomus.com>
- Split up code over several structs - Improved cleanup/shutdown logic - Added flag to start with set of mirrors configured Signed-off-by: Jeroen van Erp <jeroen@hierynomus.com>
Signed-off-by: Jeroen van Erp <jeroen@hierynomus.com>
cmd/root.go
Outdated
cmd.Flags().String("password", "", "Provide a file that contains username/password to protect the configuration 'targets' endpoint. Contains 1 username/password combination separated by ':'.") | ||
cmd.Flags().Int("fail-after", 30, "Remove a target when it has been failing for this many minutes.") //nolint:gomnd | ||
cmd.Flags().Int("retry-after", 1, "After 5 successive failures a target is temporarily disabled, it will be retried after this many minutes.") | ||
cmd.Flags().StringSlice("mirror", []string{}, "Mirror traffic to additional targets") |
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.
I prefer to rephrase this to something like "Start with mirroring to these targets"
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestReflector(t *testing.T) { |
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.
Nice. A test!
Thanks for the refactoring. The code looks a lot cleaner now tbh. |
Note that these pre-configured targets may still disappear from the targets list right now when they are offline for more than the configured time. |
No description provided.