summaryrefslogtreecommitdiff
path: root/pkg/bindings/kube
diff options
context:
space:
mode:
authorVladimir Kochnev <hashtable@yandex.ru>2022-08-26 03:24:40 +0300
committerVladimir Kochnev <hashtable@yandex.ru>2022-08-26 09:55:17 +0300
commitcfdca829382b83081a897ae36c4196678b52a9b4 (patch)
tree55b7fd9e9084307aad138ea8148c62d1e70c1bb3 /pkg/bindings/kube
parent36cf6f572a360af91bf261936b6ed6849f355478 (diff)
downloadpodman-cfdca829382b83081a897ae36c4196678b52a9b4.tar.gz
podman-cfdca829382b83081a897ae36c4196678b52a9b4.tar.bz2
podman-cfdca829382b83081a897ae36c4196678b52a9b4.zip
Mark some of the option fields as ignored in pkg/bindings
I realized that `params.Del("SkipTLSVerify")` doesn't have any effect because keys are always lowercased. So it should really be `params.Del("skiptlsverify")`. There's also a little bug introduced by 3bf52aa and b1d1248: if one passes `ProgressWriter` object having `Stringer` interface i.e. `bytes.Buffer` it ends up been serialized in query with `util.ToParams()`. To circumvent both problems I propose to mark non-serializable parameters with `schema:"-"` so there's no need to delete them from resulting `url.Values`. Signed-off-by: Vladimir Kochnev <hashtable@yandex.ru>
Diffstat (limited to 'pkg/bindings/kube')
-rw-r--r--pkg/bindings/kube/kube.go4
-rw-r--r--pkg/bindings/kube/types.go2
2 files changed, 4 insertions, 2 deletions
diff --git a/pkg/bindings/kube/kube.go b/pkg/bindings/kube/kube.go
index e727439cf..1b9f888ef 100644
--- a/pkg/bindings/kube/kube.go
+++ b/pkg/bindings/kube/kube.go
@@ -40,8 +40,10 @@ func PlayWithBody(ctx context.Context, body io.Reader, options *PlayOptions) (*e
if err != nil {
return nil, err
}
+ // SkipTLSVerify is special. It's not being serialized by ToParams()
+ // because we need to flip the boolean.
if options.SkipTLSVerify != nil {
- params.Set("tlsVerify", strconv.FormatBool(options.GetSkipTLSVerify()))
+ params.Set("tlsVerify", strconv.FormatBool(!options.GetSkipTLSVerify()))
}
if options.Start != nil {
params.Set("start", strconv.FormatBool(options.GetStart()))
diff --git a/pkg/bindings/kube/types.go b/pkg/bindings/kube/types.go
index 783d1912a..279a9f8f3 100644
--- a/pkg/bindings/kube/types.go
+++ b/pkg/bindings/kube/types.go
@@ -27,7 +27,7 @@ type PlayOptions struct {
SignaturePolicy *string
// SkipTLSVerify - skip https and certificate validation when
// contacting container registries.
- SkipTLSVerify *bool
+ SkipTLSVerify *bool `schema:"-"`
// SeccompProfileRoot - path to a directory containing seccomp
// profiles.
SeccompProfileRoot *string