Skip to content

Commit

Permalink
Fix handling of legacy parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaSchwarze0 authored and qu1queee committed Oct 18, 2023
1 parent ac9c985 commit 7ce6db1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/apis/build/v1beta1/buildstrategy_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ func (src *BuildStrategySpec) ConvertTo(bs *v1alpha1.BuildStrategySpec) {
}

for argIndex, arg := range buildStep.Args {
if strings.Contains(arg, "$(params.dockerfile)") {
if strings.Contains(arg, "$(params.builder-image)") {
buildStep.Args[argIndex] = strings.ReplaceAll(arg, "$(params.builder-image)", "$(build.builder.image)")
}
}

for envIndex, env := range buildStep.Env {
if strings.Contains(env.Value, "$(params.dockerfile)") {
if strings.Contains(env.Value, "$(params.builder-image)") {
buildStep.Env[envIndex].Value = strings.ReplaceAll(env.Value, "$(params.builder-image)", "$(build.builder.image)")
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@ func (src *BuildStrategySpec) ConvertFrom(bs v1alpha1.BuildStrategySpec) {
}
if strings.Contains(arg, "$(build.builder.image)") {
usesBuilderImage = true
step.Command[argIndex] = strings.ReplaceAll(arg, "$(build.builder.image)", "$(params.builder-image)")
step.Args[argIndex] = strings.ReplaceAll(arg, "$(build.builder.image)", "$(params.builder-image)")
}
}

Expand All @@ -227,7 +227,7 @@ func (src *BuildStrategySpec) ConvertFrom(bs v1alpha1.BuildStrategySpec) {
}
if strings.Contains(env.Value, "$(build.builder.image)") {
usesBuilderImage = true
step.Command[envIndex] = strings.ReplaceAll(env.Value, "$(build.builder.image)", "$(params.builder-image)")
step.Env[envIndex].Value = strings.ReplaceAll(env.Value, "$(build.builder.image)", "$(params.builder-image)")
}
}

Expand Down

0 comments on commit 7ce6db1

Please sign in to comment.