mirror of https://github.com/docker/buildx.git
bake: fix validation for linking to itself
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
056cf8a7ca
commit
9bfa8603f6
|
@ -480,7 +480,7 @@ func (c Config) loadLinks(name string, t *Target, m map[string]*Target, o map[st
|
||||||
for _, v := range t.Contexts {
|
for _, v := range t.Contexts {
|
||||||
if strings.HasPrefix(v, "target:") {
|
if strings.HasPrefix(v, "target:") {
|
||||||
target := strings.TrimPrefix(v, "target:")
|
target := strings.TrimPrefix(v, "target:")
|
||||||
if target == t.Name {
|
if target == name {
|
||||||
return errors.Errorf("target %s cannot link to itself", target)
|
return errors.Errorf("target %s cannot link to itself", target)
|
||||||
}
|
}
|
||||||
for _, v := range visited {
|
for _, v := range visited {
|
||||||
|
|
Loading…
Reference in New Issue