mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Update module github.com/openshift/imagebuilder to v1.2.6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
35
vendor/github.com/openshift/imagebuilder/builder.go
generated
vendored
35
vendor/github.com/openshift/imagebuilder/builder.go
generated
vendored
@ -198,6 +198,21 @@ func (stages Stages) ByName(name string) (Stage, bool) {
|
||||
return stage, true
|
||||
}
|
||||
}
|
||||
if i, err := strconv.Atoi(name); err == nil {
|
||||
return stages.ByPosition(i)
|
||||
}
|
||||
return Stage{}, false
|
||||
}
|
||||
|
||||
func (stages Stages) ByPosition(position int) (Stage, bool) {
|
||||
for _, stage := range stages {
|
||||
// stage.Position is expected to be the same as the unnamed
|
||||
// index variable for this loop, but comparing to the Position
|
||||
// field's value is easier to explain
|
||||
if stage.Position == position {
|
||||
return stage, true
|
||||
}
|
||||
}
|
||||
return Stage{}, false
|
||||
}
|
||||
|
||||
@ -211,6 +226,16 @@ func (stages Stages) ByTarget(target string) (Stages, bool) {
|
||||
return stages[i : i+1], true
|
||||
}
|
||||
}
|
||||
if position, err := strconv.Atoi(target); err == nil {
|
||||
for i, stage := range stages {
|
||||
// stage.Position is expected to be the same as the unnamed
|
||||
// index variable for this loop, but comparing to the Position
|
||||
// field's value is easier to explain
|
||||
if stage.Position == position {
|
||||
return stages[i : i+1], true
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
@ -224,6 +249,16 @@ func (stages Stages) ThroughTarget(target string) (Stages, bool) {
|
||||
return stages[0 : i+1], true
|
||||
}
|
||||
}
|
||||
if position, err := strconv.Atoi(target); err == nil {
|
||||
for i, stage := range stages {
|
||||
// stage.Position is expected to be the same as the unnamed
|
||||
// index variable for this loop, but comparing to the Position
|
||||
// field's value is easier to explain
|
||||
if stage.Position == position {
|
||||
return stages[0 : i+1], true
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user