Skip to content

Commit d57d462

Browse files
authored
Merge pull request #452 from fluxcd/tidy-nits
2 parents 3c6dcd6 + 6a98d99 commit d57d462

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

internal/controller/suite_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ var (
6060
ctx = ctrl.SetupSignalHandler()
6161
)
6262

63-
func init() {
64-
rand.Seed(time.Now().UnixNano())
65-
}
66-
6763
func TestMain(m *testing.M) {
6864

6965
utilruntime.Must(imagev1.AddToScheme(scheme.Scheme))

internal/policy/numerical_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package policy
1919
import (
2020
"math/rand"
2121
"testing"
22-
"time"
2322
)
2423

2524
func TestNewNumerical(t *testing.T) {
@@ -146,7 +145,6 @@ func TestNumerical_Latest(t *testing.T) {
146145
}
147146

148147
func shuffle(list []string) []string {
149-
rand.Seed(time.Now().UnixNano())
150148
rand.Shuffle(len(list), func(i, j int) { list[i], list[j] = list[j], list[i] })
151149
return list
152150
}

internal/secret/secret.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func parseAuthMap(config dockerConfig) (map[string]authn.AuthConfig, error) {
201201

202202
func getURLHost(urlStr string) (string, error) {
203203
if urlStr == "http://" || urlStr == "https://" {
204-
return "", errors.New("Empty url")
204+
return "", errors.New("empty url")
205205
}
206206

207207
// ensure url has https:// or http:// prefix
@@ -220,9 +220,9 @@ func getURLHost(urlStr string) (string, error) {
220220
}
221221

222222
if u.Host == "" {
223-
return "", errors.New(fmt.Sprintf(
224-
"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')",
225-
urlStr))
223+
return "", fmt.Errorf(
224+
"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')",
225+
urlStr)
226226
}
227227

228228
return u.Host, nil

tests/integration/suite_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ type ProviderConfig struct {
112112
pushFluxTestImages pushTestImages
113113
}
114114

115-
func init() {
116-
rand.Seed(time.Now().UnixNano())
117-
}
118-
119115
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz1234567890")
120116

121117
func randStringRunes(n int) string {

0 commit comments

Comments
 (0)