summaryrefslogtreecommitdiff
path: root/pkg/bindings/play/play.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-17 17:22:37 +0000
committerGitHub <noreply@github.com>2020-12-17 17:22:37 +0000
commita17afa931d1aa73b8657cf26de3b49841837f66d (patch)
tree8b3e3408eea4fa15320f5c294d96b8e134bf49c4 /pkg/bindings/play/play.go
parent033336606f8aa9687cbdff5450c691b48d45e8e6 (diff)
parent86335aa4ae01dadecd36468409d742e68b76925d (diff)
downloadpodman-a17afa931d1aa73b8657cf26de3b49841837f66d.tar.gz
podman-a17afa931d1aa73b8657cf26de3b49841837f66d.tar.bz2
podman-a17afa931d1aa73b8657cf26de3b49841837f66d.zip
Merge pull request #8752 from baude/bindings3volumes
misc bindings to podman v3
Diffstat (limited to 'pkg/bindings/play/play.go')
-rw-r--r--pkg/bindings/play/play.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/pkg/bindings/play/play.go b/pkg/bindings/play/play.go
index cfb40d74b..9ee02a093 100644
--- a/pkg/bindings/play/play.go
+++ b/pkg/bindings/play/play.go
@@ -3,18 +3,19 @@ package play
import (
"context"
"net/http"
- "net/url"
"os"
"strconv"
- "github.com/containers/image/v5/types"
"github.com/containers/podman/v2/pkg/auth"
"github.com/containers/podman/v2/pkg/bindings"
"github.com/containers/podman/v2/pkg/domain/entities"
)
-func Kube(ctx context.Context, path string, options entities.PlayKubeOptions) (*entities.PlayKubeReport, error) {
+func Kube(ctx context.Context, path string, options *KubeOptions) (*entities.PlayKubeReport, error) {
var report entities.PlayKubeReport
+ if options == nil {
+ options = new(KubeOptions)
+ }
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
@@ -26,18 +27,19 @@ func Kube(ctx context.Context, path string, options entities.PlayKubeOptions) (*
}
defer f.Close()
- params := url.Values{}
- params.Set("network", options.Network)
- params.Set("logDriver", options.LogDriver)
- if options.SkipTLSVerify != types.OptionalBoolUndefined {
- params.Set("tlsVerify", strconv.FormatBool(options.SkipTLSVerify != types.OptionalBoolTrue))
+ params, err := options.ToParams()
+ if err != nil {
+ return nil, err
+ }
+ if options.SkipTLSVerify != nil {
+ params.Set("tlsVerify", strconv.FormatBool(options.GetSkipTLSVerify()))
}
- if options.Start != types.OptionalBoolUndefined {
- params.Set("start", strconv.FormatBool(options.Start == types.OptionalBoolTrue))
+ if options.Start != nil {
+ params.Set("start", strconv.FormatBool(options.GetStart()))
}
// TODO: have a global system context we can pass around (1st argument)
- header, err := auth.Header(nil, auth.XRegistryAuthHeader, options.Authfile, options.Username, options.Password)
+ header, err := auth.Header(nil, auth.XRegistryAuthHeader, options.GetAuthfile(), options.GetUsername(), options.GetPassword())
if err != nil {
return nil, err
}