Skip to content

Commit

Permalink
Disallow ADD --checksum=<SUM> <GITSRC> <DST>
Browse files Browse the repository at this point in the history
Discussed in a comment in PR 5064

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Jun 25, 2024
1 parent 05213db commit 6b44563
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/dockerfile/dockerfile2llb/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,14 @@ func commonImageNames() []string {
}

func isHTTPSource(src string) bool {
return strings.HasPrefix(src, "http://") || strings.HasPrefix(src, "https://")
if !strings.HasPrefix(src, "http://") && !strings.HasPrefix(src, "https://") {
return false
}
// https://github.com/ORG/REPO.git is a git source, not an http source
if gitRef, gitErr := gitutil.ParseGitRef(src); gitRef != nil && gitErr == nil {
return false
}
return true
}

func isEnabledForStage(stage string, value string) bool {
Expand Down

0 comments on commit 6b44563

Please sign in to comment.