Skip to content

Commit

Permalink
Rename conflict to suffixDigitsModulo
Browse files Browse the repository at this point in the history
to reflect a bit better what this does.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Apr 24, 2023
1 parent 61c8187 commit 07fda81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions new.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func newBuilder(ctx context.Context, store storage.Store, options BuilderOptions
tmpName = findUnusedContainer(tmpName, containers)
}

conflict := 100
suffixDigitsModulo := 100
for {

var flags map[string]interface{}
Expand All @@ -265,8 +265,8 @@ func newBuilder(ctx context.Context, store storage.Store, options BuilderOptions
if !errors.Is(err, storage.ErrDuplicateName) || options.Container != "" {
return nil, fmt.Errorf("creating container: %w", err)
}
tmpName = fmt.Sprintf("%s-%d", name, rand.Int()%conflict)
conflict = conflict * 10
tmpName = fmt.Sprintf("%s-%d", name, rand.Int()%suffixDigitsModulo)
suffixDigitsModulo = suffixDigitsModulo * 10
}
defer func() {
if err != nil {
Expand Down

0 comments on commit 07fda81

Please sign in to comment.