Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-12-07 02:05:46 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-12-07 02:05:46 +0300
commit2828e3b72a0a786736c2d6bcd5f591d5034e2754 (patch)
tree0da9e983b64456a66a6a11b7d72c429b48991c88
parentd228c13c76d11091f8514e40940dc7df1b633e5a (diff)
parentde1ed60a4ca16ee397c2efc343cc1f765952db07 (diff)
Merge branch 'move-cache-key-from-zipvfs-object' into 'master'
refactor: move keyFromPath our of zipVfs object See merge request gitlab-org/gitlab-pages!632
-rw-r--r--internal/vfs/zip/vfs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/vfs/zip/vfs.go b/internal/vfs/zip/vfs.go
index a9825190..d2db1606 100644
--- a/internal/vfs/zip/vfs.go
+++ b/internal/vfs/zip/vfs.go
@@ -144,7 +144,7 @@ func (zfs *zipVFS) resetCache() {
})
}
-func (zfs *zipVFS) keyFromPath(path string) (string, error) {
+func keyFromPath(path string) (string, error) {
// We assume that our URL is https://.../artifacts.zip?content-sign=aaa
// our caching key is `https://.../artifacts.zip`
// TODO: replace caching key with file_sha256
@@ -168,7 +168,7 @@ func (zfs *zipVFS) keyFromPath(path string) (string, error) {
func (zfs *zipVFS) Root(ctx context.Context, path string, cacheKey string) (vfs.Root, error) {
// TODO: update acceptance tests mocked response to return a cacheKey
if cacheKey == "" {
- k, err := zfs.keyFromPath(path)
+ k, err := keyFromPath(path)
if err != nil {
return nil, err
}