summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/kpod/main.go1
-rw-r--r--cmd/kpod/rename.go49
-rw-r--r--completions/bash/kpod20
-rw-r--r--docs/kpod-rename.1.md24
-rw-r--r--test/kpod_rename.bats38
-rw-r--r--transfer.md1
6 files changed, 0 insertions, 133 deletions
diff --git a/cmd/kpod/main.go b/cmd/kpod/main.go
index dfa57d689..7382644b9 100644
--- a/cmd/kpod/main.go
+++ b/cmd/kpod/main.go
@@ -53,7 +53,6 @@ func main() {
psCommand,
pullCommand,
pushCommand,
- renameCommand,
rmCommand,
rmiCommand,
runCommand,
diff --git a/cmd/kpod/rename.go b/cmd/kpod/rename.go
deleted file mode 100644
index 749dd756d..000000000
--- a/cmd/kpod/rename.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package main
-
-import (
- "github.com/pkg/errors"
- "github.com/projectatomic/libpod/libkpod"
- "github.com/urfave/cli"
-)
-
-var (
- renameDescription = "Rename a container. Container may be created, running, paused, or stopped"
- renameFlags = []cli.Flag{}
- renameCommand = cli.Command{
- Name: "rename",
- Usage: "rename a container",
- Description: renameDescription,
- Action: renameCmd,
- ArgsUsage: "CONTAINER NEW-NAME",
- Flags: renameFlags,
- }
-)
-
-func renameCmd(c *cli.Context) error {
- if len(c.Args()) != 2 {
- return errors.Errorf("Rename requires a src container name/ID and a dest container name")
- }
- if err := validateFlags(c, renameFlags); err != nil {
- return err
- }
-
- config, err := getConfig(c)
- if err != nil {
- return errors.Wrapf(err, "Could not get config")
- }
- server, err := libkpod.New(config)
- if err != nil {
- return errors.Wrapf(err, "could not get container server")
- }
- defer server.Shutdown()
- err = server.Update()
- if err != nil {
- return errors.Wrapf(err, "could not update list of containers")
- }
-
- err = server.ContainerRename(c.Args().Get(0), c.Args().Get(1))
- if err != nil {
- return errors.Wrapf(err, "could not rename container")
- }
- return nil
-}
diff --git a/completions/bash/kpod b/completions/bash/kpod
index 0901a231b..a5da95a3e 100644
--- a/completions/bash/kpod
+++ b/completions/bash/kpod
@@ -931,26 +931,6 @@ _kpod_push() {
esac
}
-_kpod_rename() {
- local boolean_options="
- --help
- -h
- "
- local options_with_args="
- "
-
- local all_options="$options_with_args $boolean_options"
-
- case "$cur" in
- -*)
- COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
- ;;
- *)
- __kpod_list_containers
- ;;
- esac
-}
-
_kpod_container_run() {
local options_with_args="
--add-host
diff --git a/docs/kpod-rename.1.md b/docs/kpod-rename.1.md
deleted file mode 100644
index e59dbd991..000000000
--- a/docs/kpod-rename.1.md
+++ /dev/null
@@ -1,24 +0,0 @@
-% kpod(1) kpod-rename - Rename a container
-% Ryan Cole
-# kpod-images "1" "March 2017" "kpod"
-
-## NAME
-kpod rename - Rename a container
-
-## SYNOPSIS
-**kpod** **rename** CONTAINER NEW-NAME
-
-## DESCRIPTION
-Rename a container. Container may be created, running, paused, or stopped
-
-## EXAMPLE
-
-kpod rename redis-container webserver
-
-kpod rename a236b9a4 mycontainer
-
-## SEE ALSO
-kpod(1)
-
-## HISTORY
-March 2017, Originally compiled by Ryan Cole <rycole@redhat.com>
diff --git a/test/kpod_rename.bats b/test/kpod_rename.bats
deleted file mode 100644
index eb4e704fd..000000000
--- a/test/kpod_rename.bats
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env bats
-
-load helpers
-
-IMAGE="redis:alpine"
-
-function teardown() {
- cleanup_test
-}
-
-function setup() {
- copy_images
-}
-
-@test "kpod rename successful" {
- skip "Test needs to be converted to kpod run"
- start_crio
- run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
- echo "$output"
- [ "$status" -eq 0 ]
- run crioctl pod run --config "$TESTDATA"/sandbox_config.json
- echo "$output"
- pod_id="$output"
- [ "$status" -eq 0 ]
- run crioctl ctr create --config "$TESTDATA"/container_config.json --pod "$pod_id"
- ctr_id="$output"
- [ "$status" -eq 0 ]
- run bash -c ${KPOD_BINARY} $KPOD_OPTIONS rename "$ctr_id" "$NEW_NAME"
- echo "$output"
- [ "$status" -eq 0 ]
- run bash -c ${KPOD_BINARY} $KPOD_OPTIONS inspect "$ctr_id" --format {{.Name}}
- echo "$output"
- [ "$status" -eq 0 ]
- [ "$output" == "$NEW_NAME" ]
- cleanup_ctrs
- cleanup_pods
- stop_crio
-}
diff --git a/transfer.md b/transfer.md
index 3f188cf84..4d5ffd59d 100644
--- a/transfer.md
+++ b/transfer.md
@@ -53,7 +53,6 @@ There are other equivalents for these tools
| `docker ps` | [`kpod ps`](./docs/kpod-ps.1.md) |
| `docker pull` | [`kpod pull`](./docs/kpod-pull.1.md) |
| `docker push` | [`kpod push`](./docs/kpod-push.1.md) |
-| `docker rename` | [`kpod rename`](./docs/kpod-rename.1.md) |
| `docker rm` | [`kpod rm`](./docs/kpod-rm.1.md) |
| `docker rmi` | [`kpod rmi`](./docs/kpod-rmi.1.md) |
| `docker run` | [`kpod run`](./docs/kpod-run.1.md) |