Skip to content

Commit

Permalink
Merge branch 'master' into createttr
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
Devtools committed Jan 15, 2025
2 parents b78a7d8 + 8feeb39 commit d1487d0
Show file tree
Hide file tree
Showing 11 changed files with 312 additions and 309 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.63.1
skip-pkg-cache: true
skip-build-cache: true
args: --config=./.golangci.yml --verbose
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ require (
github.com/xlab/treeprint v1.1.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down
4 changes: 2 additions & 2 deletions setup/metrics/queries/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ type BaseQuery struct {
resultType ResultType
}

func (b BaseQuery) Name() string {
func (b *BaseQuery) Name() string {
return b.name
}

func (b *BaseQuery) Execute() (model.Value, prometheus.Warnings, error) {
return b.apiClient.Query(context.TODO(), b.query, time.Now())
}

func (b BaseQuery) ResultType() string {
func (b *BaseQuery) ResultType() string {
return string(b.resultType)
}

Expand Down
10 changes: 5 additions & 5 deletions setup/terminal/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type DefaultTerminal struct {
}

// Debugf prints a message (if verbose was enabled)
func (t DefaultTerminal) Debugf(msg string, args ...interface{}) {
func (t *DefaultTerminal) Debugf(msg string, args ...interface{}) {
if !t.verbose {
return
}
Expand All @@ -66,7 +66,7 @@ func (t DefaultTerminal) Debugf(msg string, args ...interface{}) {
}

// Infof displays a message with the default color
func (t DefaultTerminal) Infof(msg string, args ...interface{}) {
func (t *DefaultTerminal) Infof(msg string, args ...interface{}) {
if msg == "" {
fmt.Fprintln(t.OutOrStdout(), "")
return
Expand All @@ -75,12 +75,12 @@ func (t DefaultTerminal) Infof(msg string, args ...interface{}) {
}

// Errorf prints a message with the red color
func (t DefaultTerminal) Errorf(err error, msg string, args ...interface{}) {
func (t *DefaultTerminal) Errorf(err error, msg string, args ...interface{}) {
color.New(color.FgRed).Fprintln(t.OutOrStdout(), fmt.Sprintf("%s: %s", fmt.Sprintf(msg, args...), err.Error())) // nolint:errcheck
}

// Fatalf prints a message with the red color and exits the program with a `1` return code
func (t DefaultTerminal) Fatalf(err error, msg string, args ...interface{}) {
func (t *DefaultTerminal) Fatalf(err error, msg string, args ...interface{}) {
defer os.Exit(1)
for _, hook := range t.fatalExitHooks {
hook()
Expand All @@ -89,7 +89,7 @@ func (t DefaultTerminal) Fatalf(err error, msg string, args ...interface{}) {
}

// PromptBoolf prints a message and waits for the user's boolean response
func (t DefaultTerminal) PromptBoolf(msg string, args ...interface{}) bool {
func (t *DefaultTerminal) PromptBoolf(msg string, args ...interface{}) bool {
fmt.Fprintln(t.OutOrStdout(), fmt.Sprintf(msg, args...))
t.InOrStdin()

Expand Down
11 changes: 7 additions & 4 deletions test/e2e/space_autocompletion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/codeready-toolchain/toolchain-e2e/testsupport/spaceprovisionerconfig"
"github.com/codeready-toolchain/toolchain-e2e/testsupport/util"
"github.com/codeready-toolchain/toolchain-e2e/testsupport/wait"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -117,9 +116,11 @@ func TestAutomaticClusterAssignment(t *testing.T) {
require.NoError(t, err)
for _, m := range toolchainStatus.Status.Members {
if memberAwait1.ClusterName == m.ClusterName {
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, memberAwait1.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount)))
//the value of this is not going beyond 100 and it won't overflow, hence its okay to ignore the overflow linter error
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, memberAwait1.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount))) //nolint:gosec
} else if memberAwait2.ClusterName == m.ClusterName {
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, memberAwait2.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount+1)))
//the value of this is not going beyond 100 and it won't overflow, hence its okay to ignore the overflow linter error
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, memberAwait2.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount+1))) //nolint:gosec
}
}

Expand All @@ -131,8 +132,10 @@ func TestAutomaticClusterAssignment(t *testing.T) {

t.Run("after both members marking as full then the new space won't be provisioned", func(t *testing.T) {
// given

for _, m := range toolchainStatus.Status.Members {
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, m.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount)))
//the value of this is not going beyond 100 and it won't overflow, hence its okay to ignore the overflow linter error
spaceprovisionerconfig.UpdateForCluster(t, hostAwait.Awaitility, m.ClusterName, testSpc.MaxNumberOfSpaces(uint(m.SpaceCount))) //nolint:gosec
}

// when
Expand Down
Loading

0 comments on commit d1487d0

Please sign in to comment.