diff options
author | zhangguanzhang <guanzhangzhang@gmail.com> | 2020-06-12 19:54:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-12 19:54:10 +0800 |
commit | 64eae15aa7905dd49f4a348f6b4765dfb4d9dd91 (patch) | |
tree | 2914c20a2e0e15383da50334cad89b9b85b209a1 /pkg/api/handlers/compat | |
parent | 3218736cff4b718b8fe855759687cb66f19d6e1e (diff) | |
parent | 8aa5cf3d45998bc92eaafd67ab2a59e3722bade4 (diff) | |
download | podman-64eae15aa7905dd49f4a348f6b4765dfb4d9dd91.tar.gz podman-64eae15aa7905dd49f4a348f6b4765dfb4d9dd91.tar.bz2 podman-64eae15aa7905dd49f4a348f6b4765dfb4d9dd91.zip |
Merge pull request #1 from containers/master
# sync
Diffstat (limited to 'pkg/api/handlers/compat')
-rw-r--r-- | pkg/api/handlers/compat/containers.go | 4 | ||||
-rw-r--r-- | pkg/api/handlers/compat/images.go | 4 | ||||
-rw-r--r-- | pkg/api/handlers/compat/images_build.go | 8 | ||||
-rw-r--r-- | pkg/api/handlers/compat/info.go | 2 | ||||
-rw-r--r-- | pkg/api/handlers/compat/networks.go | 4 | ||||
-rw-r--r-- | pkg/api/handlers/compat/ping.go | 4 | ||||
-rw-r--r-- | pkg/api/handlers/compat/version.go | 4 |
7 files changed, 13 insertions, 17 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go index 1fd068ba6..8ce2180ab 100644 --- a/pkg/api/handlers/compat/containers.go +++ b/pkg/api/handlers/compat/containers.go @@ -348,7 +348,7 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) { } func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error) { - imageId, imageName := l.Image() + imageID, imageName := l.Image() var ( err error @@ -378,7 +378,7 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error ID: l.ID(), Names: []string{fmt.Sprintf("/%s", l.Name())}, Image: imageName, - ImageID: imageId, + ImageID: imageID, Command: strings.Join(l.Command(), " "), Created: l.CreatedTime().Unix(), Ports: nil, diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go index b64ed0036..ce9ff1b19 100644 --- a/pkg/api/handlers/compat/images.go +++ b/pkg/api/handlers/compat/images.go @@ -224,7 +224,7 @@ func CreateImageFromSrc(w http.ResponseWriter, r *http.Request) { Status string `json:"status"` Progress string `json:"progress"` ProgressDetail map[string]string `json:"progressDetail"` - Id string `json:"id"` + Id string `json:"id"` //nolint }{ Status: iid, ProgressDetail: map[string]string{}, @@ -289,7 +289,7 @@ func CreateImageFromImage(w http.ResponseWriter, r *http.Request) { Error string `json:"error"` Progress string `json:"progress"` ProgressDetail map[string]string `json:"progressDetail"` - Id string `json:"id"` + Id string `json:"id"` //nolint }{ Status: fmt.Sprintf("pulling image (%s) from %s", img.Tag, strings.Join(img.Names(), ", ")), ProgressDetail: map[string]string{}, diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index e9d8fd719..6cc766a38 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -59,10 +59,10 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { ForceRm bool `schema:"forcerm"` Memory int64 `schema:"memory"` MemSwap int64 `schema:"memswap"` - CpuShares uint64 `schema:"cpushares"` - CpuSetCpus string `schema:"cpusetcpus"` - CpuPeriod uint64 `schema:"cpuperiod"` - CpuQuota int64 `schema:"cpuquota"` + CpuShares uint64 `schema:"cpushares"` //nolint + CpuSetCpus string `schema:"cpusetcpus"` //nolint + CpuPeriod uint64 `schema:"cpuperiod"` //nolint + CpuQuota int64 `schema:"cpuquota"` //nolint BuildArgs string `schema:"buildargs"` ShmSize int `schema:"shmsize"` Squash bool `schema:"squash"` diff --git a/pkg/api/handlers/compat/info.go b/pkg/api/handlers/compat/info.go index e9756a03f..d4a933c54 100644 --- a/pkg/api/handlers/compat/info.go +++ b/pkg/api/handlers/compat/info.go @@ -177,7 +177,7 @@ func getContainersState(r *libpod.Runtime) map[define.ContainerStatus]int { if err != nil { continue } - states[state] += 1 + states[state]++ } } return states diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index c52ca093f..8734ba405 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -20,10 +20,6 @@ import ( "github.com/pkg/errors" ) -type CompatInspectNetwork struct { - types.NetworkResource -} - func InspectNetwork(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) diff --git a/pkg/api/handlers/compat/ping.go b/pkg/api/handlers/compat/ping.go index abee3d8e8..d275c4a02 100644 --- a/pkg/api/handlers/compat/ping.go +++ b/pkg/api/handlers/compat/ping.go @@ -14,13 +14,13 @@ import ( // Clients will use the Header availability to test which backend engine is in use. // Note: Additionally handler supports GET and HEAD methods func Ping(w http.ResponseWriter, r *http.Request) { - w.Header().Set("API-Version", utils.ApiVersion[utils.CompatTree][utils.CurrentApiVersion].String()) + w.Header().Set("API-Version", utils.APIVersion[utils.CompatTree][utils.CurrentAPIVersion].String()) w.Header().Set("BuildKit-Version", "") w.Header().Set("Docker-Experimental", "true") w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Pragma", "no-cache") - w.Header().Set("Libpod-API-Version", utils.ApiVersion[utils.LibpodTree][utils.CurrentApiVersion].String()) + w.Header().Set("Libpod-API-Version", utils.APIVersion[utils.LibpodTree][utils.CurrentAPIVersion].String()) w.Header().Set("Libpod-Buildha-Version", buildah.Version) w.WriteHeader(http.StatusOK) diff --git a/pkg/api/handlers/compat/version.go b/pkg/api/handlers/compat/version.go index bfc226bb8..3164b16b9 100644 --- a/pkg/api/handlers/compat/version.go +++ b/pkg/api/handlers/compat/version.go @@ -34,14 +34,14 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) { Name: "Podman Engine", Version: versionInfo.Version, Details: map[string]string{ - "APIVersion": utils.ApiVersion[utils.LibpodTree][utils.CurrentApiVersion].String(), + "APIVersion": utils.APIVersion[utils.LibpodTree][utils.CurrentAPIVersion].String(), "Arch": goRuntime.GOARCH, "BuildTime": time.Unix(versionInfo.Built, 0).Format(time.RFC3339), "Experimental": "true", "GitCommit": versionInfo.GitCommit, "GoVersion": versionInfo.GoVersion, "KernelVersion": infoData.Host.Kernel, - "MinAPIVersion": utils.ApiVersion[utils.LibpodTree][utils.MinimalApiVersion].String(), + "MinAPIVersion": utils.APIVersion[utils.LibpodTree][utils.MinimalAPIVersion].String(), "Os": goRuntime.GOOS, }, }} |