Skip to content

Commit

Permalink
Reimplement git timeout in chartsync
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hello@hidde.co>
  • Loading branch information
hiddeco committed Dec 3, 2018
1 parent 5cdd314 commit 5244ac0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/helm-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func main() {
chartSync := chartsync.New(log.With(logger, "component", "chartsync"),
chartsync.Polling{Interval: *chartsSyncInterval},
chartsync.Clients{KubeClient: *kubeClient, IfClient: *ifClient},
rel, chartsync.Config{LogDiffs: *logReleaseDiffs, UpdateDeps: *updateDependencies})
rel, chartsync.Config{LogDiffs: *logReleaseDiffs, UpdateDeps: *updateDependencies, GitTimeout: *gitTimeout})
chartSync.Run(shutdown, errc, shutdownWg)

// OPERATOR - CUSTOM RESOURCE CHANGE SYNC -----------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion integrations/helm/chartsync/chartsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type Config struct {
ChartCache string
LogDiffs bool
UpdateDeps bool
GitTimeout time.Duration
}

func (c Config) WithDefaults() Config {
Expand Down Expand Up @@ -264,7 +265,7 @@ func mirrorName(chartSource *fluxv1beta1.GitChartSource) string {
func (chs *ChartChangeSync) maybeMirror(fhr fluxv1beta1.HelmRelease) {
chartSource := fhr.Spec.ChartSource.GitChartSource
if chartSource != nil {
if ok := chs.mirrors.Mirror(mirrorName(chartSource), git.Remote{chartSource.GitURL}, git.ReadOnly); !ok {
if ok := chs.mirrors.Mirror(mirrorName(chartSource), git.Remote{chartSource.GitURL}, git.Timeout(chs.config.GitTimeout), git.ReadOnly); !ok {
chs.logger.Log("info", "started mirroring repo", "repo", chartSource.GitURL)
}
}
Expand Down

0 comments on commit 5244ac0

Please sign in to comment.