diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-19 17:35:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 17:35:43 +0200 |
commit | 5f5d40084c71a5adabc029c97d682c33cab07353 (patch) | |
tree | 1ad481a8d7d177ad6f1f1fffbddf21c5e7b72ff5 /cmd/podman/system/context.go | |
parent | 541655f31a5301ea042d04782d1635ad51e9f434 (diff) | |
parent | 3508bd22fe355630453d497d905e480974a84b96 (diff) | |
download | podman-5f5d40084c71a5adabc029c97d682c33cab07353.tar.gz podman-5f5d40084c71a5adabc029c97d682c33cab07353.tar.bz2 podman-5f5d40084c71a5adabc029c97d682c33cab07353.zip |
Merge pull request #15072 from rhatdan/context
Add support for podman context as alias to podman system connection
Diffstat (limited to 'cmd/podman/system/context.go')
-rw-r--r-- | cmd/podman/system/context.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cmd/podman/system/context.go b/cmd/podman/system/context.go new file mode 100644 index 000000000..926e4a443 --- /dev/null +++ b/cmd/podman/system/context.go @@ -0,0 +1,28 @@ +package system + +import ( + "github.com/containers/podman/v4/cmd/podman/registry" + "github.com/containers/podman/v4/cmd/podman/validate" + "github.com/spf13/cobra" +) + +var ( + // ContextCmd skips creating engines (PersistentPreRunE/PersistentPostRunE are No-Op's) since + // sub-commands will obtain connection information to said engines + ContextCmd = &cobra.Command{ + Use: "context", + Short: "Manage remote API service destinations", + Long: `Manage remote API service destination information in podman configuration`, + PersistentPreRunE: validate.NoOp, + RunE: validate.SubCommandExists, + PersistentPostRunE: validate.NoOp, + Hidden: true, + TraverseChildren: false, + } +) + +func init() { + registry.Commands = append(registry.Commands, registry.CliCommand{ + Command: ContextCmd, + }) +} |