parent
f930b75b8b
commit
f9c5745c63
|
|
@ -197,7 +197,7 @@ func targetStage(stages []instructions.Stage, target string) (int, error) {
|
|||
return len(stages) - 1, nil
|
||||
}
|
||||
for i, stage := range stages {
|
||||
if stage.Name == target {
|
||||
if strings.EqualFold(stage.Name, target) {
|
||||
return i, nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,6 +261,9 @@ func Test_targetStage(t *testing.T) {
|
|||
FROM scratch AS second
|
||||
COPY --from=0 /hi /hi2
|
||||
|
||||
FROM scratch AS UPPER_CASE
|
||||
COPY --from=0 /hi /hi2
|
||||
|
||||
FROM scratch
|
||||
COPY --from=second /hi2 /hi3
|
||||
`
|
||||
|
|
@ -280,10 +283,16 @@ func Test_targetStage(t *testing.T) {
|
|||
targetIndex: 1,
|
||||
shouldErr: false,
|
||||
},
|
||||
{
|
||||
name: "test valid upper case target",
|
||||
target: "UPPER_CASE",
|
||||
targetIndex: 2,
|
||||
shouldErr: false,
|
||||
},
|
||||
{
|
||||
name: "test no target",
|
||||
target: "",
|
||||
targetIndex: 2,
|
||||
targetIndex: 3,
|
||||
shouldErr: false,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue