summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-15 09:19:40 -0400
committerGitHub <noreply@github.com>2020-06-15 09:19:40 -0400
commitf4c3b718eb22a161a897a6ed55d10f3a07e31aa8 (patch)
treebb453d40a50f8cef1ebfedc73e43e2c7fe7d3456 /pkg/bindings
parente94e3fd2e829fd2cd38428aa9d9bf68b37bb8407 (diff)
parent200cfa41a434b7143620c2c252b3eb7ab3ef92f9 (diff)
downloadpodman-f4c3b718eb22a161a897a6ed55d10f3a07e31aa8.tar.gz
podman-f4c3b718eb22a161a897a6ed55d10f3a07e31aa8.tar.bz2
podman-f4c3b718eb22a161a897a6ed55d10f3a07e31aa8.zip
Merge pull request #6557 from rhatdan/lint
Turn on More linters
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/connection.go15
-rw-r--r--pkg/bindings/containers/checkpoint.go2
-rw-r--r--pkg/bindings/containers/types.go2
-rw-r--r--pkg/bindings/images/images.go2
4 files changed, 10 insertions, 11 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go
index aa7f3707c..a9c61e5ae 100644
--- a/pkg/bindings/connection.go
+++ b/pkg/bindings/connection.go
@@ -115,12 +115,12 @@ func NewConnectionWithIdentity(ctx context.Context, uri string, passPhrase strin
_url.Path = JoinURL(_url.Host, _url.Path)
_url.Host = ""
}
- connection, err = unixClient(_url)
+ connection = unixClient(_url)
case "tcp":
if !strings.HasPrefix(uri, "tcp://") {
return nil, errors.New("tcp URIs should begin with tcp://")
}
- connection, err = tcpClient(_url)
+ connection = tcpClient(_url)
default:
return nil, errors.Errorf("'%s' is not a supported schema", _url.Scheme)
}
@@ -135,7 +135,7 @@ func NewConnectionWithIdentity(ctx context.Context, uri string, passPhrase strin
return ctx, nil
}
-func tcpClient(_url *url.URL) (Connection, error) {
+func tcpClient(_url *url.URL) Connection {
connection := Connection{
URI: _url,
}
@@ -147,7 +147,7 @@ func tcpClient(_url *url.URL) (Connection, error) {
DisableCompression: true,
},
}
- return connection, nil
+ return connection
}
// pingNewConnection pings to make sure the RESTFUL service is up
@@ -186,8 +186,7 @@ func pingNewConnection(ctx context.Context) error {
}
func sshClient(_url *url.URL, secure bool, passPhrase string, identities ...string) (Connection, error) {
- var authMethods []ssh.AuthMethod
-
+ authMethods := []ssh.AuthMethod{}
for _, i := range identities {
auth, err := publicKey(i, []byte(passPhrase))
if err != nil {
@@ -256,7 +255,7 @@ func sshClient(_url *url.URL, secure bool, passPhrase string, identities ...stri
return connection, nil
}
-func unixClient(_url *url.URL) (Connection, error) {
+func unixClient(_url *url.URL) Connection {
connection := Connection{URI: _url}
connection.Client = &http.Client{
Transport: &http.Transport{
@@ -266,7 +265,7 @@ func unixClient(_url *url.URL) (Connection, error) {
DisableCompression: true,
},
}
- return connection, nil
+ return connection
}
// DoRequest assembles the http request and returns the response
diff --git a/pkg/bindings/containers/checkpoint.go b/pkg/bindings/containers/checkpoint.go
index 916ec8071..8a3932e80 100644
--- a/pkg/bindings/containers/checkpoint.go
+++ b/pkg/bindings/containers/checkpoint.go
@@ -42,7 +42,7 @@ func Checkpoint(ctx context.Context, nameOrID string, keep, leaveRunning, tcpEst
}
// Restore restores a checkpointed container to running. The container is identified by the nameOrID option. All
-// additional options are optional and allow finer control of the restore processs.
+// additional options are optional and allow finer control of the restore process.
func Restore(ctx context.Context, nameOrID string, keep, tcpEstablished, ignoreRootFS, ignoreStaticIP, ignoreStaticMAC *bool, name, importArchive *string) (*entities.RestoreReport, error) {
var report entities.RestoreReport
conn, err := bindings.GetClient(ctx)
diff --git a/pkg/bindings/containers/types.go b/pkg/bindings/containers/types.go
index 31daaf565..f288c2944 100644
--- a/pkg/bindings/containers/types.go
+++ b/pkg/bindings/containers/types.go
@@ -12,7 +12,7 @@ type LogOptions struct {
Until *string
}
-// CommitOptions describe details about the resulting commited
+// CommitOptions describe details about the resulting committed
// image as defined by repo and tag. None of these options
// are required.
type CommitOptions struct {
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index a82a9080b..9cb6a0ac5 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -394,7 +394,7 @@ func Pull(ctx context.Context, rawImage string, options entities.ImagePullOption
}
// Push is the binding for libpod's v2 endpoints for push images. Note that
-// `source` must be a refering to an image in the remote's container storage.
+// `source` must be a referring to an image in the remote's container storage.
// The destination must be a reference to a registry (i.e., of docker transport
// or be normalized to one). Other transports are rejected as they do not make
// sense in a remote context.