From 1430a0104c79eeddbfaa9e14cf2bb07ed73be9c2 Mon Sep 17 00:00:00 2001 From: gammazero Date: Tue, 16 Mar 2021 16:57:44 -0700 Subject: [PATCH] Update name of latest distribution path const --- repo/fsrepo/migrations/fetch_test.go | 2 +- repo/fsrepo/migrations/fetcher.go | 6 +++--- repo/fsrepo/migrations/httpfetcher.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index 7441e248e..4b5a48bd9 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -55,7 +55,7 @@ func createFakeArchive(name string, archZip bool, w io.Writer) { func TestGetDistPath(t *testing.T) { os.Unsetenv(envIpfsDistPath) distPath := GetDistPathEnv("") - if distPath != IpnsIpfsDist { + if distPath != LatestIpfsDist { t.Error("did not set default dist path") } diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index 23a2370ce..4bedafb63 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -9,8 +9,8 @@ import ( const ( // Current dirstibution to fetch migrations from CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y" - // Distribution IPNS path. Default for fetchers. - IpnsIpfsDist = "/ipns/dist.ipfs.io" + // Latest distribution path. Default for fetchers. + LatestIpfsDist = "/ipns/dist.ipfs.io" // Distribution environ variable envIpfsDistPath = "IPFS_DIST_PATH" @@ -77,7 +77,7 @@ func GetDistPathEnv(distPath string) string { return dist } if distPath == "" { - return IpnsIpfsDist + return LatestIpfsDist } return distPath } diff --git a/repo/fsrepo/migrations/httpfetcher.go b/repo/fsrepo/migrations/httpfetcher.go index efc43bef6..876457f10 100644 --- a/repo/fsrepo/migrations/httpfetcher.go +++ b/repo/fsrepo/migrations/httpfetcher.go @@ -32,7 +32,7 @@ var _ Fetcher = (*HttpFetcher)(nil) // Specifying 0 for fetchLimit sets the default, -1 means no limit. func NewHttpFetcher(distPath, gateway, userAgent string, fetchLimit int64) *HttpFetcher { f := &HttpFetcher{ - distPath: IpnsIpfsDist, + distPath: LatestIpfsDist, gateway: defaultGatewayURL, limit: defaultFetchLimit, }