package generator

import (
	"strconv"

	"github.com/adam-hanna/randomstrings"
	"github.com/onsi/ginkgo/config"
)

func randomName() string {
	str, err := randomstrings.GenerateRandomString(20)
	if err != nil {
		panic(err)
	}

	return str
}

func PrefixedRandomName(prefixName, resourceName string) string {
	return prefixName + "-" + strconv.Itoa(config.GinkgoConfig.ParallelNode) + "-" + resourceName + "-" + randomName()
}

package generator

import (
	"strconv"

	uuid "github.com/nu7hatch/gouuid"
	"github.com/onsi/ginkgo/config"
)

func randomName() string {
	guid, err := uuid.NewV4()
	if err != nil {
		panic(err)
	}

	return guid.String()
}

func PrefixedRandomName(prefixName, resourceName string) string {
	return prefixName + "-" + strconv.Itoa(config.GinkgoConfig.ParallelNode) + "-" + resourceName + "-" + randomName()
}

Revert "Use a better random string generator"
Revert "Use a better random string generator"

This reverts commit d7716de8d098ea2832a67fda27fda34556da9b93.

Signed-off-by: Alvaro Perez-Shirley <d5000c5ec3097613a224bab22ba8fc2a47fdc5ca@pivotal.io>
