mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
Add alias for podman network rm -> remove
docker network remove exists and is alias to docker network rm. Bug for bug compatible. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -18,6 +18,7 @@ var (
|
|||||||
networkrmDescription = `Remove networks`
|
networkrmDescription = `Remove networks`
|
||||||
networkrmCommand = &cobra.Command{
|
networkrmCommand = &cobra.Command{
|
||||||
Use: "rm [options] NETWORK [NETWORK...]",
|
Use: "rm [options] NETWORK [NETWORK...]",
|
||||||
|
Aliases: []string{"remove"},
|
||||||
Short: "network rm",
|
Short: "network rm",
|
||||||
Long: networkrmDescription,
|
Long: networkrmDescription,
|
||||||
RunE: networkRm,
|
RunE: networkRm,
|
||||||
|
@ -76,14 +76,15 @@ var _ = Describe("Podman network", func() {
|
|||||||
Expect(session.LineInOutputContains(name)).To(BeFalse())
|
Expect(session.LineInOutputContains(name)).To(BeFalse())
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman network rm no args", func() {
|
rm_func := func(rm string) {
|
||||||
session := podmanTest.Podman([]string{"network", "rm"})
|
It(fmt.Sprintf("podman network %s no args", rm), func() {
|
||||||
|
session := podmanTest.Podman([]string{"network", rm})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).ToNot(BeZero())
|
Expect(session.ExitCode()).ToNot(BeZero())
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman network rm", func() {
|
It(fmt.Sprintf("podman network %s", rm), func() {
|
||||||
SkipIfRootless("FIXME: This one is definitely broken in rootless mode")
|
|
||||||
name, path := generateNetworkConfig(podmanTest)
|
name, path := generateNetworkConfig(podmanTest)
|
||||||
defer removeConf(path)
|
defer removeConf(path)
|
||||||
|
|
||||||
@ -92,7 +93,7 @@ var _ = Describe("Podman network", func() {
|
|||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
Expect(session.LineInOutputContains(name)).To(BeTrue())
|
Expect(session.LineInOutputContains(name)).To(BeTrue())
|
||||||
|
|
||||||
rm := podmanTest.Podman([]string{"network", "rm", name})
|
rm := podmanTest.Podman([]string{"network", rm, name})
|
||||||
rm.WaitWithDefaultTimeout()
|
rm.WaitWithDefaultTimeout()
|
||||||
Expect(rm.ExitCode()).To(BeZero())
|
Expect(rm.ExitCode()).To(BeZero())
|
||||||
|
|
||||||
@ -101,6 +102,10 @@ var _ = Describe("Podman network", func() {
|
|||||||
Expect(results.ExitCode()).To(Equal(0))
|
Expect(results.ExitCode()).To(Equal(0))
|
||||||
Expect(results.LineInOutputContains(name)).To(BeFalse())
|
Expect(results.LineInOutputContains(name)).To(BeFalse())
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
rm_func("rm")
|
||||||
|
rm_func("remove")
|
||||||
|
|
||||||
It("podman network inspect no args", func() {
|
It("podman network inspect no args", func() {
|
||||||
session := podmanTest.Podman([]string{"network", "inspect"})
|
session := podmanTest.Podman([]string{"network", "inspect"})
|
||||||
|
Reference in New Issue
Block a user