Skip to content

Commit

Permalink
use hash function to generate build job name for buildah
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsgstrabo committed Sep 3, 2024
1 parent f31c723 commit 5c57cda
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pipeline-runner/steps/build/build_acr.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"slices"

"path"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -80,11 +79,11 @@ func (step *BuildStepImplementation) buildContainerImageBuildingJobsForBuildKit(
var jobs []batchv1.Job
for envName, buildComponentImages := range pipelineInfo.BuildComponentImages {
log.Ctx(ctx).Debug().Msgf("build a build-kit jobs for the env %s", envName)
for i, componentImage := range buildComponentImages {
for _, componentImage := range buildComponentImages {
log.Ctx(ctx).Debug().Msgf("build a job for the image %s", componentImage.ImageName)
// hash := strings.ToLower(utils.RandStringStrSeed(5, fmt.Sprintf("%s-%s-%s", pipelineInfo.PipelineArguments.JobName, envName, componentImage.ComponentName)))
hash := strings.ToLower(utils.RandStringStrSeed(5, fmt.Sprintf("%s-%s-%s", pipelineInfo.PipelineArguments.JobName, envName, componentImage.ComponentName)))

job, err := buildContainerImageBuildingJob(ctx, rr, pipelineInfo, buildSecrets, strconv.Itoa(i), componentImage.Runtime, componentImage)
job, err := buildContainerImageBuildingJob(ctx, rr, pipelineInfo, buildSecrets, hash, componentImage.Runtime, componentImage)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 5c57cda

Please sign in to comment.