cli/command/context: remove deprecated types and functions
These functions and types are shallow wrappers around the context store and were intended for internal use as implementation for the CLI itself. They were exported in3126920af1to be used by plugins and Docker Desktop. However, there's currently no public uses of this, and Docker Desktop does not use these functions. These were deprecated in95eeafa551and are no longer used. This patch removes the deprecated functions as they were meant to be implementation specific for the CLI. If there's a need to provide utilities for manipulating the context-store other than through the CLI itself, we can consider creating an SDK for that purpose. This removes: - `RunCreate` and `CreateOptions` - `RunExport` and `ExportOptions` - `RunImport` - `RunRemove` and `RemoveOptions` - `RunUpdate` and `UpdateOptions` - `RunUse` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -12,14 +12,6 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// ExportOptions are the options used for exporting a context
|
||||
//
|
||||
// Deprecated: this type was for internal use and will be removed in the next release.
|
||||
type ExportOptions struct {
|
||||
ContextName string
|
||||
Dest string
|
||||
}
|
||||
|
||||
func newExportCommand(dockerCLI command.Cli) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "export [OPTIONS] CONTEXT [FILE|-]",
|
||||
@ -65,16 +57,6 @@ func writeTo(dockerCli command.Cli, reader io.Reader, dest string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RunExport exports a Docker context
|
||||
//
|
||||
// Deprecated: this function was for internal use and will be removed in the next release.
|
||||
func RunExport(dockerCli command.Cli, opts *ExportOptions) error {
|
||||
if opts == nil {
|
||||
opts = &ExportOptions{}
|
||||
}
|
||||
return runExport(dockerCli, opts.ContextName, opts.Dest)
|
||||
}
|
||||
|
||||
// runExport exports a Docker context.
|
||||
func runExport(dockerCLI command.Cli, contextName string, dest string) error {
|
||||
if err := store.ValidateContextName(contextName); err != nil && contextName != command.DefaultContextName {
|
||||
|
||||
Reference in New Issue
Block a user