Skip to content

Commit

Permalink
fix(fs/git): remove accidental WithSemverResolver in fs.NewStore
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed May 21, 2024
1 parent d8a29e1 commit 4be45ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions internal/storage/fs/git/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ func NewSnapshotStore(ctx context.Context, logger *zap.Logger, url string, opts

store.repo, err = git.Clone(memory.NewStorage(), nil, cloneOpts)
if err != nil {
return nil, err
return nil, fmt.Errorf("performing initial clone: %w", err)
}

// do an initial fetch to setup remote tracking branches
if _, err := store.fetch(ctx, store.snaps.References()); err != nil {
return nil, err
if _, err := store.fetch(ctx, []string{store.baseRef}); err != nil {
return nil, fmt.Errorf("performing initial fetch: %w", err)
}
} else {
// fetch single reference
Expand All @@ -173,8 +173,10 @@ func NewSnapshotStore(ctx context.Context, logger *zap.Logger, url string, opts
}

if err := store.repo.FetchContext(ctx, &git.FetchOptions{
Auth: store.auth,
Depth: 1,
Auth: store.auth,
CABundle: store.caBundle,
InsecureSkipTLS: store.insecureSkipTLS,
Depth: 1,
RefSpecs: []config.RefSpec{
config.RefSpec(fmt.Sprintf("%[1]s:%[1]s", store.baseRef)),
},
Expand Down
1 change: 0 additions & 1 deletion internal/storage/fs/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func NewStore(ctx context.Context, logger *zap.Logger, cfg *config.Config) (_ st
case config.GitStorageType:
opts := []containers.Option[git.SnapshotStore]{
git.WithRef(cfg.Storage.Git.Ref),
git.WithSemverResolver(),
git.WithPollOptions(
storagefs.WithInterval(cfg.Storage.Git.PollInterval),
),
Expand Down

0 comments on commit 4be45ca

Please sign in to comment.