Skip to content

Commit

Permalink
Merge pull request moby#48102 from thaJeztah/runconfig_remove_deprecated
Browse files Browse the repository at this point in the history
runconfig, runconfig/opts: remove deprecated types and functions
  • Loading branch information
AkihiroSuda authored Jul 1, 2024
2 parents 47a959e + 09f62a8 commit e738d3b
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 70 deletions.
6 changes: 0 additions & 6 deletions runconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ import (
"github.com/docker/docker/pkg/sysinfo"
)

// ContainerConfigWrapper is a Config wrapper that holds the container Config (portable)
// and the corresponding HostConfig (non-portable).
//
// Deprecated: use [container.CreateRequest].
type ContainerConfigWrapper = container.CreateRequest

// ContainerDecoder implements httputils.ContainerDecoder
// calling DecodeContainerConfig.
type ContainerDecoder struct {
Expand Down
13 changes: 0 additions & 13 deletions runconfig/hostconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,8 @@ import (
"strings"

"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
)

// SetDefaultNetModeIfBlank changes the NetworkMode in a HostConfig structure
// to default if it is not populated. This ensures backwards compatibility after
// the validation of the network mode was moved from the docker CLI to the
// docker daemon.
//
// Deprecated: SetDefaultNetModeIfBlank is no longer used abnd will be removed in the next release.
func SetDefaultNetModeIfBlank(hc *container.HostConfig) {
if hc != nil && hc.NetworkMode == "" {
hc.NetworkMode = network.NetworkDefault
}
}

// validateNetContainerMode ensures that the various combinations of requested
// network settings wrt container mode are valid.
func validateNetContainerMode(c *container.Config, hc *container.HostConfig) error {
Expand Down
17 changes: 0 additions & 17 deletions runconfig/hostconfig_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,9 @@ import (
"runtime"

"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/pkg/sysinfo"
)

// DefaultDaemonNetworkMode returns the default network stack the daemon should
// use.
//
// Deprecated: this function is no longer in use and will be removed in the next release.
func DefaultDaemonNetworkMode() container.NetworkMode {
return network.NetworkBridge
}

// IsPreDefinedNetwork indicates if a network is predefined by the daemon
//
// Deprecated: this function is no longer used and will be removed in the next release.
func IsPreDefinedNetwork(network string) bool {
n := container.NetworkMode(network)
return n.IsBridge() || n.IsHost() || n.IsNone() || n.IsDefault()
}

// validateNetMode ensures that the various combinations of requested
// network settings are valid.
func validateNetMode(c *container.Config, hc *container.HostConfig) error {
Expand Down
16 changes: 0 additions & 16 deletions runconfig/hostconfig_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,9 @@ import (
"fmt"

"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/pkg/sysinfo"
)

// DefaultDaemonNetworkMode returns the default network stack the daemon should
// use.
//
// Deprecated: this function is no longer in use and will be removed in the next release.
func DefaultDaemonNetworkMode() container.NetworkMode {
return network.NetworkNat
}

// IsPreDefinedNetwork indicates if a network is predefined by the daemon.
//
// Deprecated: this function is no longer used and will be removed in the next release.
func IsPreDefinedNetwork(network string) bool {
return !container.NetworkMode(network).IsUserDefined()
}

// validateNetMode ensures that the various combinations of requested
// network settings are valid.
func validateNetMode(c *container.Config, hc *container.HostConfig) error {
Expand Down
18 changes: 0 additions & 18 deletions runconfig/opts/parse.go

This file was deleted.

0 comments on commit e738d3b

Please sign in to comment.