aboutsummaryrefslogtreecommitdiff
path: root/pkg/bindings/images
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r--pkg/bindings/images/images.go4
-rw-r--r--pkg/bindings/images/pull.go4
-rw-r--r--pkg/bindings/images/push.go5
-rw-r--r--pkg/bindings/images/types.go10
4 files changed, 11 insertions, 12 deletions
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index bb7867c4e..ea7d445db 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -282,9 +282,9 @@ func Search(ctx context.Context, term string, options *SearchOptions) ([]entitie
}
params.Set("term", term)
- // Note: we have to verify if skipped is false.
+ // SkipTLSVerify is special. It's not being serialized by ToParams()
+ // because we need to flip the boolean.
if options.SkipTLSVerify != nil {
- params.Del("SkipTLSVerify")
params.Set("tlsVerify", strconv.FormatBool(!options.GetSkipTLSVerify()))
}
diff --git a/pkg/bindings/images/pull.go b/pkg/bindings/images/pull.go
index 109981c63..8caf45c0e 100644
--- a/pkg/bindings/images/pull.go
+++ b/pkg/bindings/images/pull.go
@@ -35,9 +35,9 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string,
}
params.Set("reference", rawImage)
+ // SkipTLSVerify is special. It's not being serialized by ToParams()
+ // because we need to flip the boolean.
if options.SkipTLSVerify != nil {
- params.Del("SkipTLSVerify")
- // Note: we have to verify if skipped is false.
params.Set("tlsVerify", strconv.FormatBool(!options.GetSkipTLSVerify()))
}
diff --git a/pkg/bindings/images/push.go b/pkg/bindings/images/push.go
index f1e059f8c..0e1309e91 100644
--- a/pkg/bindings/images/push.go
+++ b/pkg/bindings/images/push.go
@@ -38,10 +38,9 @@ func Push(ctx context.Context, source string, destination string, options *PushO
if err != nil {
return err
}
- // SkipTLSVerify is special. We need to delete the param added by
- // toparams and change the key and flip the bool
+ // SkipTLSVerify is special. It's not being serialized by ToParams()
+ // because we need to flip the boolean.
if options.SkipTLSVerify != nil {
- params.Del("SkipTLSVerify")
params.Set("tlsVerify", strconv.FormatBool(!options.GetSkipTLSVerify()))
}
params.Set("destination", destination)
diff --git a/pkg/bindings/images/types.go b/pkg/bindings/images/types.go
index 3ecfb9e09..f8630926e 100644
--- a/pkg/bindings/images/types.go
+++ b/pkg/bindings/images/types.go
@@ -136,9 +136,9 @@ type PushOptions struct {
// ProgressWriter is a writer where push progress are sent.
// Since API handler for image push is quiet by default, WithQuiet(false) is necessary for
// the writer to receive progress messages.
- ProgressWriter *io.Writer
+ ProgressWriter *io.Writer `schema:"-"`
// SkipTLSVerify to skip HTTPS and certificate verification.
- SkipTLSVerify *bool
+ SkipTLSVerify *bool `schema:"-"`
// RemoveSignatures Discard any pre-existing signatures in the image.
RemoveSignatures *bool
// Username for authenticating against the registry.
@@ -158,7 +158,7 @@ type SearchOptions struct {
// Limit the number of results.
Limit *int
// SkipTLSVerify to skip HTTPS and certificate verification.
- SkipTLSVerify *bool
+ SkipTLSVerify *bool `schema:"-"`
// ListTags search the available tags of the repository
ListTags *bool
}
@@ -183,12 +183,12 @@ type PullOptions struct {
// Password for authenticating against the registry.
Password *string
// ProgressWriter is a writer where pull progress are sent.
- ProgressWriter *io.Writer
+ ProgressWriter *io.Writer `schema:"-"`
// Quiet can be specified to suppress pull progress when pulling. Ignored
// for remote calls.
Quiet *bool
// SkipTLSVerify to skip HTTPS and certificate verification.
- SkipTLSVerify *bool
+ SkipTLSVerify *bool `schema:"-"`
// Username for authenticating against the registry.
Username *string
// Variant will overwrite the local variant for image pulls.