mirror of
https://github.com/docker/compose.git
synced 2026-06-24 18:18:27 +00:00
Merge pull request #161 from docker/context_inspect
Add docker context inspect command relying on classic docker
This commit is contained in:
commit
f1fb80ecc5
5 changed files with 96 additions and 28 deletions
|
|
@ -47,6 +47,7 @@ func Command() *cobra.Command {
|
|||
showCommand(),
|
||||
useCommand(),
|
||||
login.Command(),
|
||||
inspectCommand(),
|
||||
)
|
||||
|
||||
return cmd
|
||||
|
|
|
|||
47
cli/cmd/context/inspect.go
Normal file
47
cli/cmd/context/inspect.go
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Copyright (c) 2020 Docker Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use, copy,
|
||||
modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package context
|
||||
|
||||
import (
|
||||
"github.com/docker/api/cli/dockerclassic"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func inspectCommand() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "inspect",
|
||||
Short: "Display detailed information on one or more contexts",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
dockerclassic.Exec(cmd.Context())
|
||||
return nil
|
||||
},
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue