Skip to content

Commit

Permalink
Merge pull request #452 from fluxcd/tidy-nits
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddeco authored Oct 11, 2023
2 parents 3c6dcd6 + 6a98d99 commit d57d462
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
4 changes: 0 additions & 4 deletions internal/controller/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions internal/policy/numerical_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package policy
import (
"math/rand"
"testing"
"time"
)

func TestNewNumerical(t *testing.T) {
Expand Down Expand Up @@ -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
}
8 changes: 4 additions & 4 deletions internal/secret/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d57d462

Please sign in to comment.