Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Enqueue release on clone change only
Browse files Browse the repository at this point in the history
During the refactor of synchronization mechanics in #1906, this got
accidentally moved outside the condition that checks if we have a clone
or it needs updating, with the result that a release is always enqueued
on a signal from the mirror it is bound to.

Move it back inside the condition so we only enqueue releases we
actually have updates from git for.
  • Loading branch information
hiddeco committed May 23, 2019
1 parent e9c3718 commit 2061a2f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions integrations/helm/chartsync/chartsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ package chartsync
import (
"context"
"fmt"
"k8s.io/client-go/tools/cache"
"path/filepath"
"sort"
"sync"
Expand All @@ -52,7 +53,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/cache"
hapi_chart "k8s.io/helm/pkg/proto/hapi/chart"
hapi_release "k8s.io/helm/pkg/proto/hapi/release"

Expand Down Expand Up @@ -243,15 +243,15 @@ func (chs *ChartChangeSync) Run(stopCh <-chan struct{}, errc chan error, wg *syn
if cloneForChart.export != nil {
cloneForChart.export.Clean()
}
}

// Enqueue release
cacheKey, err := cache.MetaNamespaceKeyFunc(fhr.GetObjectMeta())
if err != nil {
continue
// we have a (new) clone, enqueue a release
cacheKey, err := cache.MetaNamespaceKeyFunc(fhr.GetObjectMeta())
if err != nil {
continue
}
chs.logger.Log("info", "enqueing release upgrade due to change in git chart source", "resource", fhr.ResourceID().String())
chs.releaseQueue.AddRateLimited(cacheKey)
}
chs.logger.Log("info", "enqueing release upgrade due to change in git chart source", "resource", fhr.ResourceID().String())
chs.releaseQueue.AddRateLimited(cacheKey)
}
}
case <-stopCh:
Expand Down

0 comments on commit 2061a2f

Please sign in to comment.