fix: prevent panic when image name and stage alias are the same (#3245)

This commit is contained in:
Mick van Gelderen 2024-07-10 18:34:45 +02:00 committed by GitHub
parent 3aa02e0d47
commit e1089414cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ func baseImageIndex(currentStage int, stages []instructions.Stage) int {
currentStageBaseName := strings.ToLower(stages[currentStage].BaseName)
for i, stage := range stages {
if i > currentStage {
if i >= currentStage {
break
}
if stage.Name == currentStageBaseName {