Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
P3GLEG committed Jun 7, 2018
1 parent 16861dc commit 89c080f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ func analyze(cli *client.Client, imageID string) {
out, err := cli.ImagePull(context.Background(), imageID, types.ImagePullOptions{})
if err != nil {
color.Red(err.Error())
color.Yellow("Use the -sV flag to change your client version. ./WhaleTail -sV=1.36 %s", imageID)
if strings.Contains(err.Error(),"Maximum supported API version is"){
color.Yellow("Use the -sV flag to change your client version. ./WhaleTail -sV=1.36 %s", imageID)
}
return
}
defer out.Close()
Expand Down Expand Up @@ -340,11 +342,16 @@ func printResults(layers []dockerHist) {
color.White("")
}


func cleanString(str string) string {
s := strings.Join(strings.Fields(str), " ")
s = strings.Replace(s, "&&", " \\\n&&", -1)
s = strings.Replace(s, "/bin/sh -c ", "", -1)
s = strings.Replace(s, "#(nop) ", "", -1)
s = strings.Replace(s, "&&", " \\\n\t&&", -1)
if !strings.HasPrefix(s, "/bin/sh -c #(nop)"){
s = strings.Replace(s, "/bin/sh -c ", "RUN ", -1)
} else {
s = strings.Replace(s, "/bin/sh -c ", "", -1)
s = strings.Replace(s, "#(nop) ", "", -1)
}
return s
}

Expand Down

0 comments on commit 89c080f

Please sign in to comment.