Skip to content

Commit

Permalink
fix: fix multi-module issue for skaffold lint dockerfile support (#6831)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-prindle authored Nov 11, 2021
1 parent b676799 commit 2cd1bdb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/skaffold/lint/dockerfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
)

// for testing
// var getDockerDependencies = docker.GetDependencies
var getDockerDependenciesForEachFromTo = docker.GetDependenciesByDockerCopyFromTo
var dockerfileRules = &dockerfileLintRules

Expand Down Expand Up @@ -128,7 +127,12 @@ func GetDockerfilesLintResults(ctx context.Context, opts Options, dockerCfg dock
for _, c := range cfgs {
for _, a := range c.Build.Artifacts {
if a.DockerArtifact != nil {
ws := filepath.Join(workdir, a.Workspace)
// TODO(aaron-prindle) HACK - multi-module configs use abs path for a.Workspace vs single module which has rel path
// see if there is a built-in/better way of handling this. This is currently working for multi-module
ws := a.Workspace
if !filepath.IsAbs(ws) {
ws = filepath.Join(workdir, a.Workspace)
}
fp := filepath.Join(ws, a.DockerArtifact.DockerfilePath)
if _, ok := seen[fp]; ok {
continue
Expand Down

0 comments on commit 2cd1bdb

Please sign in to comment.