From 3bddeebf930efb872b99966df5553e0baf81834a Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 11 Feb 2021 14:15:26 +0100 Subject: Enable stylecheck linter Use the stylecheck linter and fix the reported problems. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger Signed-off-by: Matthew Heon --- cmd/podman/images/search.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmd/podman/images') diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go index c8ea4b04a..b8274cfce 100644 --- a/cmd/podman/images/search.go +++ b/cmd/podman/images/search.go @@ -156,12 +156,12 @@ func imageSearch(cmd *cobra.Command, args []string) error { return errors.Errorf("filters are not applicable to list tags result") } if report.IsJSON(searchOptions.Format) { - listTagsEntries := buildListTagsJson(searchReport) - return printJson(listTagsEntries) + listTagsEntries := buildListTagsJSON(searchReport) + return printArbitraryJSON(listTagsEntries) } row = "{{.Name}}\t{{.Tag}}\n" case report.IsJSON(searchOptions.Format): - return printJson(searchReport) + return printArbitraryJSON(searchReport) case cmd.Flags().Changed("format"): renderHeaders = parse.HasTable(searchOptions.Format) row = report.NormalizeFormat(searchOptions.Format) @@ -186,7 +186,7 @@ func imageSearch(cmd *cobra.Command, args []string) error { return tmpl.Execute(w, searchReport) } -func printJson(v interface{}) error { +func printArbitraryJSON(v interface{}) error { prettyJSON, err := json.MarshalIndent(v, "", " ") if err != nil { return err @@ -195,7 +195,7 @@ func printJson(v interface{}) error { return nil } -func buildListTagsJson(searchReport []entities.ImageSearchReport) []listEntryTag { +func buildListTagsJSON(searchReport []entities.ImageSearchReport) []listEntryTag { entries := []listEntryTag{} ReportLoop: -- cgit v1.2.3-54-g00ecf From fe4333c1e87ab479fda44261b2cb820484422f85 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 11 Feb 2021 22:55:56 +0100 Subject: Enable whitespace linter Use the whitespace linter and fix the reported problems. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger Signed-off-by: Matthew Heon --- .golangci.yml | 1 - cmd/podman/common/create.go | 1 - cmd/podman/common/create_opts.go | 1 - cmd/podman/common/createparse.go | 1 - cmd/podman/containers/attach.go | 1 - cmd/podman/containers/restore.go | 1 - cmd/podman/containers/wait.go | 1 - cmd/podman/generate/systemd.go | 1 - cmd/podman/images/list.go | 1 - cmd/podman/images/prune.go | 1 - cmd/podman/images/pull.go | 2 -- cmd/podman/images/trust_show.go | 1 - cmd/podman/networks/create.go | 1 - cmd/podman/networks/inspect.go | 1 - cmd/podman/networks/list.go | 1 - cmd/podman/play/kube.go | 1 - cmd/podman/pods/inspect.go | 1 - cmd/podman/shell_completion_test.go | 4 ---- cmd/podman/system/df.go | 1 - cmd/podman/system/prune.go | 1 - cmd/podman/system/renumber.go | 1 - libpod/boltdb_state.go | 3 --- libpod/container.go | 1 - libpod/container_inspect.go | 1 - libpod/container_internal_linux.go | 1 - libpod/container_path_resolution.go | 2 -- libpod/events/events.go | 1 - libpod/events/filters.go | 1 - libpod/events/logfile.go | 1 - libpod/image/image.go | 1 - libpod/image/image_test.go | 1 - libpod/image/prune.go | 2 -- libpod/image/utils.go | 1 - libpod/network/create.go | 1 - libpod/network/create_test.go | 1 - libpod/network/netconflist_test.go | 1 - libpod/oci_conmon_linux.go | 2 -- libpod/oci_util.go | 1 - libpod/options.go | 3 --- libpod/reset.go | 1 - libpod/runtime.go | 5 ----- libpod/runtime_ctr.go | 1 - libpod/runtime_img_test.go | 1 - libpod/runtime_pod_infra_linux.go | 1 - pkg/api/handlers/compat/events.go | 1 - pkg/api/handlers/compat/images.go | 1 - pkg/api/handlers/compat/images_history.go | 1 - pkg/api/handlers/compat/images_remove.go | 1 - pkg/api/handlers/libpod/containers.go | 3 --- pkg/api/handlers/libpod/images.go | 2 -- pkg/api/handlers/libpod/networks.go | 1 - pkg/api/handlers/utils/containers.go | 2 -- pkg/api/server/register_ping.go | 1 - pkg/auth/auth.go | 1 - pkg/bindings/containers/containers.go | 1 - pkg/bindings/containers/types_attach_options.go | 2 -- pkg/bindings/containers/types_checkpoint_options.go | 2 -- pkg/bindings/containers/types_commit_options.go | 2 -- pkg/bindings/containers/types_create_options.go | 2 -- pkg/bindings/containers/types_diff_options.go | 2 -- pkg/bindings/containers/types_execinspect_options.go | 2 -- pkg/bindings/containers/types_execstart_options.go | 2 -- pkg/bindings/containers/types_execstartandattach_options.go | 2 -- pkg/bindings/containers/types_exists_options.go | 2 -- pkg/bindings/containers/types_export_options.go | 2 -- pkg/bindings/containers/types_healthcheck_options.go | 2 -- pkg/bindings/containers/types_init_options.go | 2 -- pkg/bindings/containers/types_inspect_options.go | 2 -- pkg/bindings/containers/types_kill_options.go | 2 -- pkg/bindings/containers/types_list_options.go | 2 -- pkg/bindings/containers/types_log_options.go | 2 -- pkg/bindings/containers/types_mount_options.go | 2 -- pkg/bindings/containers/types_mountedcontainerpaths_options.go | 2 -- pkg/bindings/containers/types_pause_options.go | 2 -- pkg/bindings/containers/types_prune_options.go | 2 -- pkg/bindings/containers/types_remove_options.go | 2 -- pkg/bindings/containers/types_rename_options.go | 2 -- pkg/bindings/containers/types_resizeexectty_options.go | 2 -- pkg/bindings/containers/types_resizetty_options.go | 2 -- pkg/bindings/containers/types_restart_options.go | 2 -- pkg/bindings/containers/types_restore_options.go | 2 -- pkg/bindings/containers/types_shouldrestart_options.go | 2 -- pkg/bindings/containers/types_start_options.go | 2 -- pkg/bindings/containers/types_stats_options.go | 2 -- pkg/bindings/containers/types_stop_options.go | 2 -- pkg/bindings/containers/types_top_options.go | 2 -- pkg/bindings/containers/types_unmount_options.go | 2 -- pkg/bindings/containers/types_unpause_options.go | 2 -- pkg/bindings/containers/types_wait_options.go | 2 -- pkg/bindings/generate/types_kube_options.go | 2 -- pkg/bindings/generate/types_systemd_options.go | 2 -- pkg/bindings/generator/generator.go | 3 --- pkg/bindings/images/pull.go | 1 - pkg/bindings/images/types_diff_options.go | 2 -- pkg/bindings/images/types_exists_options.go | 2 -- pkg/bindings/images/types_export_options.go | 2 -- pkg/bindings/images/types_get_options.go | 2 -- pkg/bindings/images/types_history_options.go | 2 -- pkg/bindings/images/types_import_options.go | 2 -- pkg/bindings/images/types_list_options.go | 2 -- pkg/bindings/images/types_load_options.go | 2 -- pkg/bindings/images/types_prune_options.go | 2 -- pkg/bindings/images/types_pull_options.go | 2 -- pkg/bindings/images/types_push_options.go | 2 -- pkg/bindings/images/types_remove_options.go | 2 -- pkg/bindings/images/types_search_options.go | 2 -- pkg/bindings/images/types_tag_options.go | 2 -- pkg/bindings/images/types_tree_options.go | 2 -- pkg/bindings/images/types_untag_options.go | 2 -- pkg/bindings/manifests/types_add_options.go | 2 -- pkg/bindings/manifests/types_create_options.go | 2 -- pkg/bindings/manifests/types_inspect_options.go | 2 -- pkg/bindings/manifests/types_remove_options.go | 2 -- pkg/bindings/network/types_connect_options.go | 2 -- pkg/bindings/network/types_create_options.go | 2 -- pkg/bindings/network/types_disconnect_options.go | 2 -- pkg/bindings/network/types_inspect_options.go | 2 -- pkg/bindings/network/types_list_options.go | 2 -- pkg/bindings/network/types_remove_options.go | 2 -- pkg/bindings/play/types_kube_options.go | 2 -- pkg/bindings/pods/types_create_options.go | 2 -- pkg/bindings/pods/types_exists_options.go | 2 -- pkg/bindings/pods/types_inspect_options.go | 2 -- pkg/bindings/pods/types_kill_options.go | 2 -- pkg/bindings/pods/types_list_options.go | 2 -- pkg/bindings/pods/types_pause_options.go | 2 -- pkg/bindings/pods/types_prune_options.go | 2 -- pkg/bindings/pods/types_remove_options.go | 2 -- pkg/bindings/pods/types_restart_options.go | 2 -- pkg/bindings/pods/types_start_options.go | 2 -- pkg/bindings/pods/types_stats_options.go | 2 -- pkg/bindings/pods/types_stop_options.go | 2 -- pkg/bindings/pods/types_top_options.go | 2 -- pkg/bindings/pods/types_unpause_options.go | 2 -- pkg/bindings/system/types_disk_options.go | 2 -- pkg/bindings/system/types_events_options.go | 2 -- pkg/bindings/system/types_info_options.go | 2 -- pkg/bindings/system/types_prune_options.go | 2 -- pkg/bindings/system/types_version_options.go | 2 -- pkg/bindings/volumes/types_create_options.go | 2 -- pkg/bindings/volumes/types_inspect_options.go | 2 -- pkg/bindings/volumes/types_list_options.go | 2 -- pkg/bindings/volumes/types_prune_options.go | 2 -- pkg/bindings/volumes/types_remove_options.go | 2 -- pkg/cgroups/cpu.go | 1 - pkg/domain/infra/abi/images.go | 2 -- pkg/domain/infra/abi/play.go | 1 - pkg/domain/infra/tunnel/containers.go | 3 --- pkg/domain/infra/tunnel/helpers.go | 2 -- pkg/domain/infra/tunnel/images.go | 1 - pkg/lookup/lookup.go | 1 - pkg/netns/netns_linux.go | 2 -- pkg/rootlessport/rootlessport_linux.go | 1 - pkg/systemd/generate/common_test.go | 1 - pkg/trust/trust.go | 1 - pkg/util/utils.go | 1 - 156 files changed, 269 deletions(-) (limited to 'cmd/podman/images') diff --git a/.golangci.yml b/.golangci.yml index 5e98f5fb6..76cf0cad8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -39,7 +39,6 @@ linters: - staticcheck - forbidigo - exhaustive - - whitespace - unparam - gofumpt - gci diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index 915ff63b6..3ea1a40d0 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -796,5 +796,4 @@ func DefineCreateFlags(cmd *cobra.Command, cf *ContainerCLIOpts) { "Configure cgroup v2 (key=value)", ) _ = cmd.RegisterFlagCompletionFunc(cgroupConfFlagName, completion.AutocompleteNone) - } diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index ee6165b1b..5fcbda0ce 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -272,7 +272,6 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup endpointsConfig := cc.NetworkingConfig.EndpointsConfig cniNetworks := make([]string, 0, len(endpointsConfig)) for netName, endpoint := range endpointsConfig { - cniNetworks = append(cniNetworks, netName) if endpoint == nil { diff --git a/cmd/podman/common/createparse.go b/cmd/podman/common/createparse.go index 3a69f11b6..140518cf7 100644 --- a/cmd/podman/common/createparse.go +++ b/cmd/podman/common/createparse.go @@ -26,5 +26,4 @@ func (c *ContainerCLIOpts) validate() error { return errors.Errorf("invalid image-volume type %q. Pick one of bind, tmpfs, or ignore", c.ImageVolume) } return nil - } diff --git a/cmd/podman/containers/attach.go b/cmd/podman/containers/attach.go index f00c5378b..7c7d780bc 100644 --- a/cmd/podman/containers/attach.go +++ b/cmd/podman/containers/attach.go @@ -68,7 +68,6 @@ func init() { }) attachFlags(containerAttachCommand) validate.AddLatestFlag(containerAttachCommand, &attachOpts.Latest) - } func attach(cmd *cobra.Command, args []string) error { diff --git a/cmd/podman/containers/restore.go b/cmd/podman/containers/restore.go index 49c0be88e..61bd84219 100644 --- a/cmd/podman/containers/restore.go +++ b/cmd/podman/containers/restore.go @@ -118,5 +118,4 @@ func restore(_ *cobra.Command, args []string) error { } } return errs.PrintErrors() - } diff --git a/cmd/podman/containers/wait.go b/cmd/podman/containers/wait.go index 7a531b98a..7831ef1c9 100644 --- a/cmd/podman/containers/wait.go +++ b/cmd/podman/containers/wait.go @@ -56,7 +56,6 @@ func waitFlags(cmd *cobra.Command) { conditionFlagName := "condition" flags.StringVar(&waitCondition, conditionFlagName, "stopped", "Condition to wait on") _ = cmd.RegisterFlagCompletionFunc(conditionFlagName, common.AutocompleteWaitCondition) - } func init() { diff --git a/cmd/podman/generate/systemd.go b/cmd/podman/generate/systemd.go index f9099d3b8..7b2d9ebb7 100644 --- a/cmd/podman/generate/systemd.go +++ b/cmd/podman/generate/systemd.go @@ -128,7 +128,6 @@ func systemd(cmd *cobra.Command, args []string) error { default: return errors.Errorf("unknown --format argument: %s", format) } - } func printDefault(units map[string]string) error { diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 8a7951923..65486e3ba 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -275,7 +275,6 @@ func tokenRepoTag(ref string) (string, string, error) { } return name, tag, nil - } func sortFunc(key string, data []imageReporter) func(i, j int) bool { diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go index 268a68681..8ded8d352 100644 --- a/cmd/podman/images/prune.go +++ b/cmd/podman/images/prune.go @@ -48,7 +48,6 @@ func init() { flags.StringArrayVar(&filter, filterFlagName, []string{}, "Provide filter values (e.g. 'label==')") //TODO: add completion for filters _ = pruneCmd.RegisterFlagCompletionFunc(filterFlagName, completion.AutocompleteNone) - } func prune(cmd *cobra.Command, args []string) error { diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index fe92baebe..3b2595757 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -110,11 +110,9 @@ func pullFlags(cmd *cobra.Command) { _ = cmd.RegisterFlagCompletionFunc(authfileFlagName, completion.AutocompleteDefault) if !registry.IsRemote() { - certDirFlagName := "cert-dir" flags.StringVar(&pullOptions.CertDir, certDirFlagName, "", "`Pathname` of a directory containing TLS certificates and keys") _ = cmd.RegisterFlagCompletionFunc(certDirFlagName, completion.AutocompleteDefault) - } _ = flags.MarkHidden("signature-policy") } diff --git a/cmd/podman/images/trust_show.go b/cmd/podman/images/trust_show.go index dc35dc6a1..89733a1aa 100644 --- a/cmd/podman/images/trust_show.go +++ b/cmd/podman/images/trust_show.go @@ -42,7 +42,6 @@ func init() { _ = showFlags.MarkHidden("policypath") showFlags.StringVar(&showTrustOptions.RegistryPath, "registrypath", "", "") _ = showFlags.MarkHidden("registrypath") - } func showTrust(cmd *cobra.Command, args []string) error { diff --git a/cmd/podman/networks/create.go b/cmd/podman/networks/create.go index 1a091f111..d1cbe253f 100644 --- a/cmd/podman/networks/create.go +++ b/cmd/podman/networks/create.go @@ -80,7 +80,6 @@ func init() { Parent: networkCmd, }) networkCreateFlags(networkCreateCommand) - } func networkCreate(cmd *cobra.Command, args []string) error { diff --git a/cmd/podman/networks/inspect.go b/cmd/podman/networks/inspect.go index 671b0265f..bd9f76ea9 100644 --- a/cmd/podman/networks/inspect.go +++ b/cmd/podman/networks/inspect.go @@ -39,5 +39,4 @@ func init() { func networkInspect(_ *cobra.Command, args []string) error { inspectOpts.Type = inspect.NetworkType return inspect.Inspect(args, *inspectOpts) - } diff --git a/cmd/podman/networks/list.go b/cmd/podman/networks/list.go index 16ae980dc..6f63e97cc 100644 --- a/cmd/podman/networks/list.go +++ b/cmd/podman/networks/list.go @@ -51,7 +51,6 @@ func networkListFlags(flags *pflag.FlagSet) { filterFlagName := "filter" flags.StringArrayVarP(&filters, filterFlagName, "f", nil, "Provide filter values (e.g. 'name=podman')") _ = networklistCommand.RegisterFlagCompletionFunc(filterFlagName, common.AutocompleteNetworkFilters) - } func init() { diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go index 4c44fa30f..511e208cf 100644 --- a/cmd/podman/play/kube.go +++ b/cmd/podman/play/kube.go @@ -77,7 +77,6 @@ func init() { _ = kubeCmd.RegisterFlagCompletionFunc(authfileFlagName, completion.AutocompleteDefault) if !registry.IsRemote() { - certDirFlagName := "cert-dir" flags.StringVar(&kubeOptions.CertDir, certDirFlagName, "", "`Pathname` of a directory containing TLS certificates and keys") _ = kubeCmd.RegisterFlagCompletionFunc(certDirFlagName, completion.AutocompleteDefault) diff --git a/cmd/podman/pods/inspect.go b/cmd/podman/pods/inspect.go index e809be0c9..0fbb730ce 100644 --- a/cmd/podman/pods/inspect.go +++ b/cmd/podman/pods/inspect.go @@ -50,7 +50,6 @@ func init() { } func inspect(cmd *cobra.Command, args []string) error { - if len(args) < 1 && !inspectOptions.Latest { return errors.Errorf("you must provide the name or id of a running pod") } diff --git a/cmd/podman/shell_completion_test.go b/cmd/podman/shell_completion_test.go index d2b500b09..3f6f56fbe 100644 --- a/cmd/podman/shell_completion_test.go +++ b/cmd/podman/shell_completion_test.go @@ -26,14 +26,11 @@ import ( ) func TestShellCompletionFunctions(t *testing.T) { - rootCmd := parseCommands() checkCommand(t, rootCmd) - } func checkCommand(t *testing.T, cmd *cobra.Command) { - if cmd.HasSubCommands() { for _, childCmd := range cmd.Commands() { checkCommand(t, childCmd) @@ -46,7 +43,6 @@ func checkCommand(t *testing.T, cmd *cobra.Command) { // loop over all local flags cmd.LocalFlags().VisitAll(func(flag *pflag.Flag) { - // an error means that there is a completion function for this flag err := cmd.RegisterFlagCompletionFunc(flag.Name, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { return nil, cobra.ShellCompDirectiveDefault diff --git a/cmd/podman/system/df.go b/cmd/podman/system/df.go index a9eab24bb..68b244e35 100644 --- a/cmd/podman/system/df.go +++ b/cmd/podman/system/df.go @@ -50,7 +50,6 @@ func init() { formatFlagName := "format" flags.StringVar(&dfOptions.Format, formatFlagName, "", "Pretty-print images using a Go template") _ = dfSystemCommand.RegisterFlagCompletionFunc(formatFlagName, completion.AutocompleteNone) - } func df(cmd *cobra.Command, args []string) error { diff --git a/cmd/podman/system/prune.go b/cmd/podman/system/prune.go index 5e96a654a..7ec08366e 100644 --- a/cmd/podman/system/prune.go +++ b/cmd/podman/system/prune.go @@ -51,7 +51,6 @@ func init() { filterFlagName := "filter" flags.StringArrayVar(&filters, filterFlagName, []string{}, "Provide filter values (e.g. 'label==')") _ = pruneCommand.RegisterFlagCompletionFunc(filterFlagName, completion.AutocompleteNone) - } func prune(cmd *cobra.Command, args []string) error { diff --git a/cmd/podman/system/renumber.go b/cmd/podman/system/renumber.go index b1683395f..37f9a5865 100644 --- a/cmd/podman/system/renumber.go +++ b/cmd/podman/system/renumber.go @@ -39,7 +39,6 @@ func init() { Command: renumberCommand, Parent: systemCmd, }) - } func renumber(cmd *cobra.Command, args []string) { // Shutdown all running engines, `renumber` will hijack all methods diff --git a/libpod/boltdb_state.go b/libpod/boltdb_state.go index df00a8851..c9d214cd0 100644 --- a/libpod/boltdb_state.go +++ b/libpod/boltdb_state.go @@ -904,7 +904,6 @@ func (s *BoltState) ContainerInUse(ctr *Container) ([]string, error) { } return depCtrs, nil - } // AllContainers retrieves all the containers in the database @@ -962,7 +961,6 @@ func (s *BoltState) AllContainers() ([]*Container, error) { } return nil - }) }) if err != nil { @@ -2580,7 +2578,6 @@ func (s *BoltState) LookupVolume(name string) (*Volume, error) { } return volume, nil - } // HasVolume returns true if the given volume exists in the state, otherwise it returns false diff --git a/libpod/container.go b/libpod/container.go index ed7535bc8..5d90c31fd 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -1056,7 +1056,6 @@ func (c *Container) NetworkDisabled() (bool, error) { return container.NetworkDisabled() } return networkDisabled(c) - } func networkDisabled(c *Container) (bool, error) { diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index cc8b75472..412f7c6f1 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -789,7 +789,6 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named if c.config.UTSNsCtr != "" { utsMode = fmt.Sprintf("container:%s", c.config.UTSNsCtr) } else if ctrSpec.Linux != nil { - // Locate the spec's UTS namespace. // If there is none, it's uts=host. // If there is one and it has a path, it's "ns:". diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 9f4c2b81b..2f1bd52c4 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -1621,7 +1621,6 @@ func (c *Container) makeBindMounts() error { return errors.Wrapf(err, "error setting timezone for container %s", c.ID()) } c.state.BindMounts["/etc/localtime"] = localtimePath - } } diff --git a/libpod/container_path_resolution.go b/libpod/container_path_resolution.go index 51e3844c8..5245314ae 100644 --- a/libpod/container_path_resolution.go +++ b/libpod/container_path_resolution.go @@ -86,14 +86,12 @@ func (c *Container) resolvePath(mountPoint string, containerPath string) (string return "", "", err } return mount.Source, absolutePathOnTheBindMount, nil - } if searchPath == "/" { // Cannot go beyond "/", so we're done. break } - // Walk *down* the path (e.g., "/foo/bar/x" -> "/foo/bar"). searchPath = filepath.Dir(searchPath) } diff --git a/libpod/events/events.go b/libpod/events/events.go index aa0401b62..01ea6a386 100644 --- a/libpod/events/events.go +++ b/libpod/events/events.go @@ -97,7 +97,6 @@ func newEventFromJSONString(event string) (*Event, error) { return nil, err } return &e, nil - } // ToString converts a Type to a string diff --git a/libpod/events/filters.go b/libpod/events/filters.go index 62891d32c..26e1e10ba 100644 --- a/libpod/events/filters.go +++ b/libpod/events/filters.go @@ -86,7 +86,6 @@ func generateEventSinceOption(timeSince time.Time) func(e *Event) bool { func generateEventUntilOption(timeUntil time.Time) func(e *Event) bool { return func(e *Event) bool { return e.Time.Before(timeUntil) - } } diff --git a/libpod/events/logfile.go b/libpod/events/logfile.go index 05ae3ce52..c5feabe66 100644 --- a/libpod/events/logfile.go +++ b/libpod/events/logfile.go @@ -39,7 +39,6 @@ func (e EventLogFile) Write(ee Event) error { return err } return nil - } // Reads from the log file diff --git a/libpod/image/image.go b/libpod/image/image.go index d732aecfe..8d8af0064 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -1688,7 +1688,6 @@ func (i *Image) GetConfigBlob(ctx context.Context) (*manifest.Schema2Image, erro return nil, errors.Wrapf(err, "unable to parse image blob for %s", i.ID()) } return &blob, nil - } // GetHealthCheck returns a HealthConfig for an image. This function only works with diff --git a/libpod/image/image_test.go b/libpod/image/image_test.go index 2704b8baf..8055ef7b1 100644 --- a/libpod/image/image_test.go +++ b/libpod/image/image_test.go @@ -66,7 +66,6 @@ func makeLocalMatrix(b, bg *Image) []localImageTest { l = append(l, busybox, busyboxGlibc) return l - } func TestMain(m *testing.M) { diff --git a/libpod/image/prune.go b/libpod/image/prune.go index 587c99333..6f026f630 100644 --- a/libpod/image/prune.go +++ b/libpod/image/prune.go @@ -52,7 +52,6 @@ func generatePruneFilterFuncs(filter, filterValue string) (ImageFilter, error) { } return false }, nil - } return nil, nil } @@ -170,7 +169,6 @@ func (ir *Runtime) PruneImages(ctx context.Context, all bool, filter []string) ( Size: uint64(imgSize), }) } - } return preports, nil } diff --git a/libpod/image/utils.go b/libpod/image/utils.go index 6cc613b28..8882adcc1 100644 --- a/libpod/image/utils.go +++ b/libpod/image/utils.go @@ -45,7 +45,6 @@ func findImageInRepotags(search imageParts, images []*Image) (*storage.Image, er } } if len(candidates) == 0 { - return nil, errors.Wrapf(define.ErrNoSuchImage, "unable to find a name and tag match for %s in repotags", searchName) } diff --git a/libpod/network/create.go b/libpod/network/create.go index 79bc47146..7088b5cd6 100644 --- a/libpod/network/create.go +++ b/libpod/network/create.go @@ -75,7 +75,6 @@ func validateBridgeOptions(options entities.NetworkCreateOptions) error { } return nil - } // parseMTU parses the mtu option diff --git a/libpod/network/create_test.go b/libpod/network/create_test.go index 0b828e635..017bf31fe 100644 --- a/libpod/network/create_test.go +++ b/libpod/network/create_test.go @@ -8,7 +8,6 @@ import ( ) func Test_validateBridgeOptions(t *testing.T) { - tests := []struct { name string subnet net.IPNet diff --git a/libpod/network/netconflist_test.go b/libpod/network/netconflist_test.go index 5ff733f0f..161764ed9 100644 --- a/libpod/network/netconflist_test.go +++ b/libpod/network/netconflist_test.go @@ -7,7 +7,6 @@ import ( ) func TestNewIPAMDefaultRoute(t *testing.T) { - tests := []struct { name string isIPv6 bool diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index 23bfb29d7..38ffba7d2 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -1228,7 +1228,6 @@ func prepareProcessExec(c *Container, options *ExecOptions, env []string, sessio if options.Cwd != "" { pspec.Cwd = options.Cwd - } var addGroups []string @@ -1798,5 +1797,4 @@ func httpAttachNonTerminalCopy(container *net.UnixConn, http *bufio.ReadWriter, return err } } - } diff --git a/libpod/oci_util.go b/libpod/oci_util.go index d40cf13bd..4ec050d6d 100644 --- a/libpod/oci_util.go +++ b/libpod/oci_util.go @@ -103,7 +103,6 @@ func bindPorts(ports []ocicni.PortMapping) ([]*os.File, error) { } default: return nil, fmt.Errorf("unknown protocol %s", i.Protocol) - } } return files, nil diff --git a/libpod/options.go b/libpod/options.go index 20f62ee37..b6c8a5c3f 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1108,7 +1108,6 @@ func WithLogTag(tag string) CtrCreateOption { return nil } - } // WithCgroupsMode disables the creation of CGroups for the conmon process. @@ -1130,7 +1129,6 @@ func WithCgroupsMode(mode string) CtrCreateOption { return nil } - } // WithCgroupParent sets the Cgroup Parent of the new container. @@ -1429,7 +1427,6 @@ func WithOverlayVolumes(volumes []*ContainerOverlayVolume) CtrCreateOption { } for _, vol := range volumes { - ctr.config.OverlayVolumes = append(ctr.config.OverlayVolumes, &ContainerOverlayVolume{ Dest: vol.Dest, Source: vol.Source, diff --git a/libpod/reset.go b/libpod/reset.go index 24efeed40..3346f9d3f 100644 --- a/libpod/reset.go +++ b/libpod/reset.go @@ -16,7 +16,6 @@ import ( // Reset removes all storage func (r *Runtime) Reset(ctx context.Context) error { - pods, err := r.GetAllPods() if err != nil { return err diff --git a/libpod/runtime.go b/libpod/runtime.go index 0dc220b52..9ab98a27e 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -146,7 +146,6 @@ func NewRuntime(ctx context.Context, options ...RuntimeOption) (*Runtime, error) // An error will be returned if the configuration file at the given path does // not exist or cannot be loaded func NewRuntimeFromConfig(ctx context.Context, userConfig *config.Config, options ...RuntimeOption) (*Runtime, error) { - return newRuntimeFromConfig(ctx, userConfig, options...) } @@ -382,7 +381,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) { // Initialize remaining OCI runtimes for name, paths := range runtime.config.Engine.OCIRuntimes { - ociRuntime, err := newConmonOCIRuntime(name, paths, runtime.conmonPath, runtime.runtimeFlags, runtime.config) if err != nil { // Don't fatally error. @@ -437,7 +435,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) { // Set up the CNI net plugin if !rootless.IsRootless() { - netPlugin, err := ocicni.InitCNI(runtime.config.Network.DefaultNetwork, runtime.config.Network.NetworkConfigDir, runtime.config.Network.CNIPluginDirs...) if err != nil { return errors.Wrapf(err, "error configuring CNI network plugin") @@ -484,7 +481,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) { if became { os.Exit(ret) } - } // If the file doesn't exist, we need to refresh the state // This will trigger on first use as well, but refreshing an @@ -787,7 +783,6 @@ type DBConfig struct { // mergeDBConfig merges the configuration from the database. func (r *Runtime) mergeDBConfig(dbConfig *DBConfig) { - c := &r.config.Engine if !r.storageSet.RunRootSet && dbConfig.StorageTmp != "" { if r.storageConfig.RunRoot != dbConfig.StorageTmp && diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index d2bcd8db3..af6cc914e 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -1128,7 +1128,6 @@ func (r *Runtime) IsStorageContainerMounted(id string) (bool, string, error) { // StorageContainers returns a list of containers from containers/storage that // are not currently known to Podman. func (r *Runtime) StorageContainers() ([]storage.Container, error) { - if r.store == nil { return nil, define.ErrStoreNotInitialized } diff --git a/libpod/runtime_img_test.go b/libpod/runtime_img_test.go index 6ca4d900b..40d5860cf 100644 --- a/libpod/runtime_img_test.go +++ b/libpod/runtime_img_test.go @@ -26,7 +26,6 @@ func createTmpFile(content []byte) (string, error) { if _, err := tmpfile.Write(content); err != nil { return "", err - } if err := tmpfile.Close(); err != nil { return "", err diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go index 40632bdd0..c6f268182 100644 --- a/libpod/runtime_pod_infra_linux.go +++ b/libpod/runtime_pod_infra_linux.go @@ -24,7 +24,6 @@ const ( ) func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawImageName, imgID string, config *v1.ImageConfig) (*Container, error) { - // Set up generator for infra container defaults g, err := generate.New("linux") if err != nil { diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index 82a74e419..7dad5f566 100644 --- a/pkg/api/handlers/compat/events.go +++ b/pkg/api/handlers/compat/events.go @@ -111,7 +111,6 @@ func GetEvents(w http.ResponseWriter, r *http.Request) { Until: query.Until, } errorChannel <- runtime.Events(r.Context(), readOpts) - }() var flush = func() {} diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go index ab2b1f471..0d75d1a94 100644 --- a/pkg/api/handlers/compat/images.go +++ b/pkg/api/handlers/compat/images.go @@ -202,7 +202,6 @@ func CreateImageFromSrc(w http.ResponseWriter, r *http.Request) { ProgressDetail: map[string]string{}, Id: iid, }) - } func CreateImageFromImage(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/compat/images_history.go b/pkg/api/handlers/compat/images_history.go index 3b72798e4..174bc6234 100644 --- a/pkg/api/handlers/compat/images_history.go +++ b/pkg/api/handlers/compat/images_history.go @@ -17,7 +17,6 @@ func HistoryImage(w http.ResponseWriter, r *http.Request) { if err != nil { utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Wrapf(err, "failed to find image %s", name)) return - } history, err := newImage.History(r.Context()) if err != nil { diff --git a/pkg/api/handlers/compat/images_remove.go b/pkg/api/handlers/compat/images_remove.go index 9731c521c..dd2d96bbb 100644 --- a/pkg/api/handlers/compat/images_remove.go +++ b/pkg/api/handlers/compat/images_remove.go @@ -54,5 +54,4 @@ func RemoveImage(w http.ResponseWriter, r *http.Request) { } utils.WriteResponse(w, http.StatusOK, response) - } diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go index 619cbfd8b..4e79e4a42 100644 --- a/pkg/api/handlers/libpod/containers.go +++ b/pkg/api/handlers/libpod/containers.go @@ -48,7 +48,6 @@ func ContainerExists(w http.ResponseWriter, r *http.Request) { } utils.InternalServerError(w, err) return - } if report.Value { utils.WriteResponse(w, http.StatusNoContent, "") @@ -162,7 +161,6 @@ func UnmountContainer(w http.ResponseWriter, r *http.Request) { utils.InternalServerError(w, err) } utils.WriteResponse(w, http.StatusNoContent, "") - } func MountContainer(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) @@ -361,7 +359,6 @@ func ShouldRestart(w http.ResponseWriter, r *http.Request) { } utils.InternalServerError(w, err) return - } if report.Value { utils.WriteResponse(w, http.StatusNoContent, "") diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go index 97cd5a65e..efc2b53b5 100644 --- a/pkg/api/handlers/libpod/images.go +++ b/pkg/api/handlers/libpod/images.go @@ -266,7 +266,6 @@ func ExportImages(w http.ResponseWriter, r *http.Request) { if len(query.References) > 1 && query.Format != define.V2s2Archive { utils.Error(w, "unsupported format", http.StatusInternalServerError, errors.Errorf("multi-image archives must use format of %s", define.V2s2Archive)) return - } switch query.Format { @@ -445,7 +444,6 @@ func PushImage(w http.ResponseWriter, r *http.Request) { if authconf != nil { username = authconf.Username password = authconf.Password - } options := entities.ImagePushOptions{ Authfile: authfile, diff --git a/pkg/api/handlers/libpod/networks.go b/pkg/api/handlers/libpod/networks.go index 8511e2733..92279fcc8 100644 --- a/pkg/api/handlers/libpod/networks.go +++ b/pkg/api/handlers/libpod/networks.go @@ -42,7 +42,6 @@ func CreateNetwork(w http.ResponseWriter, r *http.Request) { return } utils.WriteResponse(w, http.StatusOK, report) - } func ListNetworks(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) diff --git a/pkg/api/handlers/utils/containers.go b/pkg/api/handlers/utils/containers.go index c3ca6a2fb..e79def6f3 100644 --- a/pkg/api/handlers/utils/containers.go +++ b/pkg/api/handlers/utils/containers.go @@ -141,7 +141,6 @@ func WaitContainerLibpod(w http.ResponseWriter, r *http.Request) { type containerWaitFn func(conditions ...define.ContainerStatus) (int32, error) func createContainerWaitFn(ctx context.Context, containerName string, interval time.Duration) containerWaitFn { - runtime := ctx.Value("runtime").(*libpod.Runtime) var containerEngine entities.ContainerEngine = &abi.ContainerEngine{Libpod: runtime} @@ -170,7 +169,6 @@ func isValidDockerCondition(cond string) bool { } func waitDockerCondition(ctx context.Context, containerName string, interval time.Duration, dockerCondition string) (int32, error) { - containerWait := createContainerWaitFn(ctx, containerName, interval) var err error diff --git a/pkg/api/server/register_ping.go b/pkg/api/server/register_ping.go index 446a12a68..0343d2608 100644 --- a/pkg/api/server/register_ping.go +++ b/pkg/api/server/register_ping.go @@ -8,7 +8,6 @@ import ( ) func (s *APIServer) registerPingHandlers(r *mux.Router) error { - r.Handle("/_ping", s.APIHandler(compat.Ping)).Methods(http.MethodGet, http.MethodHead) r.Handle(VersionedPath("/_ping"), s.APIHandler(compat.Ping)).Methods(http.MethodGet, http.MethodHead) // swagger:operation GET /libpod/_ping libpod libpodPingGet diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index fcbf6fe39..9c1d87c4f 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -41,7 +41,6 @@ func GetCredentials(r *http.Request) (*types.DockerAuthConfig, string, HeaderAut case has(XRegistryAuthHeader): c, f, err := getAuthCredentials(r) return c, f, XRegistryAuthHeader, err - } return nil, "", "", nil } diff --git a/pkg/bindings/containers/containers.go b/pkg/bindings/containers/containers.go index 0a180c73d..c84595011 100644 --- a/pkg/bindings/containers/containers.go +++ b/pkg/bindings/containers/containers.go @@ -137,7 +137,6 @@ func Kill(ctx context.Context, nameOrID string, options *KillOptions) error { return err } return response.Process(nil) - } // Pause pauses a given container. The nameOrID can be a container name diff --git a/pkg/bindings/containers/types_attach_options.go b/pkg/bindings/containers/types_attach_options.go index ab5a1615c..88ade89b4 100644 --- a/pkg/bindings/containers/types_attach_options.go +++ b/pkg/bindings/containers/types_attach_options.go @@ -60,7 +60,6 @@ func (o *AttachOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *AttachOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_checkpoint_options.go b/pkg/bindings/containers/types_checkpoint_options.go index d239c476f..002a08e00 100644 --- a/pkg/bindings/containers/types_checkpoint_options.go +++ b/pkg/bindings/containers/types_checkpoint_options.go @@ -60,7 +60,6 @@ func (o *CheckpointOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *CheckpointOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_commit_options.go b/pkg/bindings/containers/types_commit_options.go index 061f16e25..006fe7ae7 100644 --- a/pkg/bindings/containers/types_commit_options.go +++ b/pkg/bindings/containers/types_commit_options.go @@ -60,7 +60,6 @@ func (o *CommitOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *CommitOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_create_options.go b/pkg/bindings/containers/types_create_options.go index 8cde11335..914a6ed3e 100644 --- a/pkg/bindings/containers/types_create_options.go +++ b/pkg/bindings/containers/types_create_options.go @@ -60,7 +60,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_diff_options.go b/pkg/bindings/containers/types_diff_options.go index e912bf041..ebf3a7ad8 100644 --- a/pkg/bindings/containers/types_diff_options.go +++ b/pkg/bindings/containers/types_diff_options.go @@ -60,7 +60,6 @@ func (o *DiffOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *DiffOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_execinspect_options.go b/pkg/bindings/containers/types_execinspect_options.go index b870db46b..772318cd3 100644 --- a/pkg/bindings/containers/types_execinspect_options.go +++ b/pkg/bindings/containers/types_execinspect_options.go @@ -60,7 +60,6 @@ func (o *ExecInspectOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ExecInspectOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_execstart_options.go b/pkg/bindings/containers/types_execstart_options.go index 95f97b1d7..9a032d200 100644 --- a/pkg/bindings/containers/types_execstart_options.go +++ b/pkg/bindings/containers/types_execstart_options.go @@ -60,7 +60,6 @@ func (o *ExecStartOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ExecStartOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_execstartandattach_options.go b/pkg/bindings/containers/types_execstartandattach_options.go index 1981c319a..6bc288de3 100644 --- a/pkg/bindings/containers/types_execstartandattach_options.go +++ b/pkg/bindings/containers/types_execstartandattach_options.go @@ -62,7 +62,6 @@ func (o *ExecStartAndAttachOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -71,7 +70,6 @@ func (o *ExecStartAndAttachOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_exists_options.go b/pkg/bindings/containers/types_exists_options.go index a52777600..6a9086c78 100644 --- a/pkg/bindings/containers/types_exists_options.go +++ b/pkg/bindings/containers/types_exists_options.go @@ -60,7 +60,6 @@ func (o *ExistsOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ExistsOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_export_options.go b/pkg/bindings/containers/types_export_options.go index 3943a5a3b..595d2cf87 100644 --- a/pkg/bindings/containers/types_export_options.go +++ b/pkg/bindings/containers/types_export_options.go @@ -60,7 +60,6 @@ func (o *ExportOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ExportOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_healthcheck_options.go b/pkg/bindings/containers/types_healthcheck_options.go index a548232cd..3e2b445af 100644 --- a/pkg/bindings/containers/types_healthcheck_options.go +++ b/pkg/bindings/containers/types_healthcheck_options.go @@ -60,7 +60,6 @@ func (o *HealthCheckOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *HealthCheckOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_init_options.go b/pkg/bindings/containers/types_init_options.go index 92e8a6c17..5a107435e 100644 --- a/pkg/bindings/containers/types_init_options.go +++ b/pkg/bindings/containers/types_init_options.go @@ -60,7 +60,6 @@ func (o *InitOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *InitOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_inspect_options.go b/pkg/bindings/containers/types_inspect_options.go index fdb84bda8..347521488 100644 --- a/pkg/bindings/containers/types_inspect_options.go +++ b/pkg/bindings/containers/types_inspect_options.go @@ -60,7 +60,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_kill_options.go b/pkg/bindings/containers/types_kill_options.go index 45bd790a4..0fdbef2f1 100644 --- a/pkg/bindings/containers/types_kill_options.go +++ b/pkg/bindings/containers/types_kill_options.go @@ -60,7 +60,6 @@ func (o *KillOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *KillOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_list_options.go b/pkg/bindings/containers/types_list_options.go index 3293320ec..51ae98dac 100644 --- a/pkg/bindings/containers/types_list_options.go +++ b/pkg/bindings/containers/types_list_options.go @@ -60,7 +60,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_log_options.go b/pkg/bindings/containers/types_log_options.go index e78eb7bd0..51e01f1b4 100644 --- a/pkg/bindings/containers/types_log_options.go +++ b/pkg/bindings/containers/types_log_options.go @@ -60,7 +60,6 @@ func (o *LogOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *LogOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_mount_options.go b/pkg/bindings/containers/types_mount_options.go index cc8df1255..0fa028e72 100644 --- a/pkg/bindings/containers/types_mount_options.go +++ b/pkg/bindings/containers/types_mount_options.go @@ -60,7 +60,6 @@ func (o *MountOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *MountOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_mountedcontainerpaths_options.go b/pkg/bindings/containers/types_mountedcontainerpaths_options.go index 78fa2fca0..abfe9d95e 100644 --- a/pkg/bindings/containers/types_mountedcontainerpaths_options.go +++ b/pkg/bindings/containers/types_mountedcontainerpaths_options.go @@ -60,7 +60,6 @@ func (o *MountedContainerPathsOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *MountedContainerPathsOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_pause_options.go b/pkg/bindings/containers/types_pause_options.go index 55f14bef0..5f15035d9 100644 --- a/pkg/bindings/containers/types_pause_options.go +++ b/pkg/bindings/containers/types_pause_options.go @@ -60,7 +60,6 @@ func (o *PauseOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PauseOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_prune_options.go b/pkg/bindings/containers/types_prune_options.go index 000c7c0bd..99a85584e 100644 --- a/pkg/bindings/containers/types_prune_options.go +++ b/pkg/bindings/containers/types_prune_options.go @@ -60,7 +60,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_remove_options.go b/pkg/bindings/containers/types_remove_options.go index dfb5367eb..99947f607 100644 --- a/pkg/bindings/containers/types_remove_options.go +++ b/pkg/bindings/containers/types_remove_options.go @@ -60,7 +60,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_rename_options.go b/pkg/bindings/containers/types_rename_options.go index f4f5d1426..05d7138cd 100644 --- a/pkg/bindings/containers/types_rename_options.go +++ b/pkg/bindings/containers/types_rename_options.go @@ -60,7 +60,6 @@ func (o *RenameOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RenameOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_resizeexectty_options.go b/pkg/bindings/containers/types_resizeexectty_options.go index e63d965eb..554d6fb85 100644 --- a/pkg/bindings/containers/types_resizeexectty_options.go +++ b/pkg/bindings/containers/types_resizeexectty_options.go @@ -60,7 +60,6 @@ func (o *ResizeExecTTYOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ResizeExecTTYOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_resizetty_options.go b/pkg/bindings/containers/types_resizetty_options.go index 3170f4053..a018993eb 100644 --- a/pkg/bindings/containers/types_resizetty_options.go +++ b/pkg/bindings/containers/types_resizetty_options.go @@ -60,7 +60,6 @@ func (o *ResizeTTYOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ResizeTTYOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_restart_options.go b/pkg/bindings/containers/types_restart_options.go index d59176e67..fa1019a1f 100644 --- a/pkg/bindings/containers/types_restart_options.go +++ b/pkg/bindings/containers/types_restart_options.go @@ -60,7 +60,6 @@ func (o *RestartOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RestartOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_restore_options.go b/pkg/bindings/containers/types_restore_options.go index e9f14fc47..793222af3 100644 --- a/pkg/bindings/containers/types_restore_options.go +++ b/pkg/bindings/containers/types_restore_options.go @@ -60,7 +60,6 @@ func (o *RestoreOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RestoreOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_shouldrestart_options.go b/pkg/bindings/containers/types_shouldrestart_options.go index 49f943460..e9585dc61 100644 --- a/pkg/bindings/containers/types_shouldrestart_options.go +++ b/pkg/bindings/containers/types_shouldrestart_options.go @@ -60,7 +60,6 @@ func (o *ShouldRestartOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ShouldRestartOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_start_options.go b/pkg/bindings/containers/types_start_options.go index a0f0b3077..0ca2ee832 100644 --- a/pkg/bindings/containers/types_start_options.go +++ b/pkg/bindings/containers/types_start_options.go @@ -60,7 +60,6 @@ func (o *StartOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *StartOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_stats_options.go b/pkg/bindings/containers/types_stats_options.go index 79e35ba62..1ecd99536 100644 --- a/pkg/bindings/containers/types_stats_options.go +++ b/pkg/bindings/containers/types_stats_options.go @@ -60,7 +60,6 @@ func (o *StatsOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *StatsOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_stop_options.go b/pkg/bindings/containers/types_stop_options.go index f221b16e8..fcc5b1be8 100644 --- a/pkg/bindings/containers/types_stop_options.go +++ b/pkg/bindings/containers/types_stop_options.go @@ -60,7 +60,6 @@ func (o *StopOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *StopOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_top_options.go b/pkg/bindings/containers/types_top_options.go index 570dd4e90..2f04a2069 100644 --- a/pkg/bindings/containers/types_top_options.go +++ b/pkg/bindings/containers/types_top_options.go @@ -60,7 +60,6 @@ func (o *TopOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *TopOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_unmount_options.go b/pkg/bindings/containers/types_unmount_options.go index 24249073e..ede1dbdc7 100644 --- a/pkg/bindings/containers/types_unmount_options.go +++ b/pkg/bindings/containers/types_unmount_options.go @@ -60,7 +60,6 @@ func (o *UnmountOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *UnmountOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_unpause_options.go b/pkg/bindings/containers/types_unpause_options.go index 3b1d75001..0004219bf 100644 --- a/pkg/bindings/containers/types_unpause_options.go +++ b/pkg/bindings/containers/types_unpause_options.go @@ -60,7 +60,6 @@ func (o *UnpauseOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *UnpauseOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/containers/types_wait_options.go b/pkg/bindings/containers/types_wait_options.go index a3f1e3b8c..7ff6fc6f0 100644 --- a/pkg/bindings/containers/types_wait_options.go +++ b/pkg/bindings/containers/types_wait_options.go @@ -61,7 +61,6 @@ func (o *WaitOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -70,7 +69,6 @@ func (o *WaitOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/generate/types_kube_options.go b/pkg/bindings/generate/types_kube_options.go index 218d308e1..7d7b5d335 100644 --- a/pkg/bindings/generate/types_kube_options.go +++ b/pkg/bindings/generate/types_kube_options.go @@ -60,7 +60,6 @@ func (o *KubeOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *KubeOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/generate/types_systemd_options.go b/pkg/bindings/generate/types_systemd_options.go index faf981d1b..132904cf1 100644 --- a/pkg/bindings/generate/types_systemd_options.go +++ b/pkg/bindings/generate/types_systemd_options.go @@ -60,7 +60,6 @@ func (o *SystemdOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *SystemdOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/generator/generator.go b/pkg/bindings/generator/generator.go index dad154166..f65d136ea 100644 --- a/pkg/bindings/generator/generator.go +++ b/pkg/bindings/generator/generator.go @@ -71,7 +71,6 @@ func (o *{{.StructName}}) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -80,7 +79,6 @@ func (o *{{.StructName}}) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } @@ -239,7 +237,6 @@ func main() { os.Exit(1) } } - } return true }) diff --git a/pkg/bindings/images/pull.go b/pkg/bindings/images/pull.go index 5669c704e..9149b7445 100644 --- a/pkg/bindings/images/pull.go +++ b/pkg/bindings/images/pull.go @@ -93,7 +93,6 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string, default: return images, errors.New("failed to parse pull results stream, unexpected input") } - } return images, mErr } diff --git a/pkg/bindings/images/types_diff_options.go b/pkg/bindings/images/types_diff_options.go index edfc7bfa2..4f2bf0f6b 100644 --- a/pkg/bindings/images/types_diff_options.go +++ b/pkg/bindings/images/types_diff_options.go @@ -60,7 +60,6 @@ func (o *DiffOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *DiffOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_exists_options.go b/pkg/bindings/images/types_exists_options.go index 649be4862..689c80902 100644 --- a/pkg/bindings/images/types_exists_options.go +++ b/pkg/bindings/images/types_exists_options.go @@ -60,7 +60,6 @@ func (o *ExistsOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ExistsOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_export_options.go b/pkg/bindings/images/types_export_options.go index ebd053165..31361deb2 100644 --- a/pkg/bindings/images/types_export_options.go +++ b/pkg/bindings/images/types_export_options.go @@ -60,7 +60,6 @@ func (o *ExportOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ExportOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_get_options.go b/pkg/bindings/images/types_get_options.go index 33ebe2611..5eb178a74 100644 --- a/pkg/bindings/images/types_get_options.go +++ b/pkg/bindings/images/types_get_options.go @@ -60,7 +60,6 @@ func (o *GetOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *GetOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_history_options.go b/pkg/bindings/images/types_history_options.go index b2c37acea..becabaa59 100644 --- a/pkg/bindings/images/types_history_options.go +++ b/pkg/bindings/images/types_history_options.go @@ -60,7 +60,6 @@ func (o *HistoryOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *HistoryOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_import_options.go b/pkg/bindings/images/types_import_options.go index e2aed0866..6e9160b63 100644 --- a/pkg/bindings/images/types_import_options.go +++ b/pkg/bindings/images/types_import_options.go @@ -60,7 +60,6 @@ func (o *ImportOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ImportOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_list_options.go b/pkg/bindings/images/types_list_options.go index e194474b9..12d186f6b 100644 --- a/pkg/bindings/images/types_list_options.go +++ b/pkg/bindings/images/types_list_options.go @@ -60,7 +60,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_load_options.go b/pkg/bindings/images/types_load_options.go index 7e15d4e03..913568937 100644 --- a/pkg/bindings/images/types_load_options.go +++ b/pkg/bindings/images/types_load_options.go @@ -60,7 +60,6 @@ func (o *LoadOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *LoadOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_prune_options.go b/pkg/bindings/images/types_prune_options.go index f86676d53..dad83dd2f 100644 --- a/pkg/bindings/images/types_prune_options.go +++ b/pkg/bindings/images/types_prune_options.go @@ -60,7 +60,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_pull_options.go b/pkg/bindings/images/types_pull_options.go index 59e2b6354..c3c7a3dc4 100644 --- a/pkg/bindings/images/types_pull_options.go +++ b/pkg/bindings/images/types_pull_options.go @@ -60,7 +60,6 @@ func (o *PullOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PullOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_push_options.go b/pkg/bindings/images/types_push_options.go index ae946fcde..9f708c1b3 100644 --- a/pkg/bindings/images/types_push_options.go +++ b/pkg/bindings/images/types_push_options.go @@ -60,7 +60,6 @@ func (o *PushOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PushOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_remove_options.go b/pkg/bindings/images/types_remove_options.go index d79186565..fba4f63b6 100644 --- a/pkg/bindings/images/types_remove_options.go +++ b/pkg/bindings/images/types_remove_options.go @@ -60,7 +60,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_search_options.go b/pkg/bindings/images/types_search_options.go index a55c9ac89..812a9abd3 100644 --- a/pkg/bindings/images/types_search_options.go +++ b/pkg/bindings/images/types_search_options.go @@ -60,7 +60,6 @@ func (o *SearchOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *SearchOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_tag_options.go b/pkg/bindings/images/types_tag_options.go index b323ea41c..e1217a9aa 100644 --- a/pkg/bindings/images/types_tag_options.go +++ b/pkg/bindings/images/types_tag_options.go @@ -60,7 +60,6 @@ func (o *TagOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *TagOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_tree_options.go b/pkg/bindings/images/types_tree_options.go index 8e1b16c5c..0a574ffc1 100644 --- a/pkg/bindings/images/types_tree_options.go +++ b/pkg/bindings/images/types_tree_options.go @@ -60,7 +60,6 @@ func (o *TreeOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *TreeOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/images/types_untag_options.go b/pkg/bindings/images/types_untag_options.go index b28670134..ced84876e 100644 --- a/pkg/bindings/images/types_untag_options.go +++ b/pkg/bindings/images/types_untag_options.go @@ -60,7 +60,6 @@ func (o *UntagOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *UntagOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/manifests/types_add_options.go b/pkg/bindings/manifests/types_add_options.go index 61314c479..8947b1286 100644 --- a/pkg/bindings/manifests/types_add_options.go +++ b/pkg/bindings/manifests/types_add_options.go @@ -60,7 +60,6 @@ func (o *AddOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *AddOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/manifests/types_create_options.go b/pkg/bindings/manifests/types_create_options.go index 4c7c1397a..ee8b56df7 100644 --- a/pkg/bindings/manifests/types_create_options.go +++ b/pkg/bindings/manifests/types_create_options.go @@ -60,7 +60,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/manifests/types_inspect_options.go b/pkg/bindings/manifests/types_inspect_options.go index 0b82fc3cf..a2a40e6a4 100644 --- a/pkg/bindings/manifests/types_inspect_options.go +++ b/pkg/bindings/manifests/types_inspect_options.go @@ -60,7 +60,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/manifests/types_remove_options.go b/pkg/bindings/manifests/types_remove_options.go index 6ed0fd329..d3cac775e 100644 --- a/pkg/bindings/manifests/types_remove_options.go +++ b/pkg/bindings/manifests/types_remove_options.go @@ -60,7 +60,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/network/types_connect_options.go b/pkg/bindings/network/types_connect_options.go index 4440bbed4..930fb5531 100644 --- a/pkg/bindings/network/types_connect_options.go +++ b/pkg/bindings/network/types_connect_options.go @@ -60,7 +60,6 @@ func (o *ConnectOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ConnectOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/network/types_create_options.go b/pkg/bindings/network/types_create_options.go index 5fbdce93a..4b4afc4a8 100644 --- a/pkg/bindings/network/types_create_options.go +++ b/pkg/bindings/network/types_create_options.go @@ -61,7 +61,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -70,7 +69,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/network/types_disconnect_options.go b/pkg/bindings/network/types_disconnect_options.go index 947f2f114..cbcea8f7e 100644 --- a/pkg/bindings/network/types_disconnect_options.go +++ b/pkg/bindings/network/types_disconnect_options.go @@ -60,7 +60,6 @@ func (o *DisconnectOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *DisconnectOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/network/types_inspect_options.go b/pkg/bindings/network/types_inspect_options.go index 144ccbfae..3c69b37ec 100644 --- a/pkg/bindings/network/types_inspect_options.go +++ b/pkg/bindings/network/types_inspect_options.go @@ -60,7 +60,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/network/types_list_options.go b/pkg/bindings/network/types_list_options.go index 60632ce33..e00430809 100644 --- a/pkg/bindings/network/types_list_options.go +++ b/pkg/bindings/network/types_list_options.go @@ -60,7 +60,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/network/types_remove_options.go b/pkg/bindings/network/types_remove_options.go index 4ad4a2301..f42f6c256 100644 --- a/pkg/bindings/network/types_remove_options.go +++ b/pkg/bindings/network/types_remove_options.go @@ -60,7 +60,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/play/types_kube_options.go b/pkg/bindings/play/types_kube_options.go index ea3872aae..649522908 100644 --- a/pkg/bindings/play/types_kube_options.go +++ b/pkg/bindings/play/types_kube_options.go @@ -60,7 +60,6 @@ func (o *KubeOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *KubeOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_create_options.go b/pkg/bindings/pods/types_create_options.go index cfa29c6be..90312e6e6 100644 --- a/pkg/bindings/pods/types_create_options.go +++ b/pkg/bindings/pods/types_create_options.go @@ -60,7 +60,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_exists_options.go b/pkg/bindings/pods/types_exists_options.go index 6149ab1cc..0a7fbe3c9 100644 --- a/pkg/bindings/pods/types_exists_options.go +++ b/pkg/bindings/pods/types_exists_options.go @@ -60,7 +60,6 @@ func (o *ExistsOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ExistsOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_inspect_options.go b/pkg/bindings/pods/types_inspect_options.go index 281717ff1..9913eaa50 100644 --- a/pkg/bindings/pods/types_inspect_options.go +++ b/pkg/bindings/pods/types_inspect_options.go @@ -60,7 +60,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_kill_options.go b/pkg/bindings/pods/types_kill_options.go index 4c310d50c..dac91840c 100644 --- a/pkg/bindings/pods/types_kill_options.go +++ b/pkg/bindings/pods/types_kill_options.go @@ -60,7 +60,6 @@ func (o *KillOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *KillOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_list_options.go b/pkg/bindings/pods/types_list_options.go index 20f3229e5..ab945c253 100644 --- a/pkg/bindings/pods/types_list_options.go +++ b/pkg/bindings/pods/types_list_options.go @@ -60,7 +60,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_pause_options.go b/pkg/bindings/pods/types_pause_options.go index 0f0f5bd97..177679e2a 100644 --- a/pkg/bindings/pods/types_pause_options.go +++ b/pkg/bindings/pods/types_pause_options.go @@ -60,7 +60,6 @@ func (o *PauseOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PauseOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_prune_options.go b/pkg/bindings/pods/types_prune_options.go index ef8aae17f..389a95579 100644 --- a/pkg/bindings/pods/types_prune_options.go +++ b/pkg/bindings/pods/types_prune_options.go @@ -60,7 +60,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_remove_options.go b/pkg/bindings/pods/types_remove_options.go index f51f67129..dcb4106f8 100644 --- a/pkg/bindings/pods/types_remove_options.go +++ b/pkg/bindings/pods/types_remove_options.go @@ -60,7 +60,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_restart_options.go b/pkg/bindings/pods/types_restart_options.go index ec05e9fc9..61b06f70e 100644 --- a/pkg/bindings/pods/types_restart_options.go +++ b/pkg/bindings/pods/types_restart_options.go @@ -60,7 +60,6 @@ func (o *RestartOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RestartOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_start_options.go b/pkg/bindings/pods/types_start_options.go index ec9f5b1de..80e3c04d5 100644 --- a/pkg/bindings/pods/types_start_options.go +++ b/pkg/bindings/pods/types_start_options.go @@ -60,7 +60,6 @@ func (o *StartOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *StartOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_stats_options.go b/pkg/bindings/pods/types_stats_options.go index 8be7d175d..c8be15ee9 100644 --- a/pkg/bindings/pods/types_stats_options.go +++ b/pkg/bindings/pods/types_stats_options.go @@ -60,7 +60,6 @@ func (o *StatsOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *StatsOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_stop_options.go b/pkg/bindings/pods/types_stop_options.go index fa3577e72..22b04012e 100644 --- a/pkg/bindings/pods/types_stop_options.go +++ b/pkg/bindings/pods/types_stop_options.go @@ -60,7 +60,6 @@ func (o *StopOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *StopOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_top_options.go b/pkg/bindings/pods/types_top_options.go index c3c701dad..da2457809 100644 --- a/pkg/bindings/pods/types_top_options.go +++ b/pkg/bindings/pods/types_top_options.go @@ -60,7 +60,6 @@ func (o *TopOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *TopOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/pods/types_unpause_options.go b/pkg/bindings/pods/types_unpause_options.go index 281f0ea8d..5e2c9454b 100644 --- a/pkg/bindings/pods/types_unpause_options.go +++ b/pkg/bindings/pods/types_unpause_options.go @@ -60,7 +60,6 @@ func (o *UnpauseOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *UnpauseOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/system/types_disk_options.go b/pkg/bindings/system/types_disk_options.go index 6f0c3735a..77428c10c 100644 --- a/pkg/bindings/system/types_disk_options.go +++ b/pkg/bindings/system/types_disk_options.go @@ -60,7 +60,6 @@ func (o *DiskOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *DiskOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/system/types_events_options.go b/pkg/bindings/system/types_events_options.go index 401a9807e..dd7706178 100644 --- a/pkg/bindings/system/types_events_options.go +++ b/pkg/bindings/system/types_events_options.go @@ -60,7 +60,6 @@ func (o *EventsOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *EventsOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/system/types_info_options.go b/pkg/bindings/system/types_info_options.go index 7c07b5081..162ec3e88 100644 --- a/pkg/bindings/system/types_info_options.go +++ b/pkg/bindings/system/types_info_options.go @@ -60,7 +60,6 @@ func (o *InfoOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *InfoOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/system/types_prune_options.go b/pkg/bindings/system/types_prune_options.go index c677ccca6..f2ae5e657 100644 --- a/pkg/bindings/system/types_prune_options.go +++ b/pkg/bindings/system/types_prune_options.go @@ -60,7 +60,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/system/types_version_options.go b/pkg/bindings/system/types_version_options.go index 60ebfced9..b6026fa8c 100644 --- a/pkg/bindings/system/types_version_options.go +++ b/pkg/bindings/system/types_version_options.go @@ -60,7 +60,6 @@ func (o *VersionOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *VersionOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/volumes/types_create_options.go b/pkg/bindings/volumes/types_create_options.go index 2254f8c13..2dcbaf611 100644 --- a/pkg/bindings/volumes/types_create_options.go +++ b/pkg/bindings/volumes/types_create_options.go @@ -60,7 +60,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *CreateOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/volumes/types_inspect_options.go b/pkg/bindings/volumes/types_inspect_options.go index 51ac2d348..3176e0ef6 100644 --- a/pkg/bindings/volumes/types_inspect_options.go +++ b/pkg/bindings/volumes/types_inspect_options.go @@ -60,7 +60,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *InspectOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/volumes/types_list_options.go b/pkg/bindings/volumes/types_list_options.go index c96e647b0..e7770d5ee 100644 --- a/pkg/bindings/volumes/types_list_options.go +++ b/pkg/bindings/volumes/types_list_options.go @@ -60,7 +60,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *ListOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/volumes/types_prune_options.go b/pkg/bindings/volumes/types_prune_options.go index 06d16b659..78245f649 100644 --- a/pkg/bindings/volumes/types_prune_options.go +++ b/pkg/bindings/volumes/types_prune_options.go @@ -60,7 +60,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *PruneOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/bindings/volumes/types_remove_options.go b/pkg/bindings/volumes/types_remove_options.go index 4b0037234..13ac6a346 100644 --- a/pkg/bindings/volumes/types_remove_options.go +++ b/pkg/bindings/volumes/types_remove_options.go @@ -60,7 +60,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { iter := f.MapRange() for iter.Next() { lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) - } s, err := json.MarshalToString(lowerCaseKeys) if err != nil { @@ -69,7 +68,6 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { params.Set(fieldName, s) } - } return params, nil } diff --git a/pkg/cgroups/cpu.go b/pkg/cgroups/cpu.go index a73187dc8..05223c2e1 100644 --- a/pkg/cgroups/cpu.go +++ b/pkg/cgroups/cpu.go @@ -155,7 +155,6 @@ func GetSystemCPUUsage() (uint64, error) { } total += v * 1000 } - } return total, nil } diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index cf108ba9c..fb01c72b6 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -269,7 +269,6 @@ func pull(ctx context.Context, runtime *image.Runtime, rawImage string, options } if _, isTagged := namedRef.(reference.Tagged); isTagged { return nil, errors.New("--all-tags requires a reference without a tag") - } systemContext := image.GetSystemContext("", options.Authfile, false) @@ -502,7 +501,6 @@ func (ir *ImageEngine) Config(_ context.Context) (*config.Config, error) { } func (ir *ImageEngine) Build(ctx context.Context, containerFiles []string, opts entities.BuildOptions) (*entities.BuildReport, error) { - id, _, err := ir.Libpod.Build(ctx, opts.BuildOptions, containerFiles...) if err != nil { return nil, err diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 70c7104f1..35a84106f 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -60,7 +60,6 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, path string, options en default: return nil, errors.Errorf("invalid YAML kind: %q. [Pod|Deployment] are the only supported Kubernetes Kinds", kubeObject.Kind) } - } func (ic *ContainerEngine) playKubeDeployment(ctx context.Context, deploymentYAML *v1apps.Deployment, options entities.PlayKubeOptions) (*entities.PlayKubeReport, error) { diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index e9c513f8e..c2c282ef9 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -290,7 +290,6 @@ func (ic *ContainerEngine) ContainerCheckpoint(ctx context.Context, namesOrIds [ ctrs = append(ctrs, c) } } - } else { ctrs, err = getContainersByContext(ic.ClientCtx, false, false, namesOrIds) if err != nil { @@ -326,7 +325,6 @@ func (ic *ContainerEngine) ContainerRestore(ctx context.Context, namesOrIds []st ctrs = append(ctrs, c) } } - } else { ctrs, err = getContainersByContext(ic.ClientCtx, false, false, namesOrIds) if err != nil { @@ -570,7 +568,6 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri } // Start the container if it's not running already. if !ctrRunning { - err = containers.Start(ic.ClientCtx, name, new(containers.StartOptions).WithDetachKeys(options.DetachKeys)) if err != nil { if ctr.AutoRemove { diff --git a/pkg/domain/infra/tunnel/helpers.go b/pkg/domain/infra/tunnel/helpers.go index 0a806d860..e40e27596 100644 --- a/pkg/domain/infra/tunnel/helpers.go +++ b/pkg/domain/infra/tunnel/helpers.go @@ -55,7 +55,6 @@ func getContainersByContext(contextWithConnection context.Context, all, ignore b found = true break } - } if !found && !ignore { @@ -107,7 +106,6 @@ func getPodsByContext(contextWithConnection context.Context, all bool, namesOrID found = true break } - } if !found { diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index 0fe2387d7..214a9fef8 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -32,7 +32,6 @@ func (ir *ImageEngine) Remove(ctx context.Context, imagesArg []string, opts enti } func (ir *ImageEngine) List(ctx context.Context, opts entities.ImageListOptions) ([]*entities.ImageSummary, error) { - filters := make(map[string][]string, len(opts.Filter)) for _, filter := range opts.Filter { f := strings.Split(filter, "=") diff --git a/pkg/lookup/lookup.go b/pkg/lookup/lookup.go index 8f241edf2..0b22a1974 100644 --- a/pkg/lookup/lookup.go +++ b/pkg/lookup/lookup.go @@ -66,7 +66,6 @@ func GetUserGroupInfo(containerMount, containerUser string, override *Overrides) // Gid: 0, // Home: "/", defaultExecUser = nil - } return user.GetExecUserPath(containerUser, defaultExecUser, passwdDest, groupDest) diff --git a/pkg/netns/netns_linux.go b/pkg/netns/netns_linux.go index 6817a3abd..95b50e073 100644 --- a/pkg/netns/netns_linux.go +++ b/pkg/netns/netns_linux.go @@ -51,7 +51,6 @@ func getNSRunDir() (string, error) { // NewNS creates a new persistent (bind-mounted) network namespace and returns // an object representing that namespace, without switching to it. func NewNS() (ns.NetNS, error) { - nsRunDir, err := getNSRunDir() if err != nil { return nil, err @@ -92,7 +91,6 @@ func NewNS() (ns.NetNS, error) { if err != nil { return nil, fmt.Errorf("mount --make-rshared %s failed: %q", nsRunDir, err) } - } nsName := fmt.Sprintf("cni-%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) diff --git a/pkg/rootlessport/rootlessport_linux.go b/pkg/rootlessport/rootlessport_linux.go index 80e1309a5..7cb54a7c3 100644 --- a/pkg/rootlessport/rootlessport_linux.go +++ b/pkg/rootlessport/rootlessport_linux.go @@ -64,7 +64,6 @@ func init() { os.Exit(1) } }) - } func loadConfig(r io.Reader) (*Config, io.ReadCloser, io.WriteCloser, error) { diff --git a/pkg/systemd/generate/common_test.go b/pkg/systemd/generate/common_test.go index a0691d1ad..3787e461e 100644 --- a/pkg/systemd/generate/common_test.go +++ b/pkg/systemd/generate/common_test.go @@ -8,7 +8,6 @@ import ( ) func TestFilterPodFlags(t *testing.T) { - tests := []struct { input []string }{ diff --git a/pkg/trust/trust.go b/pkg/trust/trust.go index a30611b74..18a6a1717 100644 --- a/pkg/trust/trust.go +++ b/pkg/trust/trust.go @@ -179,7 +179,6 @@ func CreateTmpFile(dir, pattern string, content []byte) (string, error) { if _, err := tmpfile.Write(content); err != nil { return "", err - } return tmpfile.Name(), nil } diff --git a/pkg/util/utils.go b/pkg/util/utils.go index 901a482f6..32bb66332 100644 --- a/pkg/util/utils.go +++ b/pkg/util/utils.go @@ -388,7 +388,6 @@ func GetKeepIDMapping() (*storage.IDMappingOptions, int, int, error) { options.HostUIDMapping = false options.HostGIDMapping = false - } // Simply ignore the setting and do not setup an inner namespace for root as it is a no-op return &options, uid, gid, nil -- cgit v1.2.3-54-g00ecf From 3d14b56282dc16518aac1825db318d93495785af Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 5 Feb 2021 13:08:15 -0500 Subject: Implement missing arguments for podman build Buildah bud passes a bunch more flags then podman build. We need to implement hook up all of these flags to get full functionality. Signed-off-by: Daniel J Walsh Signed-off-by: Matthew Heon --- cmd/podman/images/build.go | 61 ++++- go.mod | 1 + pkg/api/handlers/compat/images_build.go | 183 +++++++++---- pkg/bindings/images/build.go | 154 +++++++---- test/e2e/build_test.go | 51 ++++ .../containers/ocicrypt/helpers/parse_helpers.go | 301 +++++++++++++++++++++ vendor/modules.txt | 1 + 7 files changed, 643 insertions(+), 109 deletions(-) create mode 100644 vendor/github.com/containers/ocicrypt/helpers/parse_helpers.go (limited to 'cmd/podman/images') diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index a35fea442..0c97a2488 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -1,9 +1,11 @@ package images import ( + "io" "os" "path/filepath" "strings" + "time" "github.com/containers/buildah" "github.com/containers/buildah/imagebuildah" @@ -11,6 +13,8 @@ import ( "github.com/containers/buildah/pkg/parse" "github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/config" + encconfig "github.com/containers/ocicrypt/config" + enchelpers "github.com/containers/ocicrypt/helpers" "github.com/containers/podman/v2/cmd/podman/common" "github.com/containers/podman/v2/cmd/podman/registry" "github.com/containers/podman/v2/cmd/podman/utils" @@ -78,7 +82,8 @@ func useLayers() string { func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, + Command: buildCmd, }) buildFlags(buildCmd) @@ -151,8 +156,21 @@ func buildFlags(cmd *cobra.Command) { // Add the completion functions fromAndBudFlagsCompletions := buildahCLI.GetFromAndBudFlagsCompletions() completion.CompleteCommandFlags(cmd, fromAndBudFlagsCompletions) - _ = flags.MarkHidden("signature-policy") flags.SetNormalizeFunc(buildahCLI.AliasFlags) + if registry.IsRemote() { + flag = flags.Lookup("isolation") + buildOpts.Isolation = buildah.OCI + if err := flag.Value.Set(buildah.OCI); err != nil { + logrus.Errorf("unable to set --isolation to %v: %v", buildah.OCI, err) + } + flag.DefValue = buildah.OCI + _ = flags.MarkHidden("disable-content-trust") + _ = flags.MarkHidden("cache-from") + _ = flags.MarkHidden("sign-by") + _ = flags.MarkHidden("signature-policy") + _ = flags.MarkHidden("tls-verify") + _ = flags.MarkHidden("compress") + } } // build executes the build command. @@ -308,6 +326,10 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil flags.Layers = false } + var stdin io.Reader + if flags.Stdin { + stdin = os.Stdin + } var stdout, stderr, reporter *os.File stdout = os.Stdout stderr = os.Stderr @@ -402,10 +424,21 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil runtimeFlags = append(runtimeFlags, "--systemd-cgroup") } + imageOS, arch, err := parse.PlatformFromOptions(c) + if err != nil { + return nil, err + } + + decConfig, err := getDecryptConfig(flags.DecryptionKeys) + if err != nil { + return nil, errors.Wrapf(err, "unable to obtain decrypt config") + } + opts := imagebuildah.BuildOptions{ AddCapabilities: flags.CapAdd, AdditionalTags: tags, Annotations: flags.Annotation, + Architecture: arch, Args: args, BlobDirectory: flags.BlobCache, CNIConfigDir: flags.CNIConfigDir, @@ -433,17 +466,26 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil DropCapabilities: flags.CapDrop, Err: stderr, ForceRmIntermediateCtrs: flags.ForceRm, + From: flags.From, IDMappingOptions: idmappingOptions, IIDFile: flags.Iidfile, + In: stdin, Isolation: isolation, + Jobs: &flags.Jobs, Labels: flags.Label, Layers: flags.Layers, + LogRusage: flags.LogRusage, + Manifest: flags.Manifest, + MaxPullPushRetries: 3, NamespaceOptions: nsValues, NoCache: flags.NoCache, + OS: imageOS, + OciDecryptConfig: decConfig, Out: stdout, Output: output, OutputFormat: format, PullPolicy: pullPolicy, + PullPushRetryDelay: 2 * time.Second, Quiet: flags.Quiet, RemoveIntermediateCtrs: flags.Rm, ReportWriter: reporter, @@ -459,3 +501,18 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil return &entities.BuildOptions{BuildOptions: opts}, nil } + +func getDecryptConfig(decryptionKeys []string) (*encconfig.DecryptConfig, error) { + decConfig := &encconfig.DecryptConfig{} + if len(decryptionKeys) > 0 { + // decryption + dcc, err := enchelpers.CreateCryptoConfig([]string{}, decryptionKeys) + if err != nil { + return nil, errors.Wrapf(err, "invalid decryption keys") + } + cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{dcc}) + decConfig = cc.DecryptConfig + } + + return decConfig, nil +} diff --git a/go.mod b/go.mod index 67eb91b81..a6faae7fc 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/containers/common v0.33.4 github.com/containers/conmon v2.0.20+incompatible github.com/containers/image/v5 v5.10.2 + github.com/containers/ocicrypt v1.0.3 github.com/containers/psgo v1.5.2 github.com/containers/storage v1.24.6 github.com/coreos/go-systemd/v22 v22.1.0 diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index 415ff85cd..0f27a090f 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -60,29 +60,39 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { }() query := struct { - BuildArgs string `schema:"buildargs"` - CacheFrom string `schema:"cachefrom"` - CpuPeriod uint64 `schema:"cpuperiod"` // nolint - CpuQuota int64 `schema:"cpuquota"` // nolint - CpuSetCpus string `schema:"cpusetcpus"` // nolint - CpuShares uint64 `schema:"cpushares"` // nolint - Dockerfile string `schema:"dockerfile"` - ExtraHosts string `schema:"extrahosts"` - ForceRm bool `schema:"forcerm"` - HTTPProxy bool `schema:"httpproxy"` - Labels string `schema:"labels"` - Layers bool `schema:"layers"` - MemSwap int64 `schema:"memswap"` - Memory int64 `schema:"memory"` - NetworkMode string `schema:"networkmode"` - NoCache bool `schema:"nocache"` - Outputs string `schema:"outputs"` - Platform string `schema:"platform"` - Pull bool `schema:"pull"` - Quiet bool `schema:"q"` - Registry string `schema:"registry"` - Remote string `schema:"remote"` - Rm bool `schema:"rm"` + AddHosts string `schema:"extrahosts"` + AdditionalCapabilities string `schema:"addcaps"` + Annotations string `schema:"annotations"` + BuildArgs string `schema:"buildargs"` + CacheFrom string `schema:"cachefrom"` + ConfigureNetwork int64 `schema:"networkmode"` + CpuPeriod uint64 `schema:"cpuperiod"` // nolint + CpuQuota int64 `schema:"cpuquota"` // nolint + CpuSetCpus string `schema:"cpusetcpus"` // nolint + CpuShares uint64 `schema:"cpushares"` // nolint + Devices string `schema:"devices"` + Dockerfile string `schema:"dockerfile"` + DropCapabilities string `schema:"dropcaps"` + ForceRm bool `schema:"forcerm"` + From string `schema:"from"` + HTTPProxy bool `schema:"httpproxy"` + Isolation int64 `schema:"isolation"` + Jobs uint64 `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"` + NoCache bool `schema:"nocache"` + OutputFormat string `schema:"outputformat"` + Platform string `schema:"platform"` + Pull bool `schema:"pull"` + Quiet bool `schema:"q"` + Registry string `schema:"registry"` + Rm bool `schema:"rm"` + //FIXME SecurityOpt in remote API is not handled + SecurityOpt string `schema:"securityopt"` ShmSize int `schema:"shmsize"` Squash bool `schema:"squash"` Tag []string `schema:"t"` @@ -101,14 +111,57 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { return } + // convert label formats + var addCaps = []string{} + if _, found := r.URL.Query()["addcaps"]; found { + var m = []string{} + if err := json.Unmarshal([]byte(query.AdditionalCapabilities), &m); err != nil { + utils.BadRequest(w, "addcaps", query.AdditionalCapabilities, err) + return + } + addCaps = m + } + addhosts := []string{} + if _, found := r.URL.Query()["extrahosts"]; found { + if err := json.Unmarshal([]byte(query.AddHosts), &addhosts); err != nil { + utils.BadRequest(w, "extrahosts", query.AddHosts, err) + return + } + } + + // convert label formats + var dropCaps = []string{} + if _, found := r.URL.Query()["dropcaps"]; found { + var m = []string{} + if err := json.Unmarshal([]byte(query.DropCapabilities), &m); err != nil { + utils.BadRequest(w, "dropcaps", query.DropCapabilities, err) + return + } + dropCaps = m + } + + // convert label formats + var devices = []string{} + if _, found := r.URL.Query()["devices"]; found { + var m = []string{} + if err := json.Unmarshal([]byte(query.DropCapabilities), &m); err != nil { + utils.BadRequest(w, "devices", query.DropCapabilities, err) + return + } + devices = m + } + var output string if len(query.Tag) > 0 { output = query.Tag[0] } - - var additionalNames []string + format := buildah.Dockerv2ImageManifest + if utils.IsLibpodRequest(r) { + format = query.OutputFormat + } + var additionalTags []string if len(query.Tag) > 1 { - additionalNames = query.Tag[1:] + additionalTags = query.Tag[1:] } var buildArgs = map[string]string{} @@ -119,18 +172,22 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { } } + // convert label formats + var annotations = []string{} + if _, found := r.URL.Query()["annotations"]; found { + if err := json.Unmarshal([]byte(query.Annotations), &annotations); err != nil { + utils.BadRequest(w, "annotations", query.Annotations, err) + return + } + } + // convert label formats var labels = []string{} if _, found := r.URL.Query()["labels"]; found { - var m = map[string]string{} - if err := json.Unmarshal([]byte(query.Labels), &m); err != nil { + if err := json.Unmarshal([]byte(query.Labels), &labels); err != nil { utils.BadRequest(w, "labels", query.Labels, err) return } - - for k, v := range m { - labels = append(labels, k+"="+v) - } } pullPolicy := buildah.PullIfMissing @@ -160,27 +217,14 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { reporter := channel.NewWriter(make(chan []byte, 1)) defer reporter.Close() + buildOptions := imagebuildah.BuildOptions{ - ContextDirectory: contextDirectory, - PullPolicy: pullPolicy, - Registry: query.Registry, - IgnoreUnrecognizedInstructions: true, - Quiet: query.Quiet, - Layers: query.Layers, - Isolation: buildah.IsolationChroot, - Compression: archive.Gzip, - Args: buildArgs, - Output: output, - AdditionalTags: additionalNames, - Out: stdout, - Err: auxout, - ReportWriter: reporter, - OutputFormat: buildah.Dockerv2ImageManifest, - SystemContext: &types.SystemContext{ - AuthFilePath: authfile, - DockerAuthConfig: creds, - }, + AddCapabilities: addCaps, + AdditionalTags: additionalTags, + Annotations: annotations, + Args: buildArgs, CommonBuildOpts: &buildah.CommonBuildOptions{ + AddHost: addhosts, CPUPeriod: query.CpuPeriod, CPUQuota: query.CpuQuota, CPUShares: query.CpuShares, @@ -190,12 +234,37 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { MemorySwap: query.MemSwap, ShmSize: strconv.Itoa(query.ShmSize), }, - Squash: query.Squash, - Labels: labels, - NoCache: query.NoCache, - RemoveIntermediateCtrs: query.Rm, - ForceRmIntermediateCtrs: query.ForceRm, - Target: query.Target, + Compression: archive.Gzip, + ConfigureNetwork: buildah.NetworkConfigurationPolicy(query.ConfigureNetwork), + ContextDirectory: contextDirectory, + Devices: devices, + DropCapabilities: dropCaps, + Err: auxout, + 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, + SystemContext: &types.SystemContext{ + AuthFilePath: authfile, + DockerAuthConfig: creds, + }, + Target: query.Target, } runtime := r.Context().Value("runtime").(*libpod.Runtime) diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index 02765816f..8ea09b881 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -31,36 +31,31 @@ import ( func Build(ctx context.Context, containerFiles []string, options entities.BuildOptions) (*entities.BuildReport, error) { params := url.Values{} - if t := options.Output; len(t) > 0 { - params.Set("t", t) + if caps := options.AddCapabilities; len(caps) > 0 { + c, err := jsoniter.MarshalToString(caps) + if err != nil { + return nil, err + } + params.Add("addcaps", c) } + + if annotations := options.Annotations; len(annotations) > 0 { + l, err := jsoniter.MarshalToString(annotations) + if err != nil { + return nil, err + } + params.Set("annotations", l) + } + params.Add("t", options.Output) for _, tag := range options.AdditionalTags { params.Add("t", tag) } - if options.Quiet { - params.Set("q", "1") - } - if options.NoCache { - params.Set("nocache", "1") - } - if options.Layers { - params.Set("layers", "1") - } - // TODO cachefrom - if options.PullPolicy == buildah.PullAlways { - params.Set("pull", "1") - } - if options.RemoveIntermediateCtrs { - params.Set("rm", "1") - } - if options.ForceRmIntermediateCtrs { - params.Set("forcerm", "1") - } - if mem := options.CommonBuildOpts.Memory; mem > 0 { - params.Set("memory", strconv.Itoa(int(mem))) - } - if memSwap := options.CommonBuildOpts.MemorySwap; memSwap > 0 { - params.Set("memswap", strconv.Itoa(int(memSwap))) + if buildArgs := options.Args; len(buildArgs) > 0 { + bArgs, err := jsoniter.MarshalToString(buildArgs) + if err != nil { + return nil, err + } + params.Set("buildargs", bArgs) } if cpuShares := options.CommonBuildOpts.CPUShares; cpuShares > 0 { params.Set("cpushares", strconv.Itoa(int(cpuShares))) @@ -74,22 +69,38 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO if cpuQuota := options.CommonBuildOpts.CPUQuota; cpuQuota > 0 { params.Set("cpuquota", strconv.Itoa(int(cpuQuota))) } - if buildArgs := options.Args; len(buildArgs) > 0 { - bArgs, err := jsoniter.MarshalToString(buildArgs) + params.Set("networkmode", strconv.Itoa(int(options.ConfigureNetwork))) + params.Set("outputformat", options.OutputFormat) + + if devices := options.Devices; len(devices) > 0 { + d, err := jsoniter.MarshalToString(devices) if err != nil { return nil, err } - params.Set("buildargs", bArgs) + params.Add("devices", d) } - if shmSize := options.CommonBuildOpts.ShmSize; len(shmSize) > 0 { - shmBytes, err := units.RAMInBytes(shmSize) + + if caps := options.DropCapabilities; len(caps) > 0 { + c, err := jsoniter.MarshalToString(caps) if err != nil { return nil, err } - params.Set("shmsize", strconv.Itoa(int(shmBytes))) + params.Add("dropcaps", c) } - if options.Squash { - params.Set("squash", "1") + + if options.ForceRmIntermediateCtrs { + params.Set("forcerm", "1") + } + if len(options.From) > 0 { + params.Set("from", options.From) + } + + params.Set("isolation", strconv.Itoa(int(options.Isolation))) + if options.CommonBuildOpts.HTTPProxy { + params.Set("httpproxy", "1") + } + if options.Jobs != nil { + params.Set("jobs", strconv.FormatUint(uint64(*options.Jobs), 10)) } if labels := options.Labels; len(labels) > 0 { l, err := jsoniter.MarshalToString(labels) @@ -98,10 +109,66 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO } params.Set("labels", l) } - if options.CommonBuildOpts.HTTPProxy { - params.Set("httpproxy", "1") + if options.Layers { + params.Set("layers", "1") + } + if options.LogRusage { + params.Set("rusage", "1") + } + if len(options.Manifest) > 0 { + params.Set("manifest", options.Manifest) + } + if memSwap := options.CommonBuildOpts.MemorySwap; memSwap > 0 { + params.Set("memswap", strconv.Itoa(int(memSwap))) + } + if mem := options.CommonBuildOpts.Memory; mem > 0 { + params.Set("memory", strconv.Itoa(int(mem))) + } + if options.NoCache { + params.Set("nocache", "1") + } + if t := options.Output; len(t) > 0 { + params.Set("output", t) + } + var platform string + if len(options.OS) > 0 { + platform = options.OS + } + if len(options.Architecture) > 0 { + if len(platform) == 0 { + platform = "linux" + } + platform += "/" + options.Architecture + } + if len(platform) > 0 { + params.Set("platform", platform) + } + if options.PullPolicy == buildah.PullAlways { + params.Set("pull", "1") + } + if options.Quiet { + params.Set("q", "1") + } + if options.RemoveIntermediateCtrs { + params.Set("rm", "1") + } + if hosts := options.CommonBuildOpts.AddHost; len(hosts) > 0 { + h, err := jsoniter.MarshalToString(hosts) + if err != nil { + return nil, err + } + params.Set("extrahosts", h) + } + if shmSize := options.CommonBuildOpts.ShmSize; len(shmSize) > 0 { + shmBytes, err := units.RAMInBytes(shmSize) + if err != nil { + return nil, err + } + params.Set("shmsize", strconv.Itoa(int(shmBytes))) + } + if options.Squash { + params.Set("squash", "1") } - var ( headers map[string]string err error @@ -124,19 +191,6 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO stdout = options.Out } - // TODO network? - - var platform string - if OS := options.OS; len(OS) > 0 { - platform += OS - } - if arch := options.Architecture; len(arch) > 0 { - platform += "/" + arch - } - if len(platform) > 0 { - params.Set("platform", platform) - } - entries := make([]string, len(containerFiles)) copy(entries, containerFiles) entries = append(entries, options.ContextDirectory) diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 71b4c0089..43524298f 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -458,4 +458,55 @@ RUN [[ -L /test/dummy-symlink ]] && echo SYMLNKOK || echo SYMLNKERR` Expect(ok).To(BeTrue()) }) + It("podman build --from, --add-host, --cap-drop, --cap-add", func() { + targetPath, err := CreateTempDirInTempDir() + Expect(err).To(BeNil()) + + containerFile := filepath.Join(targetPath, "Containerfile") + content := `FROM scratch +RUN cat /etc/hosts +RUN grep CapEff /proc/self/status` + + Expect(ioutil.WriteFile(containerFile, []byte(content), 0755)).To(BeNil()) + + defer func() { + Expect(os.RemoveAll(containerFile)).To(BeNil()) + }() + + // When + session := podmanTest.Podman([]string{ + "build", "--cap-drop=all", "--cap-add=net_bind_service", "--add-host", "testhost:1.2.3.4", "--from", "alpine", targetPath, + }) + session.WaitWithDefaultTimeout() + + // Then + Expect(session.ExitCode()).To(Equal(0)) + Expect(strings.Fields(session.OutputToString())). + To(ContainElement("alpine")) + Expect(strings.Fields(session.OutputToString())). + To(ContainElement("testhost")) + Expect(strings.Fields(session.OutputToString())). + To(ContainElement("0000000000000400")) + }) + + It("podman build --arch", func() { + targetPath, err := CreateTempDirInTempDir() + Expect(err).To(BeNil()) + + containerFile := filepath.Join(targetPath, "Containerfile") + Expect(ioutil.WriteFile(containerFile, []byte("FROM alpine"), 0755)).To(BeNil()) + + defer func() { + Expect(os.RemoveAll(containerFile)).To(BeNil()) + }() + + // When + session := podmanTest.Podman([]string{ + "build", "--arch", "arm64", targetPath, + }) + session.WaitWithDefaultTimeout() + + // Then + Expect(session.ExitCode()).To(Equal(0)) + }) }) diff --git a/vendor/github.com/containers/ocicrypt/helpers/parse_helpers.go b/vendor/github.com/containers/ocicrypt/helpers/parse_helpers.go new file mode 100644 index 000000000..288296ea5 --- /dev/null +++ b/vendor/github.com/containers/ocicrypt/helpers/parse_helpers.go @@ -0,0 +1,301 @@ +package helpers + +import ( + "fmt" + "io/ioutil" + "os" + "strconv" + "strings" + + "github.com/containers/ocicrypt" + encconfig "github.com/containers/ocicrypt/config" + encutils "github.com/containers/ocicrypt/utils" + + "github.com/pkg/errors" +) + +// processRecipientKeys sorts the array of recipients by type. Recipients may be either +// x509 certificates, public keys, or PGP public keys identified by email address or name +func processRecipientKeys(recipients []string) ([][]byte, [][]byte, [][]byte, error) { + var ( + gpgRecipients [][]byte + pubkeys [][]byte + x509s [][]byte + ) + for _, recipient := range recipients { + + idx := strings.Index(recipient, ":") + if idx < 0 { + return nil, nil, nil, errors.New("Invalid recipient format") + } + + protocol := recipient[:idx] + value := recipient[idx+1:] + + switch protocol { + case "pgp": + gpgRecipients = append(gpgRecipients, []byte(value)) + + case "jwe": + tmp, err := ioutil.ReadFile(value) + if err != nil { + return nil, nil, nil, errors.Wrap(err, "Unable to read file") + } + if !encutils.IsPublicKey(tmp) { + return nil, nil, nil, errors.New("File provided is not a public key") + } + pubkeys = append(pubkeys, tmp) + + case "pkcs7": + tmp, err := ioutil.ReadFile(value) + if err != nil { + return nil, nil, nil, errors.Wrap(err, "Unable to read file") + } + if !encutils.IsCertificate(tmp) { + return nil, nil, nil, errors.New("File provided is not an x509 cert") + } + x509s = append(x509s, tmp) + + default: + return nil, nil, nil, errors.New("Provided protocol not recognized") + } + } + return gpgRecipients, pubkeys, x509s, nil +} + +// processx509Certs processes x509 certificate files +func processx509Certs(keys []string) ([][]byte, error) { + var x509s [][]byte + for _, key := range keys { + tmp, err := ioutil.ReadFile(key) + if err != nil { + return nil, errors.Wrap(err, "Unable to read file") + } + if !encutils.IsCertificate(tmp) { + continue + } + x509s = append(x509s, tmp) + + } + return x509s, nil +} + +// processPwdString process a password that may be in any of the following formats: +// - file= +// - pass= +// - fd= +// - +func processPwdString(pwdString string) ([]byte, error) { + if strings.HasPrefix(pwdString, "file=") { + return ioutil.ReadFile(pwdString[5:]) + } else if strings.HasPrefix(pwdString, "pass=") { + return []byte(pwdString[5:]), nil + } else if strings.HasPrefix(pwdString, "fd=") { + fdStr := pwdString[3:] + fd, err := strconv.Atoi(fdStr) + if err != nil { + return nil, errors.Wrapf(err, "could not parse file descriptor %s", fdStr) + } + f := os.NewFile(uintptr(fd), "pwdfile") + if f == nil { + return nil, fmt.Errorf("%s is not a valid file descriptor", fdStr) + } + defer f.Close() + pwd := make([]byte, 64) + n, err := f.Read(pwd) + if err != nil { + return nil, errors.Wrapf(err, "could not read from file descriptor") + } + return pwd[:n], nil + } + return []byte(pwdString), nil +} + +// processPrivateKeyFiles sorts the different types of private key files; private key files may either be +// private keys or GPG private key ring files. The private key files may include the password for the +// private key and take any of the following forms: +// - +// - :file= +// - :pass= +// - :fd= +// - : +func processPrivateKeyFiles(keyFilesAndPwds []string) ([][]byte, [][]byte, [][]byte, [][]byte, error) { + var ( + gpgSecretKeyRingFiles [][]byte + gpgSecretKeyPasswords [][]byte + privkeys [][]byte + privkeysPasswords [][]byte + err error + ) + // keys needed for decryption in case of adding a recipient + for _, keyfileAndPwd := range keyFilesAndPwds { + var password []byte + + parts := strings.Split(keyfileAndPwd, ":") + if len(parts) == 2 { + password, err = processPwdString(parts[1]) + if err != nil { + return nil, nil, nil, nil, err + } + } + + keyfile := parts[0] + tmp, err := ioutil.ReadFile(keyfile) + if err != nil { + return nil, nil, nil, nil, err + } + isPrivKey, err := encutils.IsPrivateKey(tmp, password) + if encutils.IsPasswordError(err) { + return nil, nil, nil, nil, err + } + if isPrivKey { + privkeys = append(privkeys, tmp) + privkeysPasswords = append(privkeysPasswords, password) + } else if encutils.IsGPGPrivateKeyRing(tmp) { + gpgSecretKeyRingFiles = append(gpgSecretKeyRingFiles, tmp) + gpgSecretKeyPasswords = append(gpgSecretKeyPasswords, password) + } else { + // ignore if file is not recognized, so as not to error if additional + // metadata/cert files exists + continue + } + } + return gpgSecretKeyRingFiles, gpgSecretKeyPasswords, privkeys, privkeysPasswords, nil +} + +// CreateDecryptCryptoConfig creates the CryptoConfig object that contains the necessary +// information to perform decryption from command line options and possibly +// LayerInfos describing the image and helping us to query for the PGP decryption keys +func CreateDecryptCryptoConfig(keys []string, decRecipients []string) (encconfig.CryptoConfig, error) { + ccs := []encconfig.CryptoConfig{} + + // x509 cert is needed for PKCS7 decryption + _, _, x509s, err := processRecipientKeys(decRecipients) + if err != nil { + return encconfig.CryptoConfig{}, err + } + + // x509 certs can also be passed in via keys + x509FromKeys, err := processx509Certs(keys) + if err != nil { + return encconfig.CryptoConfig{}, err + } + x509s = append(x509s, x509FromKeys...) + + gpgSecretKeyRingFiles, gpgSecretKeyPasswords, privKeys, privKeysPasswords, err := processPrivateKeyFiles(keys) + if err != nil { + return encconfig.CryptoConfig{}, err + } + + if len(gpgSecretKeyRingFiles) > 0 { + gpgCc, err := encconfig.DecryptWithGpgPrivKeys(gpgSecretKeyRingFiles, gpgSecretKeyPasswords) + if err != nil { + return encconfig.CryptoConfig{}, err + } + ccs = append(ccs, gpgCc) + } + + /* TODO: Add in GPG client query for secret keys in the future. + _, err = createGPGClient(context) + gpgInstalled := err == nil + if gpgInstalled { + if len(gpgSecretKeyRingFiles) == 0 && len(privKeys) == 0 && descs != nil { + // Get pgp private keys from keyring only if no private key was passed + gpgPrivKeys, gpgPrivKeyPasswords, err := getGPGPrivateKeys(context, gpgSecretKeyRingFiles, descs, true) + if err != nil { + return encconfig.CryptoConfig{}, err + } + + gpgCc, err := encconfig.DecryptWithGpgPrivKeys(gpgPrivKeys, gpgPrivKeyPasswords) + if err != nil { + return encconfig.CryptoConfig{}, err + } + ccs = append(ccs, gpgCc) + + } else if len(gpgSecretKeyRingFiles) > 0 { + gpgCc, err := encconfig.DecryptWithGpgPrivKeys(gpgSecretKeyRingFiles, gpgSecretKeyPasswords) + if err != nil { + return encconfig.CryptoConfig{}, err + } + ccs = append(ccs, gpgCc) + + } + } + */ + + x509sCc, err := encconfig.DecryptWithX509s(x509s) + if err != nil { + return encconfig.CryptoConfig{}, err + } + ccs = append(ccs, x509sCc) + + privKeysCc, err := encconfig.DecryptWithPrivKeys(privKeys, privKeysPasswords) + if err != nil { + return encconfig.CryptoConfig{}, err + } + ccs = append(ccs, privKeysCc) + + return encconfig.CombineCryptoConfigs(ccs), nil +} + +// CreateCryptoConfig from the list of recipient strings and list of key paths of private keys +func CreateCryptoConfig(recipients []string, keys []string) (encconfig.CryptoConfig, error) { + var decryptCc *encconfig.CryptoConfig + ccs := []encconfig.CryptoConfig{} + if len(keys) > 0 { + dcc, err := CreateDecryptCryptoConfig(keys, []string{}) + if err != nil { + return encconfig.CryptoConfig{}, err + } + decryptCc = &dcc + ccs = append(ccs, dcc) + } + + if len(recipients) > 0 { + gpgRecipients, pubKeys, x509s, err := processRecipientKeys(recipients) + if err != nil { + return encconfig.CryptoConfig{}, err + } + encryptCcs := []encconfig.CryptoConfig{} + + // Create GPG client with guessed GPG version and default homedir + gpgClient, err := ocicrypt.NewGPGClient("", "") + gpgInstalled := err == nil + if len(gpgRecipients) > 0 && gpgInstalled { + gpgPubRingFile, err := gpgClient.ReadGPGPubRingFile() + if err != nil { + return encconfig.CryptoConfig{}, err + } + + gpgCc, err := encconfig.EncryptWithGpg(gpgRecipients, gpgPubRingFile) + if err != nil { + return encconfig.CryptoConfig{}, err + } + encryptCcs = append(encryptCcs, gpgCc) + } + + // Create Encryption Crypto Config + pkcs7Cc, err := encconfig.EncryptWithPkcs7(x509s) + if err != nil { + return encconfig.CryptoConfig{}, err + } + encryptCcs = append(encryptCcs, pkcs7Cc) + + jweCc, err := encconfig.EncryptWithJwe(pubKeys) + if err != nil { + return encconfig.CryptoConfig{}, err + } + encryptCcs = append(encryptCcs, jweCc) + ecc := encconfig.CombineCryptoConfigs(encryptCcs) + if decryptCc != nil { + ecc.EncryptConfig.AttachDecryptConfig(decryptCc.DecryptConfig) + } + ccs = append(ccs, ecc) + } + + if len(ccs) > 0 { + return encconfig.CombineCryptoConfigs(ccs), nil + } else { + return encconfig.CryptoConfig{}, nil + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 0f4c2b9a7..ad6465022 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -159,6 +159,7 @@ github.com/containers/libtrust github.com/containers/ocicrypt github.com/containers/ocicrypt/blockcipher github.com/containers/ocicrypt/config +github.com/containers/ocicrypt/helpers github.com/containers/ocicrypt/keywrap github.com/containers/ocicrypt/keywrap/jwe github.com/containers/ocicrypt/keywrap/pgp -- cgit v1.2.3-54-g00ecf From 566c8a43baf63d43f3bf2320f0feadc6104d931e Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 8 Feb 2021 14:26:51 -0500 Subject: Bump containers/buildah to v1.19.4 Fix handling of --iidfile to happen on the client side. Signed-off-by: Daniel J Walsh --- cmd/podman/images/build.go | 14 ++++++++++++-- pkg/domain/infra/tunnel/images.go | 11 ----------- test/e2e/build_test.go | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'cmd/podman/images') diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 0c97a2488..abd3ced5b 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -264,7 +264,18 @@ func build(cmd *cobra.Command, args []string) error { return err } - _, err = registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts) + report, err := registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts) + + if cmd.Flag("iidfile").Changed { + f, err := os.Create(buildOpts.Iidfile) + if err != nil { + return err + } + if _, err := f.WriteString("sha256:" + report.ID); err != nil { + return err + } + } + return err } @@ -468,7 +479,6 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil ForceRmIntermediateCtrs: flags.ForceRm, From: flags.From, IDMappingOptions: idmappingOptions, - IIDFile: flags.Iidfile, In: stdin, Isolation: isolation, Jobs: &flags.Jobs, diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index 214a9fef8..b5f09ab22 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -349,17 +349,6 @@ func (ir *ImageEngine) Build(_ context.Context, containerFiles []string, opts en if err != nil { return nil, err } - // For remote clients, if the option for writing to a file was - // selected, we need to write to the *client's* filesystem. - if len(opts.IIDFile) > 0 { - f, err := os.Create(opts.IIDFile) - if err != nil { - return nil, err - } - if _, err := f.WriteString(report.ID); err != nil { - return nil, err - } - } return report, nil } diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 43524298f..9bab4c926 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -194,7 +194,7 @@ var _ = Describe("Podman build", func() { inspect := podmanTest.Podman([]string{"inspect", string(id)}) inspect.WaitWithDefaultTimeout() data := inspect.InspectImageJSON() - Expect(data[0].ID).To(Equal(string(id))) + Expect("sha256:" + data[0].ID).To(Equal(string(id))) }) It("podman Test PATH in built image", func() { -- cgit v1.2.3-54-g00ecf