summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod/generate.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-07 16:16:15 -0500
committerGitHub <noreply@github.com>2020-12-07 16:16:15 -0500
commitbfbeece27bc370d33042ab3c4bf36b9288c85b7c (patch)
treec5a4b837b1f5c794e5f3a54cc2e36e31da4d8742 /pkg/api/handlers/libpod/generate.go
parenta5ca03915e7ad8b9db81d22a256013ce5ae3cc87 (diff)
parent749ee2a10ed689a06da699659c59872c0ed770d7 (diff)
downloadpodman-bfbeece27bc370d33042ab3c4bf36b9288c85b7c.tar.gz
podman-bfbeece27bc370d33042ab3c4bf36b9288c85b7c.tar.bz2
podman-bfbeece27bc370d33042ab3c4bf36b9288c85b7c.zip
Merge pull request #8581 from baude/kubegen
generate kube on multiple containers
Diffstat (limited to 'pkg/api/handlers/libpod/generate.go')
-rw-r--r--pkg/api/handlers/libpod/generate.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/api/handlers/libpod/generate.go b/pkg/api/handlers/libpod/generate.go
index 33bb75391..b3b8c1f16 100644
--- a/pkg/api/handlers/libpod/generate.go
+++ b/pkg/api/handlers/libpod/generate.go
@@ -60,7 +60,8 @@ func GenerateKube(w http.ResponseWriter, r *http.Request) {
runtime := r.Context().Value("runtime").(*libpod.Runtime)
decoder := r.Context().Value("decoder").(*schema.Decoder)
query := struct {
- Service bool `schema:"service"`
+ Names []string `schema:"names"`
+ Service bool `schema:"service"`
}{
// Defaults would go here.
}
@@ -73,7 +74,7 @@ func GenerateKube(w http.ResponseWriter, r *http.Request) {
containerEngine := abi.ContainerEngine{Libpod: runtime}
options := entities.GenerateKubeOptions{Service: query.Service}
- report, err := containerEngine.GenerateKube(r.Context(), utils.GetName(r), options)
+ report, err := containerEngine.GenerateKube(r.Context(), query.Names, options)
if err != nil {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "error generating YAML"))
return