Adds a couple of new linters with many new warnings:
- perfsprint (fixed in code, excluded for tests)
- revive (fix the problems, disabled the dot import check as we use it
for ginkgo)
- inamedparam (disabled because it is opinionated)
- testifylint (great linter but we have like 1000+ issues that I have no
time fixing now)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Because the SSH exec functions do not currently support execution with
input, some users (such as the podman-image-scp) must operate in two
phases, first copying a file to the remote host, and then executing a
command with shell redirection and removing the temporary file.
This API extension allows those users to simplify their code and
avoid the use of temporary files.
Signed-off-by: Gordon Messmer <gordon.messmer@gmail.com>
podman systemd conenction and farm currently both write containers.conf
to store their settings. Each write removes comments from the user
config file and thus makes it not great to use.
The new approach is to have a seperate file connections.conf (json
format) to store both conenctions and farms for podman. We continue to
read containers.conf for the connections and farms as well and podman
can read both. This means we have a read only store in containers.conf
(manually added by users), they cannot be removed by the podman cli.
This is a breaking chnage and will require many chnages in podman to
migrate to the new APIs added in this commit.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
A new --farm flag is being added to podman system connection
add so that when a new connection is added it can be added to a new
or existing farm. Update the code here to be able to do that.
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This removes logic which forces the socket path (if present) to start
with "/run" and uses (*URL).String to reconstruct the URI after applying
port and user policy. Fixes#1551.
Signed-off-by: Doug Rabson <dfr@rabson.org>
Used `go fmt` rules to migrate away from deprecated functions, for
instance `gofmt -w -s -r 'ioutil.TempDir(a, b) -> os.MkdirTemp(a, b)'`
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
this ensures that podman machine will still work (until we want to make this mandatory). I made the call back function more verbose so we know what is happening from now on.
Signed-off-by: Charlie Doern <cdoern@redhat.com>
Podman adds an Error: to every error message. So starting an error
message with "error" ends up being reported to the user as
Error: error ...
This patch removes the stutter.
Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
initial implementation of the ssh package including:
- nativeConnectionCreate() / golangConnectionCreate()
- n/a / golangConnectionDial()
- nativeConnectionScp() / golangConnectionScp()
- nativeConnectionExec() / golangConnectionExeC()
the way this works, is there are publicly accessible functions Create, Exec, Dial and Scp. podman will have a new global flag --ssh` that will allow users to choose native or golang based ssh functions. The functionality in containers/common (here) also checks if you have the necessary binaries installed
closes#1091
Signed-off-by: Charlie Doern <cdoern@redhat.com>