aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/system/service_abi.go2
-rw-r--r--test/system/251-system-service.bats8
2 files changed, 9 insertions, 1 deletions
diff --git a/cmd/podman/system/service_abi.go b/cmd/podman/system/service_abi.go
index 68ac8902b..82419ff1a 100644
--- a/cmd/podman/system/service_abi.go
+++ b/cmd/podman/system/service_abi.go
@@ -89,7 +89,7 @@ func restService(flags *pflag.FlagSet, cfg *entities.PodmanConfig, opts entities
return fmt.Errorf("unable to create socket %v: %w", host, err)
}
default:
- logrus.Debugf("Attempting API Service endpoint scheme %q", uri.Scheme)
+ return fmt.Errorf("API Service endpoint scheme %q is not supported. Try tcp://%s or unix:/%s", uri.Scheme, opts.URI, opts.URI)
}
libpodRuntime.SetRemoteURI(uri.String())
}
diff --git a/test/system/251-system-service.bats b/test/system/251-system-service.bats
index 197d1cb18..3af42b455 100644
--- a/test/system/251-system-service.bats
+++ b/test/system/251-system-service.bats
@@ -14,6 +14,14 @@ function teardown() {
basic_teardown
}
+@test "podman systerm service <bad_scheme_uri> returns error" {
+ skip_if_remote "podman system service unavailable over remote"
+ run_podman 125 system service localhost:9292
+ is "$output" "Error: API Service endpoint scheme \"localhost\" is not supported. Try tcp://localhost:9292 or unix:/localhost:9292"
+
+ run_podman 125 system service myunix.sock
+ is "$output" "Error: API Service endpoint scheme \"\" is not supported. Try tcp://myunix.sock or unix:/myunix.sock"
+}
@test "podman-system-service containers survive service stop" {
skip_if_remote "podman system service unavailable over remote"