Skip to content

Commit

Permalink
Merge pull request #2700 from tonistiigi/fix-link-itself
Browse files Browse the repository at this point in the history
bake: fix validation for linking to itself
  • Loading branch information
crazy-max committed Sep 17, 2024
2 parents 056cf8a + 9bfa860 commit 8d3d32e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bake/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ func (c Config) loadLinks(name string, t *Target, m map[string]*Target, o map[st
for _, v := range t.Contexts {
if strings.HasPrefix(v, "target:") {
target := strings.TrimPrefix(v, "target:")
if target == t.Name {
if target == name {
return errors.Errorf("target %s cannot link to itself", target)
}
for _, v := range visited {
Expand Down

0 comments on commit 8d3d32e

Please sign in to comment.