diff --git a/request/random.go b/request/random.go index 32012e0..d8f5191 100644 --- a/request/random.go +++ b/request/random.go @@ -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{