From 2ac731db0bc1b6a60cbd9bed8433af35ccd81701 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Fri, 8 Oct 2021 19:40:03 -0500 Subject: [PATCH] Added some additional logging and exposed parsed components --- internal/parser/dockerfile/dockerfile.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/parser/dockerfile/dockerfile.go b/internal/parser/dockerfile/dockerfile.go index 455aece..524a3ea 100644 --- a/internal/parser/dockerfile/dockerfile.go +++ b/internal/parser/dockerfile/dockerfile.go @@ -141,10 +141,14 @@ func parseRepositoriesFromDockerfileStage(dockerfileStage buildkitDockerfileInst log.Tracef("Parsing RunCommand \"%s\" for repositories", runCommand.CmdLine) - _, err := typedCommandParser.GetRepositories(runCommand.CmdLine[0]) + parsedRepositories, err := typedCommandParser.GetRepositories(runCommand.CmdLine[0]) if err != nil { + log.Fatalf("Unexpected error while parsing repositories: %s", err) return nil, err } + for _, parsedRepository := range parsedRepositories { + repositories = append(repositories, parsedRepository) + } } } @@ -162,10 +166,14 @@ func parsePackagesFromDockerfileStage(dockerfileStage buildkitDockerfileInstruct log.Tracef("Parsing RunCommand \"%s\" for packages", runCommand.CmdLine) - _, err := typedCommandParser.GetPinnedPackages(runCommand.CmdLine[0]) + parsedPinnedPackages, err := typedCommandParser.GetPinnedPackages(runCommand.CmdLine[0]) if err != nil { + log.Fatalf("Unexpected error while parsing pinned packages: %s", err) return nil, err } + for _, parsedPinnedPackage := range parsedPinnedPackages { + packages = append(packages, parsedPinnedPackage) + } } }