Skip to content

Commit

Permalink
pkg/*/compat: move to new package and attribute types
Browse files Browse the repository at this point in the history
Signed-off-by: Danish Prakash <[email protected]>
  • Loading branch information
danishprakash committed Oct 17, 2024
1 parent 0e3b841 commit 3c47c7c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmd/rootlessport/wsl.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func splitDualStackSpecIfWsl(spec rkport.Spec) []rkport.Spec {
specs := []rkport.Spec{spec}
protocol := spec.Proto
if machine.MachineHostType() != machine.Wsl || strings.HasSuffix(protocol, "4") || strings.HasSuffix(protocol, "6") {
if machine.HostType() != machine.Wsl || strings.HasSuffix(protocol, "4") || strings.HasSuffix(protocol, "6") {
return specs
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/api/handlers/compat/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/containers/podman/v4/pkg/signal"
"github.com/containers/podman/v4/pkg/util"
"github.com/docker/docker/api/types"
dockerBackend "github.com/docker/docker/api/types/backend"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/go-connections/nat"
Expand Down Expand Up @@ -397,7 +398,7 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error
NetworkSettings: &networkSettings,
Mounts: mounts,
},
ContainerCreateConfig: types.ContainerCreateConfig{},
ContainerCreateConfig: dockerBackend.ContainerCreateConfig{},
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/api/handlers/compat/containers_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ func cliOpts(cc handlers.CreateContainerConfig, rtc *config.Config) (*entities.C
}

if len(cc.HostConfig.RestartPolicy.Name) > 0 {
policy := cc.HostConfig.RestartPolicy.Name
policy := string(cc.HostConfig.RestartPolicy.Name)
// only add restart count on failure
if cc.HostConfig.RestartPolicy.IsOnFailure() {
policy += fmt.Sprintf(":%d", cc.HostConfig.RestartPolicy.MaximumRetryCount)
Expand Down
12 changes: 6 additions & 6 deletions pkg/api/handlers/compat/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
docker "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/api/types/swarm"
dockerSystem "github.com/docker/docker/api/types/system"
"github.com/google/uuid"
"github.com/opencontainers/selinux/go-selinux"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -190,13 +191,12 @@ func getSecOpts(sysInfo *sysinfo.SysInfo) []string {
return secOpts
}

func getRuntimes(configInfo *config.Config) map[string]docker.Runtime {
runtimes := map[string]docker.Runtime{}
func getRuntimes(configInfo *config.Config) map[string]dockerSystem.RuntimeWithStatus {
runtimes := map[string]dockerSystem.RuntimeWithStatus{}
for name, paths := range configInfo.Engine.OCIRuntimes {
runtimes[name] = docker.Runtime{
Path: paths[0],
Args: nil,
}
runtime := dockerSystem.RuntimeWithStatus{}
runtime.Runtime = dockerSystem.Runtime{Path: paths[0], Args: nil}
runtimes[name] = runtime
}
return runtimes
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/containers/common/pkg/config/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions vendor/github.com/containers/common/pkg/config/new.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3c47c7c

Please sign in to comment.