From 1fc8d35c0f20332192d9127eadb12208748902bf Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Fri, 20 Oct 2023 14:07:36 +0200 Subject: [PATCH] bump module version to v2 to reflect a major refactoring Signed-off-by: Nicolas De Loof --- cli/options.go | 12 ++++++------ cli/options_test.go | 6 +++--- dotenv/godotenv.go | 2 +- dotenv/godotenv_var_expansion_test.go | 2 +- format/volume.go | 2 +- format/volume_test.go | 2 +- go.mod | 2 +- interpolation/interpolation.go | 4 ++-- interpolation/interpolation_test.go | 2 +- loader/extends.go | 6 +++--- loader/full-struct_test.go | 2 +- loader/include.go | 6 +++--- loader/interpolate.go | 4 ++-- loader/loader.go | 20 ++++++++++---------- loader/loader_test.go | 2 +- loader/loader_windows_test.go | 2 +- loader/loader_yaml_test.go | 2 +- loader/mapstructure_test.go | 2 +- loader/normalize.go | 4 ++-- loader/normalize_test.go | 2 +- loader/null.go | 2 +- loader/paths.go | 2 +- loader/paths_test.go | 4 ++-- loader/validate.go | 4 ++-- loader/validate_test.go | 2 +- loader/with-version-struct_test.go | 2 +- override/extends.go | 2 +- override/merge.go | 2 +- override/uncity.go | 4 ++-- paths/resolve.go | 4 ++-- transform/build.go | 2 +- transform/build_test.go | 2 +- transform/canonical.go | 2 +- transform/dependson.go | 2 +- transform/external.go | 2 +- transform/include.go | 2 +- transform/ports.go | 4 ++-- transform/secrets.go | 2 +- transform/services.go | 2 +- transform/ssh.go | 2 +- transform/ssh_test.go | 2 +- transform/ulimits.go | 2 +- transform/volume.go | 4 ++-- types/project.go | 4 ++-- types/project_test.go | 2 +- validation/external.go | 4 ++-- validation/validation.go | 2 +- validation/volume.go | 2 +- 48 files changed, 79 insertions(+), 79 deletions(-) diff --git a/cli/options.go b/cli/options.go index 4fd39606..13be481f 100644 --- a/cli/options.go +++ b/cli/options.go @@ -26,12 +26,12 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" - "github.com/compose-spec/compose-go/consts" - "github.com/compose-spec/compose-go/dotenv" - "github.com/compose-spec/compose-go/errdefs" - "github.com/compose-spec/compose-go/loader" - "github.com/compose-spec/compose-go/types" - "github.com/compose-spec/compose-go/utils" + "github.com/compose-spec/compose-go/v2/consts" + "github.com/compose-spec/compose-go/v2/dotenv" + "github.com/compose-spec/compose-go/v2/errdefs" + "github.com/compose-spec/compose-go/v2/loader" + "github.com/compose-spec/compose-go/v2/types" + "github.com/compose-spec/compose-go/v2/utils" ) // ProjectOptions provides common configuration for loading a project. diff --git a/cli/options_test.go b/cli/options_test.go index 56087597..fcacf235 100644 --- a/cli/options_test.go +++ b/cli/options_test.go @@ -22,11 +22,11 @@ import ( "path/filepath" "testing" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" "gotest.tools/v3/assert" - "github.com/compose-spec/compose-go/consts" - "github.com/compose-spec/compose-go/utils" + "github.com/compose-spec/compose-go/v2/consts" + "github.com/compose-spec/compose-go/v2/utils" ) func TestProjectName(t *testing.T) { diff --git a/dotenv/godotenv.go b/dotenv/godotenv.go index 9b95c990..e6635ce3 100644 --- a/dotenv/godotenv.go +++ b/dotenv/godotenv.go @@ -20,7 +20,7 @@ import ( "regexp" "strings" - "github.com/compose-spec/compose-go/template" + "github.com/compose-spec/compose-go/v2/template" ) var utf8BOM = []byte("\uFEFF") diff --git a/dotenv/godotenv_var_expansion_test.go b/dotenv/godotenv_var_expansion_test.go index a78fc590..99729cba 100644 --- a/dotenv/godotenv_var_expansion_test.go +++ b/dotenv/godotenv_var_expansion_test.go @@ -3,7 +3,7 @@ package dotenv import ( "testing" - "github.com/compose-spec/compose-go/template" + "github.com/compose-spec/compose-go/v2/template" "github.com/stretchr/testify/assert" ) diff --git a/format/volume.go b/format/volume.go index 2f8d6158..33f1667e 100644 --- a/format/volume.go +++ b/format/volume.go @@ -21,7 +21,7 @@ import ( "unicode" "unicode/utf8" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" "github.com/pkg/errors" ) diff --git a/format/volume_test.go b/format/volume_test.go index 86e835ac..c4de0b2e 100644 --- a/format/volume_test.go +++ b/format/volume_test.go @@ -20,7 +20,7 @@ import ( "fmt" "testing" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/go.mod b/go.mod index df081872..e5c61b0b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/compose-spec/compose-go +module github.com/compose-spec/compose-go/v2 go 1.19 diff --git a/interpolation/interpolation.go b/interpolation/interpolation.go index 30573083..86fd6e93 100644 --- a/interpolation/interpolation.go +++ b/interpolation/interpolation.go @@ -19,8 +19,8 @@ package interpolation import ( "os" - "github.com/compose-spec/compose-go/template" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/template" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" ) diff --git a/interpolation/interpolation_test.go b/interpolation/interpolation_test.go index 29d83ef9..e5056b2f 100644 --- a/interpolation/interpolation_test.go +++ b/interpolation/interpolation_test.go @@ -21,7 +21,7 @@ import ( "strconv" "testing" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/loader/extends.go b/loader/extends.go index 2c9b91bf..6fa611a1 100644 --- a/loader/extends.go +++ b/loader/extends.go @@ -21,9 +21,9 @@ import ( "fmt" "path/filepath" - "github.com/compose-spec/compose-go/consts" - "github.com/compose-spec/compose-go/override" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/consts" + "github.com/compose-spec/compose-go/v2/override" + "github.com/compose-spec/compose-go/v2/types" ) func ApplyExtends(ctx context.Context, dict map[string]any, workingdir string, opts *Options, ct *cycleTracker, post ...PostProcessor) error { diff --git a/loader/full-struct_test.go b/loader/full-struct_test.go index 3e966cee..e035a101 100644 --- a/loader/full-struct_test.go +++ b/loader/full-struct_test.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" ) func fullExampleProject(workingDir, homeDir string) *types.Project { diff --git a/loader/include.go b/loader/include.go index 02f26d9d..037a4022 100644 --- a/loader/include.go +++ b/loader/include.go @@ -23,9 +23,9 @@ import ( "reflect" "strings" - "github.com/compose-spec/compose-go/dotenv" - interp "github.com/compose-spec/compose-go/interpolation" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/dotenv" + interp "github.com/compose-spec/compose-go/v2/interpolation" + "github.com/compose-spec/compose-go/v2/types" "github.com/pkg/errors" ) diff --git a/loader/interpolate.go b/loader/interpolate.go index 655e58e1..3ce41402 100644 --- a/loader/interpolate.go +++ b/loader/interpolate.go @@ -20,8 +20,8 @@ import ( "strconv" "strings" - interp "github.com/compose-spec/compose-go/interpolation" - "github.com/compose-spec/compose-go/tree" + interp "github.com/compose-spec/compose-go/v2/interpolation" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/loader/loader.go b/loader/loader.go index 9076ed0d..e15d4377 100644 --- a/loader/loader.go +++ b/loader/loader.go @@ -28,16 +28,16 @@ import ( "strconv" "strings" - "github.com/compose-spec/compose-go/consts" - interp "github.com/compose-spec/compose-go/interpolation" - "github.com/compose-spec/compose-go/override" - "github.com/compose-spec/compose-go/paths" - "github.com/compose-spec/compose-go/schema" - "github.com/compose-spec/compose-go/template" - "github.com/compose-spec/compose-go/transform" - "github.com/compose-spec/compose-go/tree" - "github.com/compose-spec/compose-go/types" - "github.com/compose-spec/compose-go/validation" + "github.com/compose-spec/compose-go/v2/consts" + interp "github.com/compose-spec/compose-go/v2/interpolation" + "github.com/compose-spec/compose-go/v2/override" + "github.com/compose-spec/compose-go/v2/paths" + "github.com/compose-spec/compose-go/v2/schema" + "github.com/compose-spec/compose-go/v2/template" + "github.com/compose-spec/compose-go/v2/transform" + "github.com/compose-spec/compose-go/v2/tree" + "github.com/compose-spec/compose-go/v2/types" + "github.com/compose-spec/compose-go/v2/validation" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" "gopkg.in/yaml.v3" diff --git a/loader/loader_test.go b/loader/loader_test.go index 03dd3c49..8a6f5024 100644 --- a/loader/loader_test.go +++ b/loader/loader_test.go @@ -32,7 +32,7 @@ import ( "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" ) func buildConfigDetails(yaml string, env map[string]string) types.ConfigDetails { diff --git a/loader/loader_windows_test.go b/loader/loader_windows_test.go index dfceee5f..ce98247b 100644 --- a/loader/loader_windows_test.go +++ b/loader/loader_windows_test.go @@ -19,7 +19,7 @@ package loader import ( "testing" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" "gotest.tools/v3/assert" ) diff --git a/loader/loader_yaml_test.go b/loader/loader_yaml_test.go index 7a2dedf8..c02129bb 100644 --- a/loader/loader_yaml_test.go +++ b/loader/loader_yaml_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" "gotest.tools/v3/assert" ) diff --git a/loader/mapstructure_test.go b/loader/mapstructure_test.go index 319483f3..74689061 100644 --- a/loader/mapstructure_test.go +++ b/loader/mapstructure_test.go @@ -19,7 +19,7 @@ package loader import ( "testing" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" "github.com/mitchellh/mapstructure" "gotest.tools/v3/assert" ) diff --git a/loader/normalize.go b/loader/normalize.go index 58863b5f..a9ce9557 100644 --- a/loader/normalize.go +++ b/loader/normalize.go @@ -20,8 +20,8 @@ import ( "fmt" "strings" - "github.com/compose-spec/compose-go/errdefs" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/errdefs" + "github.com/compose-spec/compose-go/v2/types" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/loader/normalize_test.go b/loader/normalize_test.go index e290f14a..f7bf793d 100644 --- a/loader/normalize_test.go +++ b/loader/normalize_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" "gotest.tools/v3/assert" ) diff --git a/loader/null.go b/loader/null.go index 26a48c0b..d3e99f4b 100644 --- a/loader/null.go +++ b/loader/null.go @@ -20,7 +20,7 @@ import ( "fmt" "strconv" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "gopkg.in/yaml.v3" ) diff --git a/loader/paths.go b/loader/paths.go index 4b95d425..17b11d32 100644 --- a/loader/paths.go +++ b/loader/paths.go @@ -21,7 +21,7 @@ import ( "path/filepath" "strings" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" ) // ResolveRelativePaths resolves relative paths based on project WorkingDirectory diff --git a/loader/paths_test.go b/loader/paths_test.go index c098d161..fdcdda57 100644 --- a/loader/paths_test.go +++ b/loader/paths_test.go @@ -22,7 +22,7 @@ import ( "path/filepath" "testing" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" "gotest.tools/v3/assert" ) @@ -100,7 +100,7 @@ services: "image": "docker-image://foo", "oci": "oci-layout://foo", "abs_path": abs, - "github": "github.com/compose-spec/compose-go", + "github": "github.com/compose-spec/compose-go/v2", "rel_path": filepath.Join(wd, "testdata"), }, } diff --git a/loader/validate.go b/loader/validate.go index b4c42c7f..923c7f66 100644 --- a/loader/validate.go +++ b/loader/validate.go @@ -20,8 +20,8 @@ import ( "fmt" "strings" - "github.com/compose-spec/compose-go/errdefs" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/errdefs" + "github.com/compose-spec/compose-go/v2/types" "github.com/pkg/errors" ) diff --git a/loader/validate_test.go b/loader/validate_test.go index 959f7a31..0c3e891f 100644 --- a/loader/validate_test.go +++ b/loader/validate_test.go @@ -21,7 +21,7 @@ import ( "gotest.tools/v3/assert" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" ) func TestValidateAnonymousVolume(t *testing.T) { diff --git a/loader/with-version-struct_test.go b/loader/with-version-struct_test.go index f2d0c552..cb9d0355 100644 --- a/loader/with-version-struct_test.go +++ b/loader/with-version-struct_test.go @@ -19,7 +19,7 @@ package loader import ( "path/filepath" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/types" ) func withVersionExampleConfig() *types.Config { diff --git a/override/extends.go b/override/extends.go index 795269ad..f47912dd 100644 --- a/override/extends.go +++ b/override/extends.go @@ -16,7 +16,7 @@ package override -import "github.com/compose-spec/compose-go/tree" +import "github.com/compose-spec/compose-go/v2/tree" func ExtendService(base, override map[string]any) (map[string]any, error) { yaml, err := mergeYaml(base, override, tree.NewPath("services.x")) diff --git a/override/merge.go b/override/merge.go index 28a8d25f..66ea8a3f 100644 --- a/override/merge.go +++ b/override/merge.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "golang.org/x/exp/slices" ) diff --git a/override/uncity.go b/override/uncity.go index 5cdfada0..854f6086 100644 --- a/override/uncity.go +++ b/override/uncity.go @@ -21,8 +21,8 @@ import ( "strconv" "strings" - "github.com/compose-spec/compose-go/format" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/format" + "github.com/compose-spec/compose-go/v2/tree" ) type indexer func(any, tree.Path) (string, error) diff --git a/paths/resolve.go b/paths/resolve.go index 7e895c45..c23a717d 100644 --- a/paths/resolve.go +++ b/paths/resolve.go @@ -20,8 +20,8 @@ import ( "fmt" "path/filepath" - "github.com/compose-spec/compose-go/tree" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/tree" + "github.com/compose-spec/compose-go/v2/types" "github.com/pkg/errors" ) diff --git a/transform/build.go b/transform/build.go index f00ed228..505228c3 100644 --- a/transform/build.go +++ b/transform/build.go @@ -17,7 +17,7 @@ package transform import ( - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" ) diff --git a/transform/build_test.go b/transform/build_test.go index ac87b258..d9eab59e 100644 --- a/transform/build_test.go +++ b/transform/build_test.go @@ -20,7 +20,7 @@ import ( "reflect" "testing" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "gotest.tools/v3/assert" ) diff --git a/transform/canonical.go b/transform/canonical.go index 38af7063..391317a1 100644 --- a/transform/canonical.go +++ b/transform/canonical.go @@ -17,7 +17,7 @@ package transform import ( - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" ) type transformFunc func(data any, p tree.Path) (any, error) diff --git a/transform/dependson.go b/transform/dependson.go index 90f35233..fbaaff26 100644 --- a/transform/dependson.go +++ b/transform/dependson.go @@ -19,7 +19,7 @@ package transform import ( "fmt" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" ) diff --git a/transform/external.go b/transform/external.go index 10a6128e..7b57e7e5 100644 --- a/transform/external.go +++ b/transform/external.go @@ -19,7 +19,7 @@ package transform import ( "fmt" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/transform/include.go b/transform/include.go index ca64ca7f..c39be11f 100644 --- a/transform/include.go +++ b/transform/include.go @@ -17,7 +17,7 @@ package transform import ( - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" ) diff --git a/transform/ports.go b/transform/ports.go index e0fbc42d..edf8e350 100644 --- a/transform/ports.go +++ b/transform/ports.go @@ -19,8 +19,8 @@ package transform import ( "fmt" - "github.com/compose-spec/compose-go/tree" - "github.com/compose-spec/compose-go/types" + "github.com/compose-spec/compose-go/v2/tree" + "github.com/compose-spec/compose-go/v2/types" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" ) diff --git a/transform/secrets.go b/transform/secrets.go index 5c3eed93..11f8855a 100644 --- a/transform/secrets.go +++ b/transform/secrets.go @@ -19,7 +19,7 @@ package transform import ( "fmt" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" ) func transformFileMount(data any, p tree.Path) (any, error) { diff --git a/transform/services.go b/transform/services.go index e1fea681..a57fc613 100644 --- a/transform/services.go +++ b/transform/services.go @@ -17,7 +17,7 @@ package transform import ( - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" ) func transformService(data any, p tree.Path) (any, error) { diff --git a/transform/ssh.go b/transform/ssh.go index 4877e191..89801f6f 100644 --- a/transform/ssh.go +++ b/transform/ssh.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" ) diff --git a/transform/ssh_test.go b/transform/ssh_test.go index b97002b1..7f4caaac 100644 --- a/transform/ssh_test.go +++ b/transform/ssh_test.go @@ -19,7 +19,7 @@ package transform import ( "testing" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "gotest.tools/v3/assert" ) diff --git a/transform/ulimits.go b/transform/ulimits.go index 5fa16c96..c094b4c1 100644 --- a/transform/ulimits.go +++ b/transform/ulimits.go @@ -17,7 +17,7 @@ package transform import ( - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" ) diff --git a/transform/volume.go b/transform/volume.go index 3ddc137f..a5bac1ab 100644 --- a/transform/volume.go +++ b/transform/volume.go @@ -17,8 +17,8 @@ package transform import ( - "github.com/compose-spec/compose-go/format" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/format" + "github.com/compose-spec/compose-go/v2/tree" "github.com/pkg/errors" ) diff --git a/types/project.go b/types/project.go index 713b2074..8296f995 100644 --- a/types/project.go +++ b/types/project.go @@ -24,8 +24,8 @@ import ( "path/filepath" "sort" - "github.com/compose-spec/compose-go/dotenv" - "github.com/compose-spec/compose-go/utils" + "github.com/compose-spec/compose-go/v2/dotenv" + "github.com/compose-spec/compose-go/v2/utils" "github.com/distribution/reference" godigest "github.com/opencontainers/go-digest" "github.com/pkg/errors" diff --git a/types/project_test.go b/types/project_test.go index 8bf7e899..4220079a 100644 --- a/types/project_test.go +++ b/types/project_test.go @@ -20,7 +20,7 @@ import ( _ "crypto/sha256" "testing" - "github.com/compose-spec/compose-go/utils" + "github.com/compose-spec/compose-go/v2/utils" "github.com/distribution/reference" "github.com/opencontainers/go-digest" "gotest.tools/v3/assert" diff --git a/validation/external.go b/validation/external.go index d724c0ff..9a5047d0 100644 --- a/validation/external.go +++ b/validation/external.go @@ -19,8 +19,8 @@ package validation import ( "fmt" - "github.com/compose-spec/compose-go/consts" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/consts" + "github.com/compose-spec/compose-go/v2/tree" ) func checkExternal(v map[string]any, p tree.Path) error { diff --git a/validation/validation.go b/validation/validation.go index 43246ee8..3dc49334 100644 --- a/validation/validation.go +++ b/validation/validation.go @@ -17,7 +17,7 @@ package validation import ( - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" ) type checkerFunc func(value any, p tree.Path) error diff --git a/validation/volume.go b/validation/volume.go index 13f7316b..5b400681 100644 --- a/validation/volume.go +++ b/validation/volume.go @@ -19,7 +19,7 @@ package validation import ( "fmt" - "github.com/compose-spec/compose-go/tree" + "github.com/compose-spec/compose-go/v2/tree" ) func checkVolume(value any, p tree.Path) error {