summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--API.md2
-rw-r--r--cmd/podman/common.go4
-rw-r--r--cmd/podman/create.go8
-rw-r--r--cmd/podman/run.go2
-rw-r--r--cmd/podman/shared/create.go13
-rw-r--r--cmd/podman/shared/intermediate.go1
-rw-r--r--cmd/podman/shared/intermediate_varlink.go2
-rw-r--r--cmd/podman/utils.go2
-rw-r--r--cmd/podman/varlink/io.podman.varlink1
-rw-r--r--docs/source/markdown/podman-create.1.md2
-rw-r--r--docs/source/markdown/podman-run.1.md2
-rwxr-xr-x[-rw-r--r--]hack/install_golangci.sh14
-rw-r--r--pkg/systemdgen/systemdgen.go4
-rw-r--r--pkg/systemdgen/systemdgen_test.go4
-rw-r--r--test/e2e/generate_systemd_test.go2
-rw-r--r--test/e2e/run_signal_test.go2
16 files changed, 27 insertions, 38 deletions
diff --git a/API.md b/API.md
index ca71fdf9e..cfbe394de 100644
--- a/API.md
+++ b/API.md
@@ -1587,8 +1587,6 @@ memorySwappiness [?int](#?int)
name [?string](#?string)
-net [?string](#?string)
-
network [?string](#?string)
noHosts [?bool](#?bool)
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index 9064ec219..8690be64f 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -376,10 +376,6 @@ func getCreateFlags(c *cliconfig.PodmanCommand) {
"Assign a name to the container",
)
createFlags.String(
- "net", getDefaultNetwork(),
- "Connect a container to a network",
- )
- createFlags.String(
"network", getDefaultNetwork(),
"Connect a container to a network",
)
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index 73fba5a8c..01cad9765 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -85,13 +85,7 @@ func createInit(c *cliconfig.PodmanCommand) error {
logrus.Warn("setting security options with --privileged has no effect")
}
- var setNet string
- if c.IsSet("network") {
- setNet = c.String("network")
- } else if c.IsSet("net") {
- setNet = c.String("net")
- }
- if (c.IsSet("dns") || c.IsSet("dns-opt") || c.IsSet("dns-search")) && (setNet == "none" || strings.HasPrefix(setNet, "container:")) {
+ if (c.IsSet("dns") || c.IsSet("dns-opt") || c.IsSet("dns-search")) && (c.String("network") == "none" || strings.HasPrefix(c.String("network"), "container:")) {
return errors.Errorf("conflicting options: dns and the network mode.")
}
diff --git a/cmd/podman/run.go b/cmd/podman/run.go
index a6468f225..caa594682 100644
--- a/cmd/podman/run.go
+++ b/cmd/podman/run.go
@@ -25,7 +25,7 @@ var (
return runCmd(&runCommand)
},
Example: `podman run imageID ls -alF /etc
- podman run --net=host imageID dnf -y install java
+ podman run --network=host imageID dnf -y install java
podman run --volume /var/hostdir:/var/ctrdir -i -t fedora /bin/bash`,
}
)
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index 50a64b01c..15d6bddbb 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -355,14 +355,10 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
// Instead of integrating here, should be done in libpod
// However, that also involves setting up security opts
// when the pod's namespace is integrated
- namespaceNet := c.String("network")
- if c.Changed("net") {
- namespaceNet = c.String("net")
- }
namespaces = map[string]string{
"cgroup": c.String("cgroupns"),
"pid": c.String("pid"),
- "net": namespaceNet,
+ "net": c.String("network"),
"ipc": c.String("ipc"),
"user": c.String("userns"),
"uts": c.String("uts"),
@@ -636,11 +632,6 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
}
// This is done because cobra cannot have two aliased flags. So we have to check
// both
- network := c.String("network")
- if c.Changed("net") {
- network = c.String("net")
- }
-
memorySwappiness := c.Int64("memory-swappiness")
logDriver := libpod.KubernetesLogging
@@ -687,7 +678,7 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
DNSServers: c.StringSlice("dns"),
HTTPProxy: c.Bool("http-proxy"),
MacAddress: c.String("mac-address"),
- Network: network,
+ Network: c.String("network"),
NetMode: netMode,
IPAddress: c.String("ip"),
Publish: c.StringSlice("publish"),
diff --git a/cmd/podman/shared/intermediate.go b/cmd/podman/shared/intermediate.go
index d1f0e602e..cfb3f612c 100644
--- a/cmd/podman/shared/intermediate.go
+++ b/cmd/podman/shared/intermediate.go
@@ -423,7 +423,6 @@ func NewIntermediateLayer(c *cliconfig.PodmanCommand, remote bool) GenericCLIRes
m["memory-swap"] = newCRString(c, "memory-swap")
m["memory-swappiness"] = newCRInt64(c, "memory-swappiness")
m["name"] = newCRString(c, "name")
- m["net"] = newCRString(c, "net")
m["network"] = newCRString(c, "network")
m["no-hosts"] = newCRBool(c, "no-hosts")
m["oom-kill-disable"] = newCRBool(c, "oom-kill-disable")
diff --git a/cmd/podman/shared/intermediate_varlink.go b/cmd/podman/shared/intermediate_varlink.go
index 89bd52324..691c4f92d 100644
--- a/cmd/podman/shared/intermediate_varlink.go
+++ b/cmd/podman/shared/intermediate_varlink.go
@@ -127,7 +127,6 @@ func (g GenericCLIResults) MakeVarlink() iopodman.Create {
MemorySwap: StringToPtr(g.Find("memory-swap")),
MemorySwappiness: AnyIntToInt64Ptr(g.Find("memory-swappiness")),
Name: StringToPtr(g.Find("name")),
- Net: StringToPtr(g.Find("net")),
Network: StringToPtr(g.Find("network")),
OomKillDisable: BoolToPtr(g.Find("oom-kill-disable")),
OomScoreAdj: AnyIntToInt64Ptr(g.Find("oom-score-adj")),
@@ -386,7 +385,6 @@ func VarlinkCreateToGeneric(opts iopodman.Create) GenericCLIResults {
m["memory-swap"] = stringFromVarlink(opts.MemorySwap, "memory-swap", nil)
m["memory-swappiness"] = int64FromVarlink(opts.MemorySwappiness, "memory-swappiness", &memSwapDefault)
m["name"] = stringFromVarlink(opts.Name, "name", nil)
- m["net"] = stringFromVarlink(opts.Net, "net", &netModeDefault)
m["network"] = stringFromVarlink(opts.Network, "network", &netModeDefault)
m["no-hosts"] = boolFromVarlink(opts.NoHosts, "no-hosts", false)
m["oom-kill-disable"] = boolFromVarlink(opts.OomKillDisable, "oon-kill-disable", false)
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go
index 21389b43a..44e65b223 100644
--- a/cmd/podman/utils.go
+++ b/cmd/podman/utils.go
@@ -61,6 +61,8 @@ func aliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
name = "health-start-period"
case "healthcheck-timeout":
name = "health-timeout"
+ case "net":
+ name = "network"
}
return pflag.NormalizedName(name)
}
diff --git a/cmd/podman/varlink/io.podman.varlink b/cmd/podman/varlink/io.podman.varlink
index b993457ca..a0227c48c 100644
--- a/cmd/podman/varlink/io.podman.varlink
+++ b/cmd/podman/varlink/io.podman.varlink
@@ -350,7 +350,6 @@ type Create (
memorySwap: ?string,
memorySwappiness: ?int,
name: ?string,
- net: ?string,
network: ?string,
noHosts: ?bool,
oomKillDisable: ?bool,
diff --git a/docs/source/markdown/podman-create.1.md b/docs/source/markdown/podman-create.1.md
index 81fae0b25..0236e30ba 100644
--- a/docs/source/markdown/podman-create.1.md
+++ b/docs/source/markdown/podman-create.1.md
@@ -1014,7 +1014,7 @@ In order for users to run rootless, there must be an entry for their username in
Rootless Podman works better if the fuse-overlayfs and slirp4netns packages are installed.
The fuse-overlay package provides a userspace overlay storage driver, otherwise users need to use
the vfs storage driver, which is diskspace expensive and does not perform well. slirp4netns is
-required for VPN, without it containers need to be run with the --net=host flag.
+required for VPN, without it containers need to be run with the --network=host flag.
## ENVIRONMENT
diff --git a/docs/source/markdown/podman-run.1.md b/docs/source/markdown/podman-run.1.md
index af5bb814d..f613e6668 100644
--- a/docs/source/markdown/podman-run.1.md
+++ b/docs/source/markdown/podman-run.1.md
@@ -1310,7 +1310,7 @@ In order for users to run rootless, there must be an entry for their username in
Rootless Podman works better if the fuse-overlayfs and slirp4netns packages are installed.
The fuse-overlay package provides a userspace overlay storage driver, otherwise users need to use
the vfs storage driver, which is diskspace expensive and does not perform well. slirp4netns is
-required for VPN, without it containers need to be run with the --net=host flag.
+required for VPN, without it containers need to be run with the --network=host flag.
## ENVIRONMENT
diff --git a/hack/install_golangci.sh b/hack/install_golangci.sh
index 9d23bbd31..430685a71 100644..100755
--- a/hack/install_golangci.sh
+++ b/hack/install_golangci.sh
@@ -1,5 +1,17 @@
-#!/bin/bash -e
+#!/bin/bash
+
+if [ -z "$VERSION" ]; then
+ echo \$VERSION is empty
+ exit 1
+fi
+
+if [ -z "$GOBIN" ]; then
+ echo \$GOBIN is empty
+ exit 1
+fi
+
$GOBIN/golangci-lint --version | grep $VERSION
if [ $? -ne 0 ]; then
+ set -e
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOBIN v$VERSION
fi
diff --git a/pkg/systemdgen/systemdgen.go b/pkg/systemdgen/systemdgen.go
index b6167a23e..745b708e4 100644
--- a/pkg/systemdgen/systemdgen.go
+++ b/pkg/systemdgen/systemdgen.go
@@ -96,8 +96,8 @@ Restart={{.RestartPolicy}}
{{- if .New}}
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStart={{.RunCommand}}
-ExecStop={{.Executable}} stop --cidfile /%t/%n-cid {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}
-ExecStopPost={{.Executable}} rm -f --cidfile /%t/%n-cid
+ExecStop={{.Executable}} stop --ignore --cidfile /%t/%n-cid {{if (ge .StopTimeout 0)}}-t {{.StopTimeout}}{{end}}
+ExecStopPost={{.Executable}} rm --ignore -f --cidfile /%t/%n-cid
PIDFile=/%t/%n-pid
{{- else}}
ExecStart={{.Executable}} start {{.ContainerName}}
diff --git a/pkg/systemdgen/systemdgen_test.go b/pkg/systemdgen/systemdgen_test.go
index 3894a0205..9c6933d17 100644
--- a/pkg/systemdgen/systemdgen_test.go
+++ b/pkg/systemdgen/systemdgen_test.go
@@ -123,8 +123,8 @@ Documentation=man:podman-generate-systemd(1)
Restart=always
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
ExecStart=/usr/bin/podman run --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid --name jadda-jadda --hostname hello-world awesome-image:latest command arg1 ... argN
-ExecStop=/usr/bin/podman stop --cidfile /%t/%n-cid -t 42
-ExecStopPost=/usr/bin/podman rm -f --cidfile /%t/%n-cid
+ExecStop=/usr/bin/podman stop --ignore --cidfile /%t/%n-cid -t 42
+ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile /%t/%n-cid
PIDFile=/%t/%n-pid
KillMode=none
Type=forking
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index f0fef41a4..d0dadd09d 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -191,7 +191,7 @@ var _ = Describe("Podman generate systemd", func() {
found, _ := session.GrepString("# container-foo.service")
Expect(found).To(BeTrue())
- found, _ = session.GrepString("stop --cidfile /%t/%n-cid -t 42")
+ found, _ = session.GrepString("stop --ignore --cidfile /%t/%n-cid -t 42")
Expect(found).To(BeTrue())
})
diff --git a/test/e2e/run_signal_test.go b/test/e2e/run_signal_test.go
index eee7c14fb..fbdd3acec 100644
--- a/test/e2e/run_signal_test.go
+++ b/test/e2e/run_signal_test.go
@@ -132,7 +132,7 @@ var _ = Describe("Podman run with --sig-proxy", func() {
Expect(killSession.ExitCode()).To(Equal(0))
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(137))
+ Expect(session.ExitCode()).ToNot(Equal(0))
ok, _ = session.GrepString("Received")
Expect(ok).To(BeFalse())
})