diff --git a/internal/controller/suite_test.go b/internal/controller/suite_test.go index cbb4b5a7..cf5f9e27 100644 --- a/internal/controller/suite_test.go +++ b/internal/controller/suite_test.go @@ -60,10 +60,6 @@ var ( ctx = ctrl.SetupSignalHandler() ) -func init() { - rand.Seed(time.Now().UnixNano()) -} - func TestMain(m *testing.M) { utilruntime.Must(imagev1.AddToScheme(scheme.Scheme)) diff --git a/internal/policy/numerical_test.go b/internal/policy/numerical_test.go index 497c7900..ba6fefac 100644 --- a/internal/policy/numerical_test.go +++ b/internal/policy/numerical_test.go @@ -19,7 +19,6 @@ package policy import ( "math/rand" "testing" - "time" ) func TestNewNumerical(t *testing.T) { @@ -146,7 +145,6 @@ func TestNumerical_Latest(t *testing.T) { } func shuffle(list []string) []string { - rand.Seed(time.Now().UnixNano()) rand.Shuffle(len(list), func(i, j int) { list[i], list[j] = list[j], list[i] }) return list } diff --git a/internal/secret/secret.go b/internal/secret/secret.go index 1108e0cc..41e372a1 100644 --- a/internal/secret/secret.go +++ b/internal/secret/secret.go @@ -201,7 +201,7 @@ func parseAuthMap(config dockerConfig) (map[string]authn.AuthConfig, error) { func getURLHost(urlStr string) (string, error) { if urlStr == "http://" || urlStr == "https://" { - return "", errors.New("Empty url") + return "", errors.New("empty url") } // ensure url has https:// or http:// prefix @@ -220,9 +220,9 @@ func getURLHost(urlStr string) (string, error) { } if u.Host == "" { - return "", errors.New(fmt.Sprintf( - "Invalid registry auth key: %s. Expected an HTTPS URL (e.g. 'https://index.docker.io/v2/' or 'https://index.docker.io'), or the same without the 'https://' (e.g., 'index.docker.io/v2/' or 'index.docker.io')", - urlStr)) + return "", fmt.Errorf( + "expected an HTTPS URL instead of '%s' (e.g. 'https://index.docker.io/v2/' or 'https://index.docker.io'), or the same without 'https://' (e.g., 'index.docker.io/v2/' or 'index.docker.io')", + urlStr) } return u.Host, nil diff --git a/tests/integration/suite_test.go b/tests/integration/suite_test.go index c9b37ac0..cd84084b 100644 --- a/tests/integration/suite_test.go +++ b/tests/integration/suite_test.go @@ -112,10 +112,6 @@ type ProviderConfig struct { pushFluxTestImages pushTestImages } -func init() { - rand.Seed(time.Now().UnixNano()) -} - var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz1234567890") func randStringRunes(n int) string {