summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers_remote.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-04-02 15:58:23 -0700
committerJhon Honce <jhonce@redhat.com>2020-04-07 19:22:10 -0700
commite0847f5457edfdeb17dad259f1cd06b1d4cec93e (patch)
tree157f89a3172892a83b7c8515b0991d806f4c159e /pkg/adapter/containers_remote.go
parentb4840ec0d34bd679faefe06ce52ee6cebcb8f0b5 (diff)
downloadpodman-e0847f5457edfdeb17dad259f1cd06b1d4cec93e.tar.gz
podman-e0847f5457edfdeb17dad259f1cd06b1d4cec93e.tar.bz2
podman-e0847f5457edfdeb17dad259f1cd06b1d4cec93e.zip
V2 podman system service
* Added support for system service * Enabled linting on the varlinkapi source, needed to support V2 service command * Added support for PODMAN_SOCKET Skip linting deprecated code Rather than introduce bugs by correcting deprecated code, linting the code is being skipped. Code that is being ported into V2 is being checked. Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/adapter/containers_remote.go')
-rw-r--r--pkg/adapter/containers_remote.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/pkg/adapter/containers_remote.go b/pkg/adapter/containers_remote.go
index fc8b524d6..777605896 100644
--- a/pkg/adapter/containers_remote.go
+++ b/pkg/adapter/containers_remote.go
@@ -341,7 +341,7 @@ func (r *LocalRuntime) RemoveContainers(ctx context.Context, cli *cliconfig.RmVa
failures[ctr] = errors.Wrapf(err, "Failed to evict container: %q", id)
continue
}
- ok = append(ok, string(id))
+ ok = append(ok, id)
}
return ok, failures, nil
}
@@ -432,7 +432,7 @@ func BatchContainerOp(ctr *Container, opts shared.PsOptions) (shared.BatchContai
// Log one or more containers over a varlink connection
func (r *LocalRuntime) Log(c *cliconfig.LogsValues, options *logs.LogOptions) error {
// GetContainersLogs
- reply, err := iopodman.GetContainersLogs().Send(r.Conn, uint64(varlink.More), c.InputArgs, c.Follow, c.Latest, options.Since.Format(time.RFC3339Nano), int64(c.Tail), c.Timestamps)
+ reply, err := iopodman.GetContainersLogs().Send(r.Conn, uint64(varlink.More), c.InputArgs, c.Follow, c.Latest, options.Since.Format(time.RFC3339Nano), c.Tail, c.Timestamps)
if err != nil {
return errors.Wrapf(err, "failed to get container logs")
}
@@ -753,15 +753,15 @@ func (r *LocalRuntime) attach(ctx context.Context, stdin, stdout *os.File, cid s
return nil, nil, err
}
defer cancel()
- defer restoreTerminal(oldTermState)
+ defer restoreTerminal(oldTermState) // nolint: errcheck
logrus.SetFormatter(&RawTtyFormatter{})
- term.SetRawTerminal(os.Stdin.Fd())
+ term.SetRawTerminal(os.Stdin.Fd()) // nolint: errcheck
}
reply, err := iopodman.Attach().Send(r.Conn, varlink.Upgrade, cid, detachKeys, start)
if err != nil {
- restoreTerminal(oldTermState)
+ restoreTerminal(oldTermState) // nolint: errcheck
return nil, nil, err
}
@@ -769,7 +769,7 @@ func (r *LocalRuntime) attach(ctx context.Context, stdin, stdout *os.File, cid s
_, err = reply()
if err != nil {
- restoreTerminal(oldTermState)
+ restoreTerminal(oldTermState) // nolint: errcheck
return nil, nil, err
}
@@ -857,7 +857,7 @@ func (r *LocalRuntime) Restart(ctx context.Context, c *cliconfig.RestartValues)
useTimeout := c.Flag("timeout").Changed || c.Flag("time").Changed
inputTimeout := c.Timeout
- if c.Latest {
+ if c.Latest { // nolint: gocritic
lastCtr, err := r.GetLatestContainer()
if err != nil {
return nil, nil, errors.Wrapf(err, "unable to get latest container")
@@ -1042,10 +1042,10 @@ func (r *LocalRuntime) ExecContainer(ctx context.Context, cli *cliconfig.ExecVal
return ec, err
}
defer cancel()
- defer restoreTerminal(oldTermState)
+ defer restoreTerminal(oldTermState) // nolint: errcheck
logrus.SetFormatter(&RawTtyFormatter{})
- term.SetRawTerminal(os.Stdin.Fd())
+ term.SetRawTerminal(os.Stdin.Fd()) // nolint: errcheck
}
opts := iopodman.ExecOpts{
@@ -1082,7 +1082,7 @@ func (r *LocalRuntime) ExecContainer(ctx context.Context, cli *cliconfig.ExecVal
return ec, err
}
-func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, stdin *os.File, stdout *os.File, oldTermState *term.State, resize chan remotecommand.TerminalSize, ecChan chan int) chan error {
+func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, stdin *os.File, stdout *os.File, oldTermState *term.State, resize chan remotecommand.TerminalSize, ecChan chan int) chan error { // nolint: interfacer
errChan := make(chan error, 1)
// These are the special writers that encode input from the client.
varlinkStdinWriter := virtwriter.NewVirtWriteCloser(writer, virtwriter.ToStdin)
@@ -1092,7 +1092,7 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std
go func() {
// Read from the wire and direct to stdout or stderr
err := virtwriter.Reader(reader, stdout, os.Stderr, nil, nil, ecChan)
- defer restoreTerminal(oldTermState)
+ defer restoreTerminal(oldTermState) // nolint: errcheck
sendGenericError(ecChan)
errChan <- err
}()
@@ -1101,13 +1101,13 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std
for termResize := range resize {
b, err := json.Marshal(termResize)
if err != nil {
- defer restoreTerminal(oldTermState)
+ defer restoreTerminal(oldTermState) // nolint: errcheck,staticcheck
sendGenericError(ecChan)
errChan <- err
}
_, err = varlinkResizeWriter.Write(b)
if err != nil {
- defer restoreTerminal(oldTermState)
+ defer restoreTerminal(oldTermState) // nolint: errcheck,staticcheck
sendGenericError(ecChan)
errChan <- err
}
@@ -1117,7 +1117,7 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std
// Takes stdinput and sends it over the wire after being encoded
go func() {
if _, err := io.Copy(varlinkStdinWriter, stdin); err != nil {
- defer restoreTerminal(oldTermState)
+ defer restoreTerminal(oldTermState) // nolint: errcheck
sendGenericError(ecChan)
errChan <- err
}