diff options
Diffstat (limited to 'pkg/api')
83 files changed, 515 insertions, 358 deletions
diff --git a/pkg/api/handlers/compat/changes.go b/pkg/api/handlers/compat/changes.go index a5851ecfc..c442abbf9 100644 --- a/pkg/api/handlers/compat/changes.go +++ b/pkg/api/handlers/compat/changes.go @@ -3,8 +3,8 @@ package compat import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" ) func Changes(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go index 9c0893a80..1e84888af 100644 --- a/pkg/api/handlers/compat/containers.go +++ b/pkg/api/handlers/compat/containers.go @@ -10,15 +10,15 @@ import ( "syscall" "time" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/filters" - "github.com/containers/podman/v2/pkg/domain/infra/abi" - "github.com/containers/podman/v2/pkg/ps" - "github.com/containers/podman/v2/pkg/signal" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/filters" + "github.com/containers/podman/v3/pkg/domain/infra/abi" + "github.com/containers/podman/v3/pkg/ps" + "github.com/containers/podman/v3/pkg/signal" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/go-connections/nat" @@ -307,6 +307,21 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error } } + portMappings, err := l.PortMappings() + if err != nil { + return nil, err + } + + ports := make([]types.Port, len(portMappings)) + for idx, portMapping := range portMappings { + ports[idx] = types.Port{ + IP: portMapping.HostIP, + PrivatePort: uint16(portMapping.ContainerPort), + PublicPort: uint16(portMapping.HostPort), + Type: portMapping.Protocol, + } + } + return &handlers.Container{Container: types.Container{ ID: l.ID(), Names: []string{fmt.Sprintf("/%s", l.Name())}, @@ -314,7 +329,7 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error ImageID: imageID, Command: strings.Join(l.Command(), " "), Created: l.CreatedTime().Unix(), - Ports: nil, + Ports: ports, SizeRw: sizeRW, SizeRootFs: sizeRootFs, Labels: l.Labels(), diff --git a/pkg/api/handlers/compat/containers_archive.go b/pkg/api/handlers/compat/containers_archive.go index 55bd62f90..e119dc7cb 100644 --- a/pkg/api/handlers/compat/containers_archive.go +++ b/pkg/api/handlers/compat/containers_archive.go @@ -5,11 +5,11 @@ import ( "net/http" "os" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/copy" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/copy" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/api/handlers/compat/containers_attach.go b/pkg/api/handlers/compat/containers_attach.go index a4013469b..c230efbe0 100644 --- a/pkg/api/handlers/compat/containers_attach.go +++ b/pkg/api/handlers/compat/containers_attach.go @@ -3,10 +3,10 @@ package compat import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/api/server/idle" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/api/server/idle" "github.com/gorilla/schema" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go index 4a39e9563..93934f1de 100644 --- a/pkg/api/handlers/compat/containers_create.go +++ b/pkg/api/handlers/compat/containers_create.go @@ -4,14 +4,14 @@ import ( "encoding/json" "net/http" - "github.com/containers/podman/v2/cmd/podman/common" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" - "github.com/containers/podman/v2/pkg/specgen" + "github.com/containers/podman/v3/cmd/podman/common" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" + "github.com/containers/podman/v3/pkg/specgen" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/containers_export.go b/pkg/api/handlers/compat/containers_export.go index 500daa9cd..252d2d8b5 100644 --- a/pkg/api/handlers/compat/containers_export.go +++ b/pkg/api/handlers/compat/containers_export.go @@ -5,8 +5,8 @@ import ( "net/http" "os" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/containers_logs.go b/pkg/api/handlers/compat/containers_logs.go index 38a6329b9..cb4dee4d2 100644 --- a/pkg/api/handlers/compat/containers_logs.go +++ b/pkg/api/handlers/compat/containers_logs.go @@ -10,10 +10,10 @@ import ( "sync" "time" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/logs" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/util" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/logs" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/util" "github.com/gorilla/schema" "github.com/pkg/errors" log "github.com/sirupsen/logrus" diff --git a/pkg/api/handlers/compat/containers_pause.go b/pkg/api/handlers/compat/containers_pause.go index a7e0a66f1..d00b19acc 100644 --- a/pkg/api/handlers/compat/containers_pause.go +++ b/pkg/api/handlers/compat/containers_pause.go @@ -3,8 +3,8 @@ package compat import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" ) func PauseContainer(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/compat/containers_prune.go b/pkg/api/handlers/compat/containers_prune.go index 7bba38475..dc4d53af6 100644 --- a/pkg/api/handlers/compat/containers_prune.go +++ b/pkg/api/handlers/compat/containers_prune.go @@ -4,11 +4,11 @@ import ( "bytes" "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities/reports" - "github.com/containers/podman/v2/pkg/domain/filters" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities/reports" + "github.com/containers/podman/v3/pkg/domain/filters" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/containers_restart.go b/pkg/api/handlers/compat/containers_restart.go index 70edfcbb3..46a6297fa 100644 --- a/pkg/api/handlers/compat/containers_restart.go +++ b/pkg/api/handlers/compat/containers_restart.go @@ -3,11 +3,11 @@ package compat import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/containers_start.go b/pkg/api/handlers/compat/containers_start.go index 726da6f99..391aa752d 100644 --- a/pkg/api/handlers/compat/containers_start.go +++ b/pkg/api/handlers/compat/containers_start.go @@ -5,9 +5,9 @@ import ( "github.com/sirupsen/logrus" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/gorilla/schema" ) diff --git a/pkg/api/handlers/compat/containers_stats.go b/pkg/api/handlers/compat/containers_stats.go index 2a76ef962..694b57bb1 100644 --- a/pkg/api/handlers/compat/containers_stats.go +++ b/pkg/api/handlers/compat/containers_stats.go @@ -5,10 +5,10 @@ import ( "net/http" "time" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/cgroups" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/cgroups" docker "github.com/docker/docker/api/types" "github.com/gorilla/schema" "github.com/pkg/errors" diff --git a/pkg/api/handlers/compat/containers_stop.go b/pkg/api/handlers/compat/containers_stop.go index 000685aa0..0526865b9 100644 --- a/pkg/api/handlers/compat/containers_stop.go +++ b/pkg/api/handlers/compat/containers_stop.go @@ -3,11 +3,11 @@ package compat import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/containers_top.go b/pkg/api/handlers/compat/containers_top.go index eadc06101..ab9f613af 100644 --- a/pkg/api/handlers/compat/containers_top.go +++ b/pkg/api/handlers/compat/containers_top.go @@ -4,9 +4,9 @@ import ( "net/http" "strings" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/containers_unpause.go b/pkg/api/handlers/compat/containers_unpause.go index 760e85814..a37c4ba2a 100644 --- a/pkg/api/handlers/compat/containers_unpause.go +++ b/pkg/api/handlers/compat/containers_unpause.go @@ -3,8 +3,8 @@ package compat import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" ) func UnpauseContainer(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index 7dad5f566..9e82831d7 100644 --- a/pkg/api/handlers/compat/events.go +++ b/pkg/api/handlers/compat/events.go @@ -5,10 +5,10 @@ import ( "fmt" "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/events" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/events" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" "github.com/gorilla/schema" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" diff --git a/pkg/api/handlers/compat/exec.go b/pkg/api/handlers/compat/exec.go index cc5db8efe..1b7b884e0 100644 --- a/pkg/api/handlers/compat/exec.go +++ b/pkg/api/handlers/compat/exec.go @@ -6,12 +6,12 @@ import ( "net/http" "strings" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/api/server/idle" - "github.com/containers/podman/v2/pkg/specgen/generate" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/api/server/idle" + "github.com/containers/podman/v3/pkg/specgen/generate" "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go index 0d75d1a94..e5caa9ea5 100644 --- a/pkg/api/handlers/compat/images.go +++ b/pkg/api/handlers/compat/images.go @@ -1,6 +1,7 @@ package compat import ( + "context" "encoding/json" "fmt" "io" @@ -11,13 +12,15 @@ import ( "github.com/containers/buildah" "github.com/containers/image/v5/manifest" - "github.com/containers/podman/v2/libpod" - image2 "github.com/containers/podman/v2/libpod/image" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/util" + "github.com/containers/image/v5/types" + "github.com/containers/podman/v3/libpod" + image2 "github.com/containers/podman/v3/libpod/image" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/channel" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/util" "github.com/gorilla/schema" "github.com/opencontainers/go-digest" "github.com/pkg/errors" @@ -236,33 +239,103 @@ func CreateImageFromImage(w http.ResponseWriter, r *http.Request) { if sys := runtime.SystemContext(); sys != nil { registryOpts.DockerCertPath = sys.DockerCertPath } - img, err := runtime.ImageRuntime().New(r.Context(), - fromImage, - "", // signature policy - authfile, - nil, // writer - ®istryOpts, - image2.SigningOptions{}, - nil, // label - util.PullImageAlways, - ) - if err != nil { - utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err) - return + + stderr := channel.NewWriter(make(chan []byte)) + defer stderr.Close() + + progress := make(chan types.ProgressProperties) + + var img string + runCtx, cancel := context.WithCancel(context.Background()) + go func() { + defer cancel() + + newImage, err := runtime.ImageRuntime().New( + runCtx, + fromImage, + "", // signature policy + authfile, + nil, // writer + ®istryOpts, + image2.SigningOptions{}, + nil, // label + util.PullImageAlways, + progress) + if err != nil { + stderr.Write([]byte(err.Error() + "\n")) + } else { + img = newImage.ID() + } + }() + + flush := func() { + if flusher, ok := w.(http.Flusher); ok { + flusher.Flush() + } } - // Success - utils.WriteResponse(w, http.StatusOK, struct { - Status string `json:"status"` - Error string `json:"error,omitempty"` - Progress string `json:"progress"` - ProgressDetail map[string]string `json:"progressDetail"` - Id string `json:"id"` // nolint - }{ - Status: fmt.Sprintf("pulling image (%s) from %s (Download complete)", img.Tag, strings.Join(img.Names(), ", ")), - ProgressDetail: map[string]string{}, - Id: img.ID(), - }) + w.WriteHeader(http.StatusOK) + w.Header().Add("Content-Type", "application/json") + flush() + + enc := json.NewEncoder(w) + enc.SetEscapeHTML(true) + var failed bool + +loop: // break out of for/select infinite loop + for { + var report struct { + Stream string `json:"stream,omitempty"` + Status string `json:"status,omitempty"` + Progress struct { + Current uint64 `json:"current,omitempty"` + Total int64 `json:"total,omitempty"` + } `json:"progressDetail,omitempty"` + Error string `json:"error,omitempty"` + Id string `json:"id,omitempty"` // nolint + } + + select { + case e := <-progress: + switch e.Event { + case types.ProgressEventNewArtifact: + report.Status = "Pulling fs layer" + case types.ProgressEventRead: + report.Status = "Downloading" + report.Progress.Current = e.Offset + report.Progress.Total = e.Artifact.Size + case types.ProgressEventSkipped: + report.Status = "Already exists" + case types.ProgressEventDone: + report.Status = "Download complete" + } + report.Id = e.Artifact.Digest.Encoded()[0:12] + if err := enc.Encode(report); err != nil { + stderr.Write([]byte(err.Error())) + } + flush() + case e := <-stderr.Chan(): + failed = true + report.Error = string(e) + if err := enc.Encode(report); err != nil { + logrus.Warnf("Failed to json encode error %q", err.Error()) + } + flush() + case <-runCtx.Done(): + if !failed { + report.Status = "Pull complete" + report.Id = img[0:12] + if err := enc.Encode(report); err != nil { + logrus.Warnf("Failed to json encode error %q", err.Error()) + } + flush() + } + break loop // break out of for/select infinite loop + case <-r.Context().Done(): + // Client has closed connection + break loop // break out of for/select infinite loop + } + } } func GetImage(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index 0f27a090f..d79b100e8 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -10,16 +10,19 @@ import ( "os" "path/filepath" "strconv" + "time" "github.com/containers/buildah" "github.com/containers/buildah/imagebuildah" + "github.com/containers/buildah/util" "github.com/containers/image/v5/types" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/channel" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/channel" "github.com/containers/storage/pkg/archive" "github.com/gorilla/schema" + specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -65,6 +68,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { Annotations string `schema:"annotations"` BuildArgs string `schema:"buildargs"` CacheFrom string `schema:"cachefrom"` + Compression uint64 `schema:"compression"` ConfigureNetwork int64 `schema:"networkmode"` CpuPeriod uint64 `schema:"cpuperiod"` // nolint CpuQuota int64 `schema:"cpuquota"` // nolint @@ -73,17 +77,20 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { Devices string `schema:"devices"` Dockerfile string `schema:"dockerfile"` DropCapabilities string `schema:"dropcaps"` + Excludes string `schema:"excludes"` ForceRm bool `schema:"forcerm"` From string `schema:"from"` HTTPProxy bool `schema:"httpproxy"` Isolation int64 `schema:"isolation"` - Jobs uint64 `schema:"jobs"` // nolint + Ignore bool `schema:"ignore"` + Jobs int `schema:"jobs"` // nolint Labels string `schema:"labels"` Layers bool `schema:"layers"` LogRusage bool `schema:"rusage"` Manifest string `schema:"manifest"` MemSwap int64 `schema:"memswap"` Memory int64 `schema:"memory"` + NamespaceOptions string `schema:"nsoptions"` NoCache bool `schema:"nocache"` OutputFormat string `schema:"outputformat"` Platform string `schema:"platform"` @@ -129,6 +136,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { } } + compression := archive.Compression(query.Compression) // convert label formats var dropCaps = []string{} if _, found := r.URL.Query()["dropcaps"]; found { @@ -156,7 +164,15 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { output = query.Tag[0] } format := buildah.Dockerv2ImageManifest + registry := query.Registry + isolation := buildah.IsolationChroot + /* + // FIXME, This is very broken. Buildah will only work with chroot + isolation := buildah.IsolationDefault + */ if utils.IsLibpodRequest(r) { + // isolation = buildah.Isolation(query.Isolation) + registry = "" format = query.OutputFormat } var additionalTags []string @@ -172,6 +188,14 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { } } + var excludes = []string{} + if _, found := r.URL.Query()["excludes"]; found { + if err := json.Unmarshal([]byte(query.Excludes), &excludes); err != nil { + utils.BadRequest(w, "excludes", query.Excludes, err) + return + } + } + // convert label formats var annotations = []string{} if _, found := r.URL.Query()["annotations"]; found { @@ -182,6 +206,19 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { } // convert label formats + nsoptions := buildah.NamespaceOptions{} + if _, found := r.URL.Query()["nsoptions"]; found { + if err := json.Unmarshal([]byte(query.NamespaceOptions), &nsoptions); err != nil { + utils.BadRequest(w, "nsoptions", query.NamespaceOptions, err) + return + } + } else { + nsoptions = append(nsoptions, buildah.NamespaceOption{ + Name: string(specs.NetworkNamespace), + Host: true, + }) + } + // convert label formats var labels = []string{} if _, found := r.URL.Query()["labels"]; found { if err := json.Unmarshal([]byte(query.Labels), &labels); err != nil { @@ -189,6 +226,10 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { return } } + jobs := 1 + if _, found := r.URL.Query()["jobs"]; found { + jobs = query.Jobs + } pullPolicy := buildah.PullIfMissing if _, found := r.URL.Query()["pull"]; found { @@ -218,6 +259,12 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { reporter := channel.NewWriter(make(chan []byte, 1)) defer reporter.Close() + runtime := r.Context().Value("runtime").(*libpod.Runtime) + rtc, err := runtime.GetConfig() + if err != nil { + utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Decode()")) + return + } buildOptions := imagebuildah.BuildOptions{ AddCapabilities: addCaps, AdditionalTags: additionalTags, @@ -234,32 +281,36 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { MemorySwap: query.MemSwap, ShmSize: strconv.Itoa(query.ShmSize), }, - Compression: archive.Gzip, + CNIConfigDir: rtc.Network.CNIPluginDirs[0], + CNIPluginPath: util.DefaultCNIPluginPath, + Compression: compression, ConfigureNetwork: buildah.NetworkConfigurationPolicy(query.ConfigureNetwork), ContextDirectory: contextDirectory, Devices: devices, DropCapabilities: dropCaps, Err: auxout, + Excludes: excludes, ForceRmIntermediateCtrs: query.ForceRm, From: query.From, - IgnoreUnrecognizedInstructions: true, - // FIXME, This is very broken. Buildah will only work with chroot - // Isolation: buildah.Isolation(query.Isolation), - Isolation: buildah.IsolationChroot, - - Labels: labels, - Layers: query.Layers, - Manifest: query.Manifest, - NoCache: query.NoCache, - Out: stdout, - Output: output, - OutputFormat: format, - PullPolicy: pullPolicy, - Quiet: query.Quiet, - Registry: query.Registry, - RemoveIntermediateCtrs: query.Rm, - ReportWriter: reporter, - Squash: query.Squash, + IgnoreUnrecognizedInstructions: query.Ignore, + Isolation: isolation, + Jobs: &jobs, + Labels: labels, + Layers: query.Layers, + Manifest: query.Manifest, + MaxPullPushRetries: 3, + NamespaceOptions: nsoptions, + NoCache: query.NoCache, + Out: stdout, + Output: output, + OutputFormat: format, + PullPolicy: pullPolicy, + PullPushRetryDelay: time.Duration(2 * time.Second), + Quiet: query.Quiet, + Registry: registry, + RemoveIntermediateCtrs: query.Rm, + ReportWriter: reporter, + Squash: query.Squash, SystemContext: &types.SystemContext{ AuthFilePath: authfile, DockerAuthConfig: creds, @@ -267,7 +318,6 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { Target: query.Target, } - runtime := r.Context().Value("runtime").(*libpod.Runtime) runCtx, cancel := context.WithCancel(context.Background()) var imageID string go func() { diff --git a/pkg/api/handlers/compat/images_history.go b/pkg/api/handlers/compat/images_history.go index 174bc6234..a02ed179c 100644 --- a/pkg/api/handlers/compat/images_history.go +++ b/pkg/api/handlers/compat/images_history.go @@ -3,9 +3,9 @@ package compat import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/images_prune.go b/pkg/api/handlers/compat/images_prune.go index c7e84804b..63daaa780 100644 --- a/pkg/api/handlers/compat/images_prune.go +++ b/pkg/api/handlers/compat/images_prune.go @@ -5,9 +5,9 @@ import ( "fmt" "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/docker/docker/api/types" "github.com/gorilla/schema" "github.com/pkg/errors" diff --git a/pkg/api/handlers/compat/images_push.go b/pkg/api/handlers/compat/images_push.go index 77d891546..4f613338f 100644 --- a/pkg/api/handlers/compat/images_push.go +++ b/pkg/api/handlers/compat/images_push.go @@ -7,11 +7,11 @@ import ( "strings" "github.com/containers/image/v5/types" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/containers/storage" "github.com/gorilla/schema" "github.com/pkg/errors" diff --git a/pkg/api/handlers/compat/images_remove.go b/pkg/api/handlers/compat/images_remove.go index dd2d96bbb..874c57f16 100644 --- a/pkg/api/handlers/compat/images_remove.go +++ b/pkg/api/handlers/compat/images_remove.go @@ -3,8 +3,8 @@ package compat import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/images_search.go b/pkg/api/handlers/compat/images_search.go index 885112b31..18974f424 100644 --- a/pkg/api/handlers/compat/images_search.go +++ b/pkg/api/handlers/compat/images_search.go @@ -5,12 +5,12 @@ import ( "net/http" "github.com/containers/image/v5/types" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/images_tag.go b/pkg/api/handlers/compat/images_tag.go index b49d9054b..0d0c204f3 100644 --- a/pkg/api/handlers/compat/images_tag.go +++ b/pkg/api/handlers/compat/images_tag.go @@ -4,8 +4,8 @@ import ( "fmt" "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/info.go b/pkg/api/handlers/compat/info.go index 5adbeb031..d7cefd516 100644 --- a/pkg/api/handlers/compat/info.go +++ b/pkg/api/handlers/compat/info.go @@ -11,11 +11,11 @@ import ( "github.com/containers/common/pkg/config" "github.com/containers/common/pkg/sysinfo" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/rootless" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/rootless" docker "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/registry" "github.com/docker/docker/api/types/swarm" diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index 71b9d180d..28e90ac28 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -10,12 +10,12 @@ import ( "time" "github.com/containernetworking/cni/libcni" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/libpod/network" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/libpod/network" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/docker/docker/api/types" dockerNetwork "github.com/docker/docker/api/types/network" "github.com/gorilla/schema" @@ -127,6 +127,12 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt containerEndpoints[con.ID()] = containerEndpoint } } + + labels := network.GetNetworkLabels(conf) + if labels == nil { + labels = map[string]string{} + } + report := types.NetworkResource{ Name: conf.Name, ID: network.GetNetworkID(conf.Name), @@ -136,7 +142,7 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt EnableIPv6: false, IPAM: dockerNetwork.IPAM{ Driver: "default", - Options: nil, + Options: map[string]string{}, Config: ipamConfigs, }, Internal: !bridge.IsGW, @@ -145,8 +151,8 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt ConfigFrom: dockerNetwork.ConfigReference{}, ConfigOnly: false, Containers: containerEndpoints, - Options: nil, - Labels: network.GetNetworkLabels(conf), + Options: map[string]string{}, + Labels: labels, Peers: nil, Services: nil, } @@ -174,16 +180,18 @@ func findPluginByName(plugins []*libcni.NetworkConfig, pluginType string) ([]byt func ListNetworks(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) - decoder := r.Context().Value("decoder").(*schema.Decoder) - query := struct { - Filters map[string][]string `schema:"filters"` - }{ - // override any golang type defaults - } - if err := decoder.Decode(&query, r.URL.Query()); err != nil { + filters, err := filtersFromRequest(r) + if err != nil { utils.Error(w, "Something went wrong.", http.StatusBadRequest, errors.Wrapf(err, "failed to parse parameters for %s", r.URL.String())) return } + filterMap := map[string][]string{} + for _, filter := range filters { + split := strings.SplitN(filter, "=", 2) + if len(split) > 1 { + filterMap[split[0]] = append(filterMap[split[0]], split[1]) + } + } config, err := runtime.GetConfig() if err != nil { utils.InternalServerError(w, err) @@ -199,7 +207,7 @@ func ListNetworks(w http.ResponseWriter, r *http.Request) { reports := []*types.NetworkResource{} logrus.Debugf("netNames: %q", strings.Join(netNames, ", ")) for _, name := range netNames { - report, err := getNetworkResourceByNameOrID(name, runtime, query.Filters) + report, err := getNetworkResourceByNameOrID(name, runtime, filterMap) if err != nil { utils.InternalServerError(w, err) return diff --git a/pkg/api/handlers/compat/resize.go b/pkg/api/handlers/compat/resize.go index a769ae1b5..1bf7ad460 100644 --- a/pkg/api/handlers/compat/resize.go +++ b/pkg/api/handlers/compat/resize.go @@ -5,13 +5,12 @@ import ( "net/http" "strings" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/gorilla/mux" "github.com/gorilla/schema" "github.com/pkg/errors" - "k8s.io/client-go/tools/remotecommand" ) func ResizeTTY(w http.ResponseWriter, r *http.Request) { @@ -32,7 +31,7 @@ func ResizeTTY(w http.ResponseWriter, r *http.Request) { return } - sz := remotecommand.TerminalSize{ + sz := define.TerminalSize{ Width: query.Width, Height: query.Height, } diff --git a/pkg/api/handlers/compat/secrets.go b/pkg/api/handlers/compat/secrets.go index ff737cddc..c5ee8c324 100644 --- a/pkg/api/handlers/compat/secrets.go +++ b/pkg/api/handlers/compat/secrets.go @@ -7,10 +7,10 @@ import ( "fmt" "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/swagger.go b/pkg/api/handlers/compat/swagger.go index 1d1f1ecf2..a0783e723 100644 --- a/pkg/api/handlers/compat/swagger.go +++ b/pkg/api/handlers/compat/swagger.go @@ -1,7 +1,7 @@ package compat import ( - "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/storage/pkg/archive" "github.com/docker/docker/api/types" ) diff --git a/pkg/api/handlers/compat/system.go b/pkg/api/handlers/compat/system.go index 66b4236f9..57702698b 100644 --- a/pkg/api/handlers/compat/system.go +++ b/pkg/api/handlers/compat/system.go @@ -4,11 +4,11 @@ import ( "net/http" "strings" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" docker "github.com/docker/docker/api/types" ) diff --git a/pkg/api/handlers/compat/unsupported.go b/pkg/api/handlers/compat/unsupported.go index 1c518690f..508d0ee18 100644 --- a/pkg/api/handlers/compat/unsupported.go +++ b/pkg/api/handlers/compat/unsupported.go @@ -4,8 +4,8 @@ import ( "fmt" "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/errorhandling" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/errorhandling" log "github.com/sirupsen/logrus" ) diff --git a/pkg/api/handlers/compat/version.go b/pkg/api/handlers/compat/version.go index d5070dbbc..d90a892c1 100644 --- a/pkg/api/handlers/compat/version.go +++ b/pkg/api/handlers/compat/version.go @@ -6,10 +6,10 @@ import ( goRuntime "runtime" "time" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" docker "github.com/docker/docker/api/types" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/compat/volumes.go b/pkg/api/handlers/compat/volumes.go index 82e70eb90..28fb67102 100644 --- a/pkg/api/handlers/compat/volumes.go +++ b/pkg/api/handlers/compat/volumes.go @@ -7,12 +7,12 @@ import ( "net/url" "time" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/filters" - "github.com/containers/podman/v2/pkg/domain/infra/abi/parse" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/filters" + "github.com/containers/podman/v3/pkg/domain/infra/abi/parse" docker_api_types "github.com/docker/docker/api/types" docker_api_types_volume "github.com/docker/docker/api/types/volume" "github.com/gorilla/schema" diff --git a/pkg/api/handlers/decoder.go b/pkg/api/handlers/decoder.go index 123d325aa..764456dd4 100644 --- a/pkg/api/handlers/decoder.go +++ b/pkg/api/handlers/decoder.go @@ -6,8 +6,8 @@ import ( "syscall" "time" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/util" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/util" "github.com/gorilla/schema" "github.com/sirupsen/logrus" ) diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go index 4e79e4a42..01b9ec101 100644 --- a/pkg/api/handlers/libpod/containers.go +++ b/pkg/api/handlers/libpod/containers.go @@ -5,12 +5,12 @@ import ( "net/http" "os" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/api/handlers/libpod/containers_create.go b/pkg/api/handlers/libpod/containers_create.go index d8bb535ff..b92588346 100644 --- a/pkg/api/handlers/libpod/containers_create.go +++ b/pkg/api/handlers/libpod/containers_create.go @@ -5,11 +5,11 @@ import ( "encoding/json" "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/specgen" - "github.com/containers/podman/v2/pkg/specgen/generate" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/specgen" + "github.com/containers/podman/v3/pkg/specgen/generate" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/libpod/containers_stats.go b/pkg/api/handlers/libpod/containers_stats.go index ff475803d..75c404d4f 100644 --- a/pkg/api/handlers/libpod/containers_stats.go +++ b/pkg/api/handlers/libpod/containers_stats.go @@ -5,10 +5,10 @@ import ( "net/http" "time" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/api/handlers/libpod/copy.go b/pkg/api/handlers/libpod/copy.go index b7c508342..4b345bacc 100644 --- a/pkg/api/handlers/libpod/copy.go +++ b/pkg/api/handlers/libpod/copy.go @@ -3,7 +3,7 @@ package libpod import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/libpod/generate.go b/pkg/api/handlers/libpod/generate.go index b3b8c1f16..0e6e9100a 100644 --- a/pkg/api/handlers/libpod/generate.go +++ b/pkg/api/handlers/libpod/generate.go @@ -3,11 +3,11 @@ package libpod import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" - "github.com/containers/podman/v2/pkg/util" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" + "github.com/containers/podman/v3/pkg/util" "github.com/gorilla/schema" "github.com/pkg/errors" ) @@ -18,6 +18,7 @@ func GenerateSystemd(w http.ResponseWriter, r *http.Request) { query := struct { Name bool `schema:"useName"` New bool `schema:"new"` + NoHeader bool `schema:"noHeader"` RestartPolicy string `schema:"restartPolicy"` StopTimeout uint `schema:"stopTimeout"` ContainerPrefix string `schema:"containerPrefix"` @@ -41,6 +42,7 @@ func GenerateSystemd(w http.ResponseWriter, r *http.Request) { options := entities.GenerateSystemdOptions{ Name: query.Name, New: query.New, + NoHeader: query.NoHeader, RestartPolicy: query.RestartPolicy, StopTimeout: &query.StopTimeout, ContainerPrefix: query.ContainerPrefix, diff --git a/pkg/api/handlers/libpod/healthcheck.go b/pkg/api/handlers/libpod/healthcheck.go index 4649b1a71..27478ddec 100644 --- a/pkg/api/handlers/libpod/healthcheck.go +++ b/pkg/api/handlers/libpod/healthcheck.go @@ -3,9 +3,9 @@ package libpod import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" ) func RunHealthCheck(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go index 0d4160a6e..1a2483784 100644 --- a/pkg/api/handlers/libpod/images.go +++ b/pkg/api/handlers/libpod/images.go @@ -13,16 +13,16 @@ import ( "github.com/containers/buildah" "github.com/containers/image/v5/manifest" "github.com/containers/image/v5/types" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/libpod/image" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" - "github.com/containers/podman/v2/pkg/errorhandling" - utils2 "github.com/containers/podman/v2/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/libpod/image" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" + "github.com/containers/podman/v3/pkg/errorhandling" + utils2 "github.com/containers/podman/v3/utils" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/libpod/images_pull.go b/pkg/api/handlers/libpod/images_pull.go index efb15b14d..e2e4b53b4 100644 --- a/pkg/api/handlers/libpod/images_pull.go +++ b/pkg/api/handlers/libpod/images_pull.go @@ -10,13 +10,13 @@ import ( "github.com/containers/image/v5/docker" "github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/types" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/image" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/channel" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/util" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/image" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/channel" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/util" "github.com/gorilla/schema" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -136,7 +136,8 @@ func ImagesPull(w http.ResponseWriter, r *http.Request) { &dockerRegistryOptions, image.SigningOptions{}, nil, - util.PullImageAlways) + util.PullImageAlways, + nil) if err != nil { stderr.Write([]byte(err.Error() + "\n")) } else { diff --git a/pkg/api/handlers/libpod/info.go b/pkg/api/handlers/libpod/info.go index 683ae3dad..546609451 100644 --- a/pkg/api/handlers/libpod/info.go +++ b/pkg/api/handlers/libpod/info.go @@ -3,8 +3,8 @@ package libpod import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" ) func GetInfo(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/libpod/manifests.go b/pkg/api/handlers/libpod/manifests.go index ded51a31f..5ababc36b 100644 --- a/pkg/api/handlers/libpod/manifests.go +++ b/pkg/api/handlers/libpod/manifests.go @@ -7,13 +7,13 @@ import ( "github.com/containers/image/v5/manifest" "github.com/containers/image/v5/types" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/image" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/image" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/opencontainers/go-digest" "github.com/pkg/errors" diff --git a/pkg/api/handlers/libpod/networks.go b/pkg/api/handlers/libpod/networks.go index 8330b6a45..a6c4f6d64 100644 --- a/pkg/api/handlers/libpod/networks.go +++ b/pkg/api/handlers/libpod/networks.go @@ -4,12 +4,12 @@ import ( "encoding/json" "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/libpod/network" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/libpod/network" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/libpod/play.go b/pkg/api/handlers/libpod/play.go index 42ff26a57..ee2d3c00d 100644 --- a/pkg/api/handlers/libpod/play.go +++ b/pkg/api/handlers/libpod/play.go @@ -7,11 +7,11 @@ import ( "os" "github.com/containers/image/v5/types" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go index 2c35dd191..89a4a451f 100644 --- a/pkg/api/handlers/libpod/pods.go +++ b/pkg/api/handlers/libpod/pods.go @@ -6,15 +6,15 @@ import ( "net/http" "strings" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" - "github.com/containers/podman/v2/pkg/specgen" - "github.com/containers/podman/v2/pkg/specgen/generate" - "github.com/containers/podman/v2/pkg/util" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" + "github.com/containers/podman/v3/pkg/specgen" + "github.com/containers/podman/v3/pkg/specgen/generate" + "github.com/containers/podman/v3/pkg/util" "github.com/gorilla/schema" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/api/handlers/libpod/secrets.go b/pkg/api/handlers/libpod/secrets.go index 447a5d021..e7f4397ea 100644 --- a/pkg/api/handlers/libpod/secrets.go +++ b/pkg/api/handlers/libpod/secrets.go @@ -3,10 +3,10 @@ package libpod import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/libpod/swagger.go b/pkg/api/handlers/libpod/swagger.go index c6e95f382..1bececa1a 100644 --- a/pkg/api/handlers/libpod/swagger.go +++ b/pkg/api/handlers/libpod/swagger.go @@ -5,9 +5,9 @@ import ( "os" "github.com/containers/image/v5/manifest" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/libpod/system.go b/pkg/api/handlers/libpod/system.go index c48c186ed..02457eb8f 100644 --- a/pkg/api/handlers/libpod/system.go +++ b/pkg/api/handlers/libpod/system.go @@ -3,11 +3,11 @@ package libpod import ( "net/http" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/libpod/volumes.go b/pkg/api/handlers/libpod/volumes.go index 1a8759c6c..a602e6744 100644 --- a/pkg/api/handlers/libpod/volumes.go +++ b/pkg/api/handlers/libpod/volumes.go @@ -5,14 +5,14 @@ import ( "net/http" "net/url" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/entities/reports" - "github.com/containers/podman/v2/pkg/domain/filters" - "github.com/containers/podman/v2/pkg/domain/infra/abi" - "github.com/containers/podman/v2/pkg/domain/infra/abi/parse" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/entities/reports" + "github.com/containers/podman/v3/pkg/domain/filters" + "github.com/containers/podman/v3/pkg/domain/infra/abi" + "github.com/containers/podman/v3/pkg/domain/infra/abi/parse" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/swagger/swagger.go b/pkg/api/handlers/swagger/swagger.go index 32f041dd3..384e06cac 100644 --- a/pkg/api/handlers/swagger/swagger.go +++ b/pkg/api/handlers/swagger/swagger.go @@ -1,11 +1,11 @@ package swagger import ( - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/libpod/image" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/inspect" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/libpod/image" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/inspect" "github.com/docker/docker/api/types" ) diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go index c9adde09d..f5eaf6f6d 100644 --- a/pkg/api/handlers/types.go +++ b/pkg/api/handlers/types.go @@ -7,8 +7,8 @@ import ( "time" "github.com/containers/image/v5/manifest" - libpodImage "github.com/containers/podman/v2/libpod/image" - "github.com/containers/podman/v2/pkg/domain/entities" + libpodImage "github.com/containers/podman/v3/libpod/image" + "github.com/containers/podman/v3/pkg/domain/entities" docker "github.com/docker/docker/api/types" dockerContainer "github.com/docker/docker/api/types/container" dockerNetwork "github.com/docker/docker/api/types/network" diff --git a/pkg/api/handlers/utils/containers.go b/pkg/api/handlers/utils/containers.go index e79def6f3..91e02abf1 100644 --- a/pkg/api/handlers/utils/containers.go +++ b/pkg/api/handlers/utils/containers.go @@ -7,15 +7,15 @@ import ( "strconv" "time" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/infra/abi" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/infra/abi" - "github.com/containers/podman/v2/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/handlers" "github.com/sirupsen/logrus" - "github.com/containers/podman/v2/libpod/define" + "github.com/containers/podman/v3/libpod/define" - "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v3/libpod" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/handlers/utils/errors.go b/pkg/api/handlers/utils/errors.go index c8785fb89..d22ad414f 100644 --- a/pkg/api/handlers/utils/errors.go +++ b/pkg/api/handlers/utils/errors.go @@ -4,8 +4,8 @@ import ( "fmt" "net/http" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/errorhandling" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/errorhandling" "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/pkg/api/handlers/utils/images.go b/pkg/api/handlers/utils/images.go index aad00c93b..743629db8 100644 --- a/pkg/api/handlers/utils/images.go +++ b/pkg/api/handlers/utils/images.go @@ -9,8 +9,8 @@ import ( "github.com/containers/image/v5/storage" "github.com/containers/image/v5/transports/alltransports" "github.com/containers/image/v5/types" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/image" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/image" "github.com/gorilla/schema" "github.com/pkg/errors" ) diff --git a/pkg/api/server/handler_api.go b/pkg/api/server/handler_api.go index 1d0ddb457..e7bf94fc6 100644 --- a/pkg/api/server/handler_api.go +++ b/pkg/api/server/handler_api.go @@ -6,8 +6,8 @@ import ( "net/http" "runtime" - "github.com/containers/podman/v2/pkg/api/handlers/utils" - "github.com/containers/podman/v2/pkg/auth" + "github.com/containers/podman/v3/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/auth" "github.com/google/uuid" "github.com/sirupsen/logrus" ) diff --git a/pkg/api/server/register_archive.go b/pkg/api/server/register_archive.go index b20d89cc2..2ac126644 100644 --- a/pkg/api/server/register_archive.go +++ b/pkg/api/server/register_archive.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) @@ -91,7 +91,7 @@ func (s *APIServer) registerArchiveHandlers(r *mux.Router) error { Libpod */ - // swagger:operation POST /libpod/containers/{name}/archive libpod libpodPutArchive + // swagger:operation PUT /libpod/containers/{name}/archive libpod libpodPutArchive // --- // summary: Copy files into a container // description: Copy a tar archive of files into a container diff --git a/pkg/api/server/register_auth.go b/pkg/api/server/register_auth.go index 0eaa83737..1e5474462 100644 --- a/pkg/api/server/register_auth.go +++ b/pkg/api/server/register_auth.go @@ -1,7 +1,7 @@ package server import ( - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go index 2b8330d4c..31196aa9e 100644 --- a/pkg/api/server/register_containers.go +++ b/pkg/api/server/register_containers.go @@ -3,8 +3,8 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_distribution.go b/pkg/api/server/register_distribution.go index 201d380d0..cbb4476f3 100644 --- a/pkg/api/server/register_distribution.go +++ b/pkg/api/server/register_distribution.go @@ -1,7 +1,7 @@ package server import ( - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_events.go b/pkg/api/server/register_events.go index 4b7c645b0..acccebac1 100644 --- a/pkg/api/server/register_events.go +++ b/pkg/api/server/register_events.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_exec.go b/pkg/api/server/register_exec.go index 05fb2aee2..0f8c827c8 100644 --- a/pkg/api/server/register_exec.go +++ b/pkg/api/server/register_exec.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_generate.go b/pkg/api/server/register_generate.go index bce5484ab..abbad1485 100644 --- a/pkg/api/server/register_generate.go +++ b/pkg/api/server/register_generate.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) @@ -32,6 +32,11 @@ func (s *APIServer) registerGenerateHandlers(r *mux.Router) error { // default: false // description: Create a new container instead of starting an existing one. // - in: query + // name: noHeader + // type: boolean + // default: false + // description: Do not generate the header including the Podman version and the timestamp. + // - in: query // name: time // type: integer // default: 10 diff --git a/pkg/api/server/register_healthcheck.go b/pkg/api/server/register_healthcheck.go index 8c9876232..85f3d720c 100644 --- a/pkg/api/server/register_healthcheck.go +++ b/pkg/api/server/register_healthcheck.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go index 2ce0829b4..f6a8a37ca 100644 --- a/pkg/api/server/register_images.go +++ b/pkg/api/server/register_images.go @@ -3,8 +3,8 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_info.go b/pkg/api/server/register_info.go index a1dc9511d..c07d4699d 100644 --- a/pkg/api/server/register_info.go +++ b/pkg/api/server/register_info.go @@ -3,8 +3,8 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_manifest.go b/pkg/api/server/register_manifest.go index eefcc396e..c2da5156b 100644 --- a/pkg/api/server/register_manifest.go +++ b/pkg/api/server/register_manifest.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) @@ -30,7 +30,8 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error { // description: add all contents if given list // responses: // 200: - // $ref: "#/definitions/IDResponse" + // schema: + // $ref: "#/definitions/IDResponse" // 400: // $ref: "#/responses/BadParamError" // 404: @@ -96,7 +97,8 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error { // $ref: "#/definitions/ManifestAddOpts" // responses: // 200: - // $ref: "#/definitions/IDResponse" + // schema: + // $ref: "#/definitions/IDResponse" // 404: // $ref: "#/responses/NoSuchManifest" // 409: @@ -122,7 +124,8 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error { // description: image digest to be removed // responses: // 200: - // $ref: "#/definitions/IDResponse" + // schema: + // $ref: "#/definitions/IDResponse" // 400: // $ref: "#/responses/BadParamError" // 404: @@ -153,7 +156,8 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error { // type: boolean // responses: // 200: - // $ref: "#/definitions/IDResponse" + // schema: + // $ref: "#/definitions/IDResponse" // 400: // $ref: "#/responses/BadParamError" // 404: diff --git a/pkg/api/server/register_monitor.go b/pkg/api/server/register_monitor.go index 5db20667e..45d24af61 100644 --- a/pkg/api/server/register_monitor.go +++ b/pkg/api/server/register_monitor.go @@ -1,7 +1,7 @@ package server import ( - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_networks.go b/pkg/api/server/register_networks.go index d3345d8da..68a8d4ae4 100644 --- a/pkg/api/server/register_networks.go +++ b/pkg/api/server/register_networks.go @@ -3,8 +3,8 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_ping.go b/pkg/api/server/register_ping.go index 0343d2608..1d0876ec1 100644 --- a/pkg/api/server/register_ping.go +++ b/pkg/api/server/register_ping.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_play.go b/pkg/api/server/register_play.go index 6aa349a3b..dbb13cba3 100644 --- a/pkg/api/server/register_play.go +++ b/pkg/api/server/register_play.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_plugins.go b/pkg/api/server/register_plugins.go index 6600c1bbd..6fe217bfd 100644 --- a/pkg/api/server/register_plugins.go +++ b/pkg/api/server/register_plugins.go @@ -1,7 +1,7 @@ package server import ( - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_pods.go b/pkg/api/server/register_pods.go index 4873eb926..c66cc48ff 100644 --- a/pkg/api/server/register_pods.go +++ b/pkg/api/server/register_pods.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) @@ -36,11 +36,11 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error { // name: create // description: attributes for creating a pod // schema: - // type: object // $ref: "#/definitions/PodSpecGenerator" // responses: // 200: - // $ref: "#/definitions/IdResponse" + // schema: + // $ref: "#/definitions/IdResponse" // 400: // $ref: "#/responses/BadParamError" // 409: diff --git a/pkg/api/server/register_secrets.go b/pkg/api/server/register_secrets.go index 95abf83e8..1c5f5954b 100644 --- a/pkg/api/server/register_secrets.go +++ b/pkg/api/server/register_secrets.go @@ -3,8 +3,8 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_swagger.go b/pkg/api/server/register_swagger.go index 4237540f8..dca1df14b 100644 --- a/pkg/api/server/register_swagger.go +++ b/pkg/api/server/register_swagger.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_swarm.go b/pkg/api/server/register_swarm.go index 1f3166dcb..fce35ba32 100644 --- a/pkg/api/server/register_swarm.go +++ b/pkg/api/server/register_swarm.go @@ -4,7 +4,7 @@ import ( "errors" "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/utils" + "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/gorilla/mux" "github.com/sirupsen/logrus" ) diff --git a/pkg/api/server/register_system.go b/pkg/api/server/register_system.go index 524cdecd9..7bc16acc0 100644 --- a/pkg/api/server/register_system.go +++ b/pkg/api/server/register_system.go @@ -3,8 +3,8 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_version.go b/pkg/api/server/register_version.go index cf49c0fa9..0cedb5dc6 100644 --- a/pkg/api/server/register_version.go +++ b/pkg/api/server/register_version.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/register_volumes.go b/pkg/api/server/register_volumes.go index 68727f2e1..b19faefdd 100644 --- a/pkg/api/server/register_volumes.go +++ b/pkg/api/server/register_volumes.go @@ -3,8 +3,8 @@ package server import ( "net/http" - "github.com/containers/podman/v2/pkg/api/handlers/compat" - "github.com/containers/podman/v2/pkg/api/handlers/libpod" + "github.com/containers/podman/v3/pkg/api/handlers/compat" + "github.com/containers/podman/v3/pkg/api/handlers/libpod" "github.com/gorilla/mux" ) diff --git a/pkg/api/server/server.go b/pkg/api/server/server.go index 6926eda62..e23448fd1 100644 --- a/pkg/api/server/server.go +++ b/pkg/api/server/server.go @@ -13,10 +13,10 @@ import ( "syscall" "time" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/shutdown" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/api/server/idle" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/shutdown" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/api/server/idle" "github.com/coreos/go-systemd/v22/activation" "github.com/coreos/go-systemd/v22/daemon" "github.com/gorilla/mux" diff --git a/pkg/api/server/swagger.go b/pkg/api/server/swagger.go index d4fc33442..92efb8ef3 100644 --- a/pkg/api/server/swagger.go +++ b/pkg/api/server/swagger.go @@ -1,11 +1,11 @@ package server import ( - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/libpod/define" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/domain/entities/reports" - "github.com/containers/podman/v2/pkg/errorhandling" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/libpod/define" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/domain/entities/reports" + "github.com/containers/podman/v3/pkg/errorhandling" ) // No such image |