Merge pull request #12425 from tnk4on/remote-build-eval-containerfile

Fixed the containerfile not found during remote build
This commit is contained in:
OpenShift Merge Robot
2021-12-02 10:30:48 +01:00
committed by GitHub

View File

@ -346,6 +346,11 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
}
c = tmpFile.Name()
}
cfDir := filepath.Dir(c)
if absDir, err := filepath.EvalSymlinks(cfDir); err == nil {
name := filepath.ToSlash(strings.TrimPrefix(c, cfDir+string(filepath.Separator)))
c = filepath.Join(absDir, name)
}
containerfile, err := filepath.Abs(c)
if err != nil {
logrus.Errorf("Cannot find absolute path of %v: %v", c, err)