fix validation errors

This commit is contained in:
Alex Goodman 2019-10-07 18:28:44 -04:00
parent fcb5ec01ef
commit fd3459eb02
No known key found for this signature in database
GPG key ID: 98AF011C5C78EB7E
2 changed files with 4 additions and 1 deletions

View file

@ -57,7 +57,7 @@ func initCli() {
for _, key := range []string{"lowestEfficiency", "highestWastedBytes", "highestUserWastedPercent"} {
if err := ciConfig.BindPFlag(fmt.Sprintf("rules.%s", key), rootCmd.Flags().Lookup(key)); err != nil {
log.Fatal("Unable to bind '%s' flag:", key, err)
log.Fatalf("Unable to bind '%s' flag: %v", key, err)
}
}

View file

@ -84,6 +84,9 @@ func (r *resolver) resolveFromDockerArchive(id string) (*image.Image, error) {
defer os.Remove(path)
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
img, err := docker.NewImageArchive(ioutil.NopCloser(bufio.NewReader(file)))