Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions request/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,13 @@ func (b *requestPatchBuilder) Build(cli rest.Interface) Requester {
if b.namespace != "" {
comps = append(comps, "namespaces", b.namespace)
}
// Generate random suffix based on keySpaceSize
randomInt, _ := rand.Int(rand.Reader, big.NewInt(int64(b.keySpaceSize)))
suffix := randomInt.Int64()

// Create final resource name: name-{suffix}
finalName := fmt.Sprintf("%s-%d", b.name, suffix)
finalName := b.name

if b.keySpaceSize > 0 {
randomInt, _ := rand.Int(rand.Reader, big.NewInt(int64(b.keySpaceSize)))
finalName = fmt.Sprintf("%s-%d", b.name, randomInt.Int64())
}
comps = append(comps, b.resource, finalName)

return &DiscardRequester{
Expand Down
Loading