summaryrefslogtreecommitdiff
path: root/cmd/podman/parse
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-04-29 15:44:44 -0700
committerJhon Honce <jhonce@redhat.com>2020-04-29 15:51:37 -0700
commit22d5b2e3053ad66ce3b30eba3adfca70bc8e389d (patch)
treec01c90c7ab2e853930c12d9b04e5ce0e3cb2d914 /cmd/podman/parse
parent99f8cfc2dc39b11cd315062167f1ffaf85eda946 (diff)
downloadpodman-22d5b2e3053ad66ce3b30eba3adfca70bc8e389d.tar.gz
podman-22d5b2e3053ad66ce3b30eba3adfca70bc8e389d.tar.bz2
podman-22d5b2e3053ad66ce3b30eba3adfca70bc8e389d.zip
V2 enable ps tests
* Combine cobra.Command helper functions into validate package from registry and common packages * Introduce ChoiceValue for flags Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/parse')
-rw-r--r--cmd/podman/parse/net.go4
-rw-r--r--cmd/podman/parse/net_test.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/parse/net.go b/cmd/podman/parse/net.go
index 03cda268c..f93c4ab1e 100644
--- a/cmd/podman/parse/net.go
+++ b/cmd/podman/parse/net.go
@@ -1,4 +1,4 @@
-//nolint
+// nolint
// most of these validate and parse functions have been taken from projectatomic/docker
// and modified for cri-o
package parse
@@ -46,7 +46,7 @@ var (
// validateExtraHost validates that the specified string is a valid extrahost and returns it.
// ExtraHost is in the form of name:ip where the ip has to be a valid ip (ipv4 or ipv6).
// for add-host flag
-func ValidateExtraHost(val string) (string, error) { //nolint
+func ValidateExtraHost(val string) (string, error) { // nolint
// allow for IPv6 addresses in extra hosts by only splitting on first ":"
arr := strings.SplitN(val, ":", 2)
if len(arr) != 2 || len(arr[0]) == 0 {
diff --git a/cmd/podman/parse/net_test.go b/cmd/podman/parse/net_test.go
index a6ddc2be9..51c8509df 100644
--- a/cmd/podman/parse/net_test.go
+++ b/cmd/podman/parse/net_test.go
@@ -1,4 +1,4 @@
-//nolint
+// nolint
// most of these validate and parse functions have been taken from projectatomic/docker
// and modified for cri-o
package parse
@@ -41,7 +41,7 @@ func TestValidateExtraHost(t *testing.T) {
want string
wantErr bool
}{
- //2001:0db8:85a3:0000:0000:8a2e:0370:7334
+ // 2001:0db8:85a3:0000:0000:8a2e:0370:7334
{name: "good-ipv4", args: args{val: "foobar:192.168.1.1"}, want: "foobar:192.168.1.1", wantErr: false},
{name: "bad-ipv4", args: args{val: "foobar:999.999.999.99"}, want: "", wantErr: true},
{name: "bad-ipv4", args: args{val: "foobar:999.999.999"}, want: "", wantErr: true},