Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

ARG GO_VERSION=1.24.9
ARG XX_VERSION=1.6.1
ARG GOLANGCI_LINT_VERSION=v2.0.2
ARG GOLANGCI_LINT_VERSION=v2.6.2
ARG ADDLICENSE_VERSION=v1.0.0

ARG BUILD_TAGS="e2e"
Expand Down
4 changes: 2 additions & 2 deletions cmd/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ func (o *ProjectOptions) toProjectOptions(po ...cli.ProjectOptionsFn) (*cli.Proj
// if none was selected, get default compose.yaml file from current dir or parent folder
cli.WithDefaultConfigPath,
// .. and then, a project directory != PWD maybe has been set so let's load .env file
cli.WithEnvFiles(o.EnvFiles...),
cli.WithDotEnv,
cli.WithEnvFiles(o.EnvFiles...), //nolint:gocritic // intentionally applying cli.WithEnvFiles twice.
cli.WithDotEnv, //nolint:gocritic // intentionally applying cli.WithDotEnv twice.
// eventually COMPOSE_PROFILES should have been set
cli.WithDefaultProfiles(o.Profiles...),
cli.WithName(o.ProjectName),
Expand Down
1 change: 1 addition & 0 deletions cmd/formatter/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
// TemplateLegacyJSON the legacy json formatting value using go template
TemplateLegacyJSON = "{{json.}}"
// PRETTY is the constant for default formats on list commands
//
// Deprecated: use TABLE
PRETTY = "pretty"
// TABLE Print output in table format with column headers (default)
Expand Down
2 changes: 1 addition & 1 deletion cmd/formatter/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestPrint(t *testing.T) {
}

b := &bytes.Buffer{}
assert.NilError(t, Print(testList, PRETTY, b, func(w io.Writer) {
assert.NilError(t, Print(testList, TABLE, b, func(w io.Writer) {
for _, t := range testList {
_, _ = fmt.Fprintf(w, "%s\t%s\n", t.Name, t.Status)
}
Expand Down
10 changes: 8 additions & 2 deletions pkg/compose/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,18 @@ func (s *composeService) buildProjectOptions(options api.ProjectLoadOptions, rem
}

opts = append(opts,
// Load PWD/.env if present and no explicit --env-file has been set
cli.WithEnvFiles(options.EnvFiles...),
// read dot env file to populate project environment
cli.WithDotEnv,
// get compose file path set by COMPOSE_FILE
cli.WithConfigFileEnv,
// if none was selected, get default compose.yaml file from current dir or parent folder
cli.WithDefaultConfigPath,
cli.WithEnvFiles(options.EnvFiles...),
cli.WithDotEnv,
// .. and then, a project directory != PWD maybe has been set so let's load .env file
cli.WithEnvFiles(options.EnvFiles...), //nolint:gocritic // intentionally applying cli.WithEnvFiles twice.
cli.WithDotEnv, //nolint:gocritic // intentionally applying cli.WithDotEnv twice.
// eventually COMPOSE_PROFILES should have been set
cli.WithDefaultProfiles(options.Profiles...),
cli.WithName(options.ProjectName),
)
Expand Down
12 changes: 6 additions & 6 deletions pkg/compose/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ func (s *composeService) ensureModels(ctx context.Context, project *types.Projec
return nil
}

api, err := s.newModelAPI(project)
mdlAPI, err := s.newModelAPI(project)
if err != nil {
return err
}
defer api.Close()
availableModels, err := api.ListModels(ctx)
defer mdlAPI.Close()
availableModels, err := mdlAPI.ListModels(ctx)

eg, ctx := errgroup.WithContext(ctx)
eg.Go(func() error {
return api.SetModelVariables(ctx, project)
return mdlAPI.SetModelVariables(ctx, project)
})

for name, config := range project.Models {
Expand All @@ -57,12 +57,12 @@ func (s *composeService) ensureModels(ctx context.Context, project *types.Projec
}
eg.Go(func() error {
if !slices.Contains(availableModels, config.Model) {
err = api.PullModel(ctx, config, quietPull, s.events)
err = mdlAPI.PullModel(ctx, config, quietPull, s.events)
if err != nil {
return err
}
}
return api.ConfigureModel(ctx, config, s.events)
return mdlAPI.ConfigureModel(ctx, config, s.events)
})
}
return eg.Wait()
Expand Down
1 change: 0 additions & 1 deletion pkg/e2e/cancel_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows

/*
Copyright 2020 Docker Compose CLI authors
Expand Down
1 change: 0 additions & 1 deletion pkg/e2e/cascade_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows

/*
Copyright 2022 Docker Compose CLI authors
Expand Down
1 change: 0 additions & 1 deletion pkg/e2e/container_name_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows

/*
Copyright 2022 Docker Compose CLI authors
Expand Down
1 change: 0 additions & 1 deletion pkg/e2e/noDeps_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows

/*
Copyright 2022 Docker Compose CLI authors
Expand Down
1 change: 0 additions & 1 deletion pkg/e2e/up_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows

/*
Copyright 2022 Docker Compose CLI authors
Expand Down
1 change: 0 additions & 1 deletion pkg/watch/watcher_darwin.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build darwin
// +build darwin

/*
Copyright 2020 Docker Compose CLI authors
Expand Down
1 change: 0 additions & 1 deletion pkg/watch/watcher_naive.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !darwin
// +build !darwin

/*
Copyright 2020 Docker Compose CLI authors
Expand Down
1 change: 0 additions & 1 deletion pkg/watch/watcher_nonwin.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows

/*
Copyright 2020 Docker Compose CLI authors
Expand Down
1 change: 0 additions & 1 deletion pkg/watch/watcher_windows.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build windows
// +build windows

/*
Copyright 2020 Docker Compose CLI authors
Expand Down