Skip to content

Commit

Permalink
chore: Clean up repo server imports (argoproj#14218)
Browse files Browse the repository at this point in the history
Signed-off-by: jannfis <jann@mistrust.net>
  • Loading branch information
jannfis authored and tesla59 committed Dec 16, 2023
1 parent cba1844 commit 06bbaba
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions reposerver/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
"github.com/argoproj/argo-cd/v2/reposerver/cache"
reposervercache "github.com/argoproj/argo-cd/v2/reposerver/cache"
"github.com/argoproj/argo-cd/v2/reposerver/metrics"
"github.com/argoproj/argo-cd/v2/util/app/discovery"
argopath "github.com/argoproj/argo-cd/v2/util/app/path"
Expand Down Expand Up @@ -85,7 +84,7 @@ type Service struct {
chartPaths io.TempPaths
gitRepoInitializer func(rootPath string) goio.Closer
repoLock *repositoryLock
cache *reposervercache.Cache
cache *cache.Cache
parallelismLimitSemaphore *semaphore.Weighted
metricsServer *metrics.MetricsServer
resourceTracking argo.ResourceTracking
Expand All @@ -110,7 +109,7 @@ type RepoServerInitConstants struct {
}

// NewService returns a new instance of the Manifest service
func NewService(metricsServer *metrics.MetricsServer, cache *reposervercache.Cache, initConstants RepoServerInitConstants, resourceTracking argo.ResourceTracking, gitCredsStore git.CredsStore, rootDir string) *Service {
func NewService(metricsServer *metrics.MetricsServer, cache *cache.Cache, initConstants RepoServerInitConstants, resourceTracking argo.ResourceTracking, gitCredsStore git.CredsStore, rootDir string) *Service {
var parallelismLimitSemaphore *semaphore.Weighted
if initConstants.ParallelismLimit > 0 {
parallelismLimitSemaphore = semaphore.NewWeighted(initConstants.ParallelismLimit)
Expand Down Expand Up @@ -792,7 +791,7 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA,
// rather than a copy of the cache that occurred before (a potentially lengthy) manifest generation.
innerRes := &cache.CachedManifestResponse{}
cacheErr := s.cache.GetManifests(cacheKey, appSourceCopy, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, innerRes, refSourceCommitSHAs)
if cacheErr != nil && cacheErr != reposervercache.ErrCacheMiss {
if cacheErr != nil && cacheErr != cache.ErrCacheMiss {
log.Warnf("manifest cache set error %s: %v", appSourceCopy.String(), cacheErr)
ch.errCh <- cacheErr
return
Expand Down Expand Up @@ -927,7 +926,7 @@ func (s *Service) getManifestCacheEntry(cacheKey string, q *apiclient.ManifestRe
return true, res.ManifestResponse, nil
}

if err != reposervercache.ErrCacheMiss {
if err != cache.ErrCacheMiss {
log.Warnf("manifest cache error %s: %v", q.ApplicationSource.String(), err)
} else {
log.Infof("manifest cache miss: %s/%s", q.ApplicationSource.String(), cacheKey)
Expand Down Expand Up @@ -1960,7 +1959,7 @@ func (s *Service) createGetAppDetailsCacheHandler(res *apiclient.RepoAppDetailsR
return true, nil
}

if err != reposervercache.ErrCacheMiss {
if err != cache.ErrCacheMiss {
log.Warnf("app details cache error %s: %v", revision, q.Source)
} else {
log.Infof("app details cache miss: %s/%s", revision, q.Source)
Expand Down Expand Up @@ -2167,7 +2166,7 @@ func (s *Service) GetRevisionMetadata(ctx context.Context, q *apiclient.RepoServ
return metadata, nil
}
} else {
if err != reposervercache.ErrCacheMiss {
if err != cache.ErrCacheMiss {
log.Warnf("revision metadata cache error %s/%s: %v", q.Repo.Repo, q.Revision, err)
} else {
log.Infof("revision metadata cache miss: %s/%s", q.Repo.Repo, q.Revision)
Expand Down Expand Up @@ -2230,7 +2229,7 @@ func (s *Service) GetRevisionChartDetails(ctx context.Context, q *apiclient.Repo
log.Infof("revision chart details cache hit: %s/%s/%s", q.Repo.Repo, q.Name, q.Revision)
return details, nil
} else {
if err == reposervercache.ErrCacheMiss {
if err == cache.ErrCacheMiss {
log.Infof("revision metadata cache miss: %s/%s/%s", q.Repo.Repo, q.Name, q.Revision)
} else {
log.Warnf("revision metadata cache error %s/%s/%s: %v", q.Repo.Repo, q.Name, q.Revision, err)
Expand Down

0 comments on commit 06bbaba

Please sign in to comment.