-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add --git-timeout configuration flags #1416
Conversation
I don't know who takes care of the helm chart, but it would be nice to add the option there as well. I tested and it fixed the problem I was having, thanks a lot. |
|
||
// Chart releases sync due to Custom Resources changes ------------------------------- | ||
{ | ||
mainLogger.Log("info", "Attempting to clone repo ...", "url", gitRemote.URL) | ||
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute) | ||
ctx, cancel := context.WithCancel(context.Background()) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
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 have reservations over using the same timeout for all git operations -- increasing the timeout for git clone
might mean that other operations take much longer to fail. But I don't know that's a problem, and it can be addressed if it turns out to be. Meanwhile, this is worth it just for removing all the ad-hoc constants :-)
One request, as commented.
cmd/fluxd/main.go
Outdated
@@ -93,6 +93,7 @@ func main() { | |||
gitSkipMessage = fs.String("git-ci-skip-message", "", "additional text for commit messages, useful for skipping builds in CI. Use this to supply specific text, or set --git-ci-skip") | |||
|
|||
gitPollInterval = fs.Duration("git-poll-interval", 5*time.Minute, "period at which to poll git repo for new commits") | |||
gitTimeOut = fs.Duration("git-time-out", 20*time.Second, "duration after which git operations time out") |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
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.
Grand, thanks Hidde 🐝
chart/flux/README.md
Outdated
@@ -190,7 +190,7 @@ The following tables lists the configurable parameters of the Weave Flux chart a | |||
| `git.label` | Label to keep track of sync progress, used to tag the Git branch | `flux-sync` | |||
| `git.ciSkip` | Append "[ci skip]" to commit messages so that CI will skip builds | `false` | |||
| `git.pollInterval` | Period at which to poll git repo for new commits | `5m` | |||
| `git.timeOut` | Duration after which git operations time out | `20s` | |||
| `git.timeout` | Duration after which git operations timeout | `20s` |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
5978219
to
b9c21dc
Compare
the Is it possible for it to use Having the |
@latchmihay your reasoning makes sense to me and the additional I will turn it into a PR tomorrow and see what others think. |
Closes #1414
This PR adds a
--git-time-out
--git-timeout
flag to both fluxd and the helm operator.I was unsure what to do with the
gitOpTimeout
constant indaemon/loop.go:25
. If someone could give me guidance in this I am more than happy to make additional changes.Resulting builds from changes in this PR can be pulled and tested from:
hiddeco/flux:1414-git-timeout-9dc6b2181744
hiddeco/helm-operator:1414-git-timeout-9dc6b2181744