diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 0ab99c26c7..16b8aabcfe 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -19,6 +19,8 @@ import ( "testing" "time" + "github.com/buildpacks/pack/pkg/cache" + dockertypes "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/ghodss/yaml" @@ -32,7 +34,6 @@ import ( "github.com/buildpacks/pack/acceptance/config" "github.com/buildpacks/pack/acceptance/invoke" "github.com/buildpacks/pack/acceptance/managers" - "github.com/buildpacks/pack/internal/cache" "github.com/buildpacks/pack/internal/style" "github.com/buildpacks/pack/pkg/archive" h "github.com/buildpacks/pack/testhelpers" diff --git a/internal/build/fakes/cache.go b/internal/build/fakes/cache.go index 9115060715..c6df3a8e56 100644 --- a/internal/build/fakes/cache.go +++ b/internal/build/fakes/cache.go @@ -3,7 +3,7 @@ package fakes import ( "context" - "github.com/buildpacks/pack/internal/cache" + "github.com/buildpacks/pack/pkg/cache" ) type FakeCache struct { diff --git a/internal/build/lifecycle_execution.go b/internal/build/lifecycle_execution.go index 88002e3f79..036e0de1ba 100644 --- a/internal/build/lifecycle_execution.go +++ b/internal/build/lifecycle_execution.go @@ -8,6 +8,8 @@ import ( "path/filepath" "strconv" + "github.com/buildpacks/pack/pkg/cache" + "github.com/BurntSushi/toml" "github.com/buildpacks/lifecycle/api" "github.com/buildpacks/lifecycle/auth" @@ -17,7 +19,6 @@ import ( "golang.org/x/sync/errgroup" "github.com/buildpacks/pack/internal/builder" - "github.com/buildpacks/pack/internal/cache" "github.com/buildpacks/pack/internal/paths" "github.com/buildpacks/pack/internal/style" "github.com/buildpacks/pack/pkg/logging" diff --git a/internal/build/lifecycle_execution_test.go b/internal/build/lifecycle_execution_test.go index 4e5fdc0e72..be4353e2c8 100644 --- a/internal/build/lifecycle_execution_test.go +++ b/internal/build/lifecycle_execution_test.go @@ -12,6 +12,8 @@ import ( "testing" "time" + "github.com/buildpacks/pack/pkg/cache" + "github.com/BurntSushi/toml" "github.com/apex/log" ifakes "github.com/buildpacks/imgutil/fakes" @@ -27,7 +29,6 @@ import ( "github.com/buildpacks/pack/internal/build" "github.com/buildpacks/pack/internal/build/fakes" - "github.com/buildpacks/pack/internal/cache" "github.com/buildpacks/pack/pkg/dist" "github.com/buildpacks/pack/pkg/logging" h "github.com/buildpacks/pack/testhelpers" diff --git a/internal/build/lifecycle_executor.go b/internal/build/lifecycle_executor.go index c3d2fc53d5..126b0a241f 100644 --- a/internal/build/lifecycle_executor.go +++ b/internal/build/lifecycle_executor.go @@ -7,13 +7,14 @@ import ( "os" "time" + "github.com/buildpacks/pack/pkg/cache" + "github.com/buildpacks/imgutil" "github.com/buildpacks/lifecycle/api" "github.com/buildpacks/lifecycle/platform" "github.com/google/go-containerregistry/pkg/name" "github.com/buildpacks/pack/internal/builder" - "github.com/buildpacks/pack/internal/cache" "github.com/buildpacks/pack/internal/container" "github.com/buildpacks/pack/pkg/dist" "github.com/buildpacks/pack/pkg/logging" diff --git a/internal/commands/build.go b/internal/commands/build.go index 0414d22790..d93a61c1b1 100644 --- a/internal/commands/build.go +++ b/internal/commands/build.go @@ -7,11 +7,12 @@ import ( "strings" "time" + "github.com/buildpacks/pack/pkg/cache" + "github.com/google/go-containerregistry/pkg/name" "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/buildpacks/pack/internal/cache" "github.com/buildpacks/pack/internal/config" "github.com/buildpacks/pack/internal/style" "github.com/buildpacks/pack/pkg/client" diff --git a/internal/cache/bind_cache.go b/pkg/cache/bind_cache.go similarity index 100% rename from internal/cache/bind_cache.go rename to pkg/cache/bind_cache.go diff --git a/internal/cache/cache_opts.go b/pkg/cache/cache_opts.go similarity index 100% rename from internal/cache/cache_opts.go rename to pkg/cache/cache_opts.go diff --git a/internal/cache/cache_opts_test.go b/pkg/cache/cache_opts_test.go similarity index 100% rename from internal/cache/cache_opts_test.go rename to pkg/cache/cache_opts_test.go diff --git a/internal/cache/consts.go b/pkg/cache/consts.go similarity index 100% rename from internal/cache/consts.go rename to pkg/cache/consts.go diff --git a/internal/cache/image_cache.go b/pkg/cache/image_cache.go similarity index 100% rename from internal/cache/image_cache.go rename to pkg/cache/image_cache.go diff --git a/internal/cache/image_cache_test.go b/pkg/cache/image_cache_test.go similarity index 98% rename from internal/cache/image_cache_test.go rename to pkg/cache/image_cache_test.go index 904f6936fa..377376a0e8 100644 --- a/internal/cache/image_cache_test.go +++ b/pkg/cache/image_cache_test.go @@ -6,6 +6,8 @@ import ( "testing" "time" + "github.com/buildpacks/pack/pkg/cache" + "github.com/buildpacks/imgutil/local" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" @@ -15,7 +17,6 @@ import ( "github.com/sclevine/spec" "github.com/sclevine/spec/report" - "github.com/buildpacks/pack/internal/cache" h "github.com/buildpacks/pack/testhelpers" ) diff --git a/internal/cache/volume_cache.go b/pkg/cache/volume_cache.go similarity index 100% rename from internal/cache/volume_cache.go rename to pkg/cache/volume_cache.go diff --git a/internal/cache/volume_cache_test.go b/pkg/cache/volume_cache_test.go similarity index 99% rename from internal/cache/volume_cache_test.go rename to pkg/cache/volume_cache_test.go index abe826d856..1457b3b36a 100644 --- a/internal/cache/volume_cache_test.go +++ b/pkg/cache/volume_cache_test.go @@ -7,6 +7,8 @@ import ( "testing" "time" + "github.com/buildpacks/pack/pkg/cache" + "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/volume" "github.com/docker/docker/client" @@ -16,7 +18,6 @@ import ( "github.com/sclevine/spec" "github.com/sclevine/spec/report" - "github.com/buildpacks/pack/internal/cache" h "github.com/buildpacks/pack/testhelpers" ) diff --git a/pkg/client/build.go b/pkg/client/build.go index e113c91cb5..5a6cd8fb97 100644 --- a/pkg/client/build.go +++ b/pkg/client/build.go @@ -12,6 +12,8 @@ import ( "strings" "time" + "github.com/buildpacks/pack/pkg/cache" + "github.com/Masterminds/semver" "github.com/buildpacks/imgutil" "github.com/buildpacks/imgutil/layout" @@ -29,7 +31,6 @@ import ( "github.com/buildpacks/pack/internal/build" "github.com/buildpacks/pack/internal/builder" - "github.com/buildpacks/pack/internal/cache" internalConfig "github.com/buildpacks/pack/internal/config" pname "github.com/buildpacks/pack/internal/name" "github.com/buildpacks/pack/internal/stack"