*: fix lint issues

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2017-08-22 12:35:19 +02:00
parent d56bf090ce
commit 8088d7a1e2
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
10 changed files with 43 additions and 41 deletions

View file

@ -77,7 +77,7 @@ func (c *ContainerServer) GetContainerData(name string, size bool) (*ContainerDa
if container.ImageID == "" {
return nil, errors.Errorf("error reading container image data: container is not based on an image")
}
imageData, err := libkpodimage.GetImageData(c.store, container.ImageID)
imageData, err := libkpodimage.GetData(c.store, container.ImageID)
if err != nil {
return nil, errors.Wrapf(err, "error reading container image data")
}

View file

@ -122,19 +122,13 @@ func matchesLabel(info *types.ImageInspectInfo, store storage.Store, label strin
// Returns true if the image was created since the filter image. Returns
// false otherwise
func matchesBeforeImage(info *types.ImageInspectInfo, name string, params *FilterParams) bool {
if info.Created.Before(params.beforeImage) {
return true
}
return false
return info.Created.Before(params.beforeImage)
}
// Returns true if the image was created since the filter image. Returns
// false otherwise
func matchesSinceImage(info *types.ImageInspectInfo, name string, params *FilterParams) bool {
if info.Created.After(params.sinceImage) {
return true
}
return false
return info.Created.After(params.sinceImage)
}
// MatchesID returns true if argID is a full or partial match for id

View file

@ -13,9 +13,9 @@ import (
"github.com/pkg/errors"
)
// ImageData handles the data used when inspecting a container
// Data handles the data used when inspecting a container
// nolint
type ImageData struct {
type Data struct {
ID string
Tags []string
Digests []string
@ -75,8 +75,8 @@ func annotations(manifest []byte, manifestType string) map[string]string {
return annotations
}
// GetImageData gets the ImageData for a container with the given name in the given store.
func GetImageData(store storage.Store, name string) (*ImageData, error) {
// GetData gets the Data for a container with the given name in the given store.
func GetData(store storage.Store, name string) (*Data, error) {
img, err := FindImage(store, name)
if err != nil {
return nil, errors.Wrapf(err, "error reading image %q", name)
@ -140,7 +140,7 @@ func GetImageData(store storage.Store, name string) (*ImageData, error) {
historyCreatedBy = config.History[len(config.History)-1].CreatedBy
}
return &ImageData{
return &Data{
ID: img.ID,
Tags: tags,
Digests: digests,

View file

@ -42,7 +42,7 @@ func (c *ContainerServer) GetLogs(container string, logChan chan string, opts Lo
t, err := tail.TailFile(logsFile, tail.Config{Follow: false, ReOpen: false, Location: seekInfo})
for line := range t.Lines {
if since, err := logSinceTime(opts.SinceTime, line.Text); err != nil || since == false {
if since, err := logSinceTime(opts.SinceTime, line.Text); err != nil || !since {
continue
}
logMessage := line.Text[secondSpaceIndex(line.Text):]