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
16 changes: 8 additions & 8 deletions pkg/compose/api_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ package compose
// Docker Engine API version constants.
// These versions correspond to specific Docker Engine releases and their features.
const (
// APIVersion148 represents Docker Engine API version 1.48 (Engine v28.0).
// apiVersion148 represents Docker Engine API version 1.48 (Engine v28.0).
//
// New features in this version:
// - Volume mounts with type=image support
//
// Before this version:
// - Only bind, volume, and tmpfs mount types were supported
APIVersion148 = "1.48"
apiVersion148 = "1.48"

// APIVersion149 represents Docker Engine API version 1.49 (Engine v28.1).
// apiVersion149 represents Docker Engine API version 1.49 (Engine v28.1).
//
// New features in this version:
// - Network interface_name configuration
Expand All @@ -37,21 +37,21 @@ const (
// Before this version:
// - interface_name was not configurable
// - ImageList didn't support platform filtering
APIVersion149 = "1.49"
apiVersion149 = "1.49"
)

// Docker Engine version strings for user-facing error messages.
// These should be used in error messages to provide clear version requirements.
const (
// DockerEngineV28 is the major version string for Docker Engine 28.x
DockerEngineV28 = "v28"
// dockerEngineV28 is the major version string for Docker Engine 28.x
dockerEngineV28 = "v28"

// DockerEngineV28_1 is the specific version string for Docker Engine 28.1
DockerEngineV28_1 = "v28.1"
)

// Build tool version constants
const (
// BuildxMinVersion is the minimum required version of buildx for compose build
BuildxMinVersion = "0.17.0"
// buildxMinVersion is the minimum required version of buildx for compose build
buildxMinVersion = "0.17.0"
)
4 changes: 2 additions & 2 deletions pkg/compose/build_bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ func (s *composeService) getBuildxPlugin() (*manager.Plugin, error) {
return nil, fmt.Errorf("failed to get version of buildx")
}

if versions.LessThan(buildx.Version[1:], BuildxMinVersion) {
return nil, fmt.Errorf("compose build requires buildx %s or later", BuildxMinVersion)
if versions.LessThan(buildx.Version[1:], buildxMinVersion) {
return nil, fmt.Errorf("compose build requires buildx %s or later", buildxMinVersion)
}

return buildx, nil
Expand Down
6 changes: 3 additions & 3 deletions pkg/compose/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func defaultNetworkSettings(project *types.Project,
return network.NetworkNone, nil, nil
}

if versions.LessThan(version, APIVersion149) {
if versions.LessThan(version, apiVersion149) {
for _, config := range service.Networks {
if config != nil && config.InterfaceName != "" {
return "", nil, fmt.Errorf("interface_name requires Docker Engine %s or later", DockerEngineV28_1)
Expand Down Expand Up @@ -901,8 +901,8 @@ func (s *composeService) buildContainerVolumes(
if err != nil {
return nil, nil, err
}
if versions.LessThan(version, APIVersion148) {
return nil, nil, fmt.Errorf("volume with type=image require Docker Engine %s or later", DockerEngineV28)
if versions.LessThan(version, apiVersion148) {
return nil, nil, fmt.Errorf("volume with type=image require Docker Engine %s or later", dockerEngineV28)
}
}
mounts = append(mounts, m)
Expand Down
2 changes: 1 addition & 1 deletion pkg/compose/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (s *composeService) Images(ctx context.Context, projectName string, options
if err != nil {
return nil, err
}
withPlatform := versions.GreaterThanOrEqualTo(version, APIVersion149)
withPlatform := versions.GreaterThanOrEqualTo(version, apiVersion149)

summary := map[string]api.ImageSummary{}
var mux sync.Mutex
Expand Down