-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add --schedule
flag to usage run
command
#10678
Conversation
0f56f84
to
6cd3157
Compare
components/usage/cmd/run.go
Outdated
@@ -72,6 +73,7 @@ func run() *cobra.Command { | |||
} | |||
|
|||
cmd.Flags().BoolVar(&verbose, "verbose", false, "Toggle verbose logging (debug level)") | |||
cmd.Flags().DurationVar(&schedule, "schedule", 1*time.Minute, "The schedule on which the reconciler should run") |
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.
Side-note: Maybe also increase the default reconciliation loop period to 30min or 1h? (I'm a little worried about high-frequency logging noise)
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.
Rebased to change the default frequency to 1 hour.
@andrew-farries The
I wonder if we should do an extra step so that the Stripe secret also gets mounted as an |
To allow overriding the default scheduler when testing the reconciler locally. Change default to 1 hour.
6cd3157
to
4a15532
Compare
The stripe secret is already mounted into the usage component (#10631) The problem is that this PR doesn't set |
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.
Looks good to me and works like a charm! ✨
Many thanks. 🙏
Description
Add a
--schedule
flag to theusage run
command to allow setting the schedule on which the reconciler runs.The main motivation here is to make local development easier (don't have to wait 1 min after invoking the command to get a reconciliation run), but we'll probably want to set this in-cluster via a configmap later on.
Related Issue(s)
Part of #9036
How to test
DB_HOST=localhost DB_USERNAME=gitpod DB_PASSWORD=foo DB_PORT=3306 go run . run --api-key-file ./apikeys --schedule 5s
Reconciliation now runs after 5 seconds. Without the flag, reconciliation runs after 1m.
Release Notes