Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ require (
github.com/go-jose/go-jose/v4 v4.1.4
github.com/go-logr/logr v1.4.3
github.com/golang/glog v1.2.5
github.com/golang/mock v1.7.0-rc.1
github.com/google/go-cmp v0.7.0
github.com/google/go-github/v57 v57.0.0
github.com/google/uuid v1.6.0
Expand All @@ -50,6 +49,7 @@ require (
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
github.com/tidwall/gjson v1.18.0
go.uber.org/mock v0.6.0
golang.org/x/mod v0.36.0
golang.org/x/oauth2 v0.36.0
golang.org/x/time v0.15.0
Expand Down
9 changes: 2 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=
github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down Expand Up @@ -630,7 +628,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss=
go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
Expand Down Expand Up @@ -674,6 +671,8 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
Expand Down Expand Up @@ -736,7 +735,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
Expand Down Expand Up @@ -783,7 +781,6 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
Expand Down Expand Up @@ -876,7 +873,6 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down Expand Up @@ -985,7 +981,6 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
Expand Down
2 changes: 1 addition & 1 deletion pkg/aws/actuator/actuator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"strings"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

configv1 "github.com/openshift/api/config/v1"
operatorv1 "github.com/openshift/api/operator/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/aws/mock/client_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/azure/actuator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"github.com/openshift/cloud-credential-operator/pkg/cmd/provisioning"
schemeutils "github.com/openshift/cloud-credential-operator/pkg/util"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

for f in pkg/azure/actuator_test.go pkg/cmd/provisioning/gcp/create_service_accounts_test.go pkg/operator/secretannotator/gcp/reconciler_test.go; do
  echo "===== $f ====="
  nl -ba "$f" | sed -n '1,260p'
  echo
done

Repository: openshift/cloud-credential-operator

Length of output: 252


🌐 Web query:

go.uber.org/mock gomock NewController testing.T auto cleanup Finish idempotent documentation

💡 Result:

In GoMock (including the version at go.uber.org/mock), the gomock.NewController(t) function automatically handles cleanup for you when provided with a *testing.T, starting from Go 1.14 [1][2][3]. Key details regarding this functionality: Automatic Cleanup: When you pass a *testing.T (or any type implementing the Cleanup method) to NewController, the library registers a cleanup function using t.Cleanup [1][2]. This function triggers ctrl.Finish automatically at the end of the test, removing the need to manually call defer ctrl.Finish [1][2][3]. Idempotency and Multiple Calls: The Finish method itself is not inherently idempotent [1][2]. Internally, it uses a flag (ctrl.finished) to track state [1][2]. If Finish is called more than once, it will trigger a fatal error (via T.Fatalf) to notify you of the misuse, unless it is being handled by the automatic cleanup mechanism which manages the state safely [1][2]. Best Practice: Because of the automatic cleanup provided by Go 1.14+, calling ctrl.Finish manually is now considered unnecessary and is often marked as deprecated [4]. You should rely on the automatic invocation handled by the controller via t.Cleanup to ensure test expectations are verified correctly without manual intervention [3].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
files = [
    "pkg/azure/actuator_test.go",
    "pkg/cmd/provisioning/gcp/create_service_accounts_test.go",
    "pkg/operator/secretannotator/gcp/reconciler_test.go",
]
for p in files:
    text = Path(p).read_text()
    for needle in ["NewController(", ".Finish()", "defer ctrl.Finish()", "gomock.NewController("]:
        if needle in text:
            print(f"== {p} : {needle} ==")
            for i, line in enumerate(text.splitlines(), 1):
                if needle in line:
                    print(f"{i}: {line}")
            print()
PY

Repository: openshift/cloud-credential-operator

Length of output: 1265


🌐 Web query:

go.uber.org/mock gomock NewController finish cleanup t.Cleanup documentation

💡 Result:

In Gomock, specifically when using go.uber.org/mock/gomock, you generally do not need to explicitly call ctrl.Finish() if you are using Go 1.14 or later and passing *testing.T (or any testing.TB implementation that supports Cleanup) to gomock.NewController(t) [1][2][3]. When you provide a *testing.T to NewController, the library checks if the provided reporter implements a Cleanup method [1][4]. If it does, gomock registers its internal finish method with t.Cleanup() [1]. This ensures that Finish()—which validates that all expected mock calls occurred—is automatically executed when the test completes, regardless of whether the test passes or fails (or panics) [1][2]. If you are using an older version of Go (pre-1.14) or a test reporter that does not support Cleanup, you must continue to manually call defer ctrl.Finish() to ensure your mock expectations are verified [2][5]. Key points to remember: 1. Automatic Cleanup: Only occurs if t passed to NewController supports Cleanup (added in Go 1.14) [1][2]. 2. Idempotency: ctrl.Finish() is designed to be idempotent; calling it multiple times will not cause issues, as the controller tracks whether it has already finished [1][4]. 3. Best Practice: While automatic cleanup reduces boilerplate, deferring Finish() remains a safe and compatible pattern across all versions of Go and Gomock [2][6].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== go.mod gomock dependency =="
grep -nE 'go\.uber\.org/mock|golang\.org/x' go.mod || true
echo

echo "== Go env module cache =="
go env GOMODCACHE GOPATH GOROOT | sed 's/^/  /'
echo

modcache="$(go env GOMODCACHE)"
echo "== Cached go.uber.org/mock files =="
fd -a 'controller.go' "$modcache" 2>/dev/null | rg 'go\.uber\.org/mock/.*/gomock/controller\.go$' || true

Repository: openshift/cloud-credential-operator

Length of output: 822


🌐 Web query:

site:github.com/go.uber.org/mock gomock/controller.go Finish idempotent t.Cleanup source

💡 Result:

In go.uber.org/mock/gomock, Controller.Finish() is not idempotent and should only be called once. If you pass *testing.T to NewController, it registers a t.Cleanup that calls Finish() automatically after the test and subtests complete, so you usually should not call ctrl.Finish() yourself. (pkg.go.dev)

If you want, I can also point you to the exact controller.go logic in the repo.

Citations:


🌐 Web query:

"go.uber.org/mock/gomock" Finish idempotent Cleanup source controller.go

💡 Result:

The query appears to conflate two distinct concepts in Go development: the gomock library (now maintained as go.uber.org/mock) and Kubernetes controller patterns for idempotent cleanup. 1. gomock and Controller.Finish: In the gomock library (go.uber.org/mock), the Controller.Finish method is used to verify that all expected method calls occurred [1][2]. Historically, it was not idempotent and required explicit calling [2][3]. However, since Go 1.14, if you pass a *testing.T to gomock.NewController(t), the library automatically registers a cleanup function using t.Cleanup to call Finish for you [2][3]. This removes the need for manual invocation in standard tests [3]. 2. Kubernetes Controller Idempotent Cleanup: In the context of Kubernetes controllers (e.g., source-controller.go, often built with controller-runtime), "idempotent cleanup" typically refers to the implementation of Finalizers [4][5]. When a resource is marked for deletion (DeletionTimestamp is non-zero), the controller must perform cleanup tasks (like removing external cloud resources) in an idempotent manner so that the logic can safely run multiple times without side effects [4]. Once the cleanup is confirmed successful, the finalizer is removed from the resource to allow Kubernetes to complete the deletion [4][5]. The phrase "Finish idempotent Cleanup source controller.go" likely combines a search for gomock's Finish mechanism with the common requirement to write idempotent cleanup logic within a Kubernetes source-controller.

Citations:


🌐 Web query:

go.uber.org/mock README Finish defer ctrl.Finish safe double call t.Cleanup

💡 Result:

When using go.uber.org/mock (or the original golang/mock), calling ctrl.Finish() is used to verify that all expectations set on a mock controller have been met [1][2]. For Go 1.14 and later, when you pass a *testing.T (or any testing.TB) to gomock.NewController(t), the library automatically registers a t.Cleanup() function to call ctrl.Finish() [1][3][4]. Because Finish() is designed to be safe to call multiple times, this automatic cleanup eliminates the need for an explicit defer ctrl.Finish() in your test code [1][3][4]. If you call ctrl.Finish() manually and it is also called by t.Cleanup, the implementation handles the double call safely [1][3][4]. While some earlier development efforts in uber-go/mock attempted to mark ctrl.Finish() as deprecated to encourage this automatic behavior, community feedback noted that explicit calls are still necessary for certain specific test frameworks, so the function remains available for use [5][6].

Citations:


🌐 Web query:

go.uber.org/mock v0.6.0 controller.go Finish called multiple times safe idempotent

💡 Result:

The Controller.Finish method in go.uber.org/mock v0.6.0 is not idempotent [1]. If it is called more than once, the library will trigger a failure [2][1]. Specifically, the implementation in controller.go checks the internal finished state; if Finish has already been called, it uses the testing reporter to call t.Fatalf, which aborts the test with the error message: "Controller.Finish was called more than once. It has to be called exactly once." [2] To avoid this, you should rely on the automatic cleanup provided by the library [1]. When you pass a *testing.T (or a compatible TestReporter) into gomock.NewController, the controller registers a cleanup function that automatically invokes Finish when the test and its subtests complete [3][1]. Consequently, explicit calls to Finish are unnecessary in modern Go tests [3][1].

Citations:


🌐 Web query:

site:github.com/uber-go/mock controller.go "finish" "Cleanup" "finished"

💡 Result:

The phrase "Cleanup finished" does not appear to be a standard or recognizable log message associated with controller.go in prominent Go libraries like gomock or Kubernetes controller-runtime. In the context of the uber-go/mock (gomock) library, there is a prominent function named Controller.Finish defined in controller.go [1]. This function is used in testing to verify that all expected mock calls have been satisfied [2][3]. Regarding "Cleanup": - Modern Go (since 1.14) provides t.Cleanup in the testing package, which allows tests to register cleanup functions that run automatically when the test finishes [2]. - In gomock, the Controller.Finish method was marked as deprecated because it is often unnecessary to call manually when t.Cleanup is used to automatically handle cleanup, although it remains available for specific test framework requirements [2][3]. If you are seeing a specific log message "Cleanup finished" in a file named controller.go, it is likely custom logging code within your specific project or a library not standard to common Go infrastructure, rather than a built-in message from standard Go mocking or controller libraries. You should check the source code for that string to identify which logger or function is outputting it.

Citations:


Remove the explicit Finish() calls gomock.NewController(t) already registers cleanup via t.Cleanup, so these extra finalizers can trip Controller.Finish was called more than once in these tests.

  • pkg/azure/actuator_test.go#L556-L557, pkg/azure/actuator_test.go#L682-L702
  • pkg/cmd/provisioning/gcp/create_service_accounts_test.go#L190-L191
  • pkg/operator/secretannotator/gcp/reconciler_test.go#L218-L219
📍 Affects 3 files
  • pkg/azure/actuator_test.go#L34-L34 (this comment)
  • pkg/cmd/provisioning/gcp/create_service_accounts_test.go#L12-L12
  • pkg/operator/secretannotator/gcp/reconciler_test.go#L25-L25
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/azure/actuator_test.go` at line 34, Remove all explicit
gomock.Controller.Finish calls from the tests using gomock.NewController(t),
including pkg/azure/actuator_test.go lines 556-557 and 682-702,
pkg/cmd/provisioning/gcp/create_service_accounts_test.go lines 190-191, and
pkg/operator/secretannotator/gcp/reconciler_test.go lines 218-219; rely on the
controller’s t.Cleanup registration and leave the test setup and assertions
unchanged.

Source: MCP tools


"github.com/microsoftgraph/msgraph-sdk-go/models"

Expand Down
2 changes: 1 addition & 1 deletion pkg/azure/mock/client_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/cmd/provisioning/aws/create-iam-roles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"path/filepath"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

awssdk "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/iam"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/provisioning/aws/create_identity_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"path/filepath"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

awssdk "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/cloudfront"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/provisioning/azure/create_oidc_issuer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
"github.com/golang/mock/gomock"
azureclients "github.com/openshift/cloud-credential-operator/pkg/azure"
mockazure "github.com/openshift/cloud-credential-operator/pkg/azure/mock"
"github.com/openshift/cloud-credential-operator/pkg/cmd/provisioning"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/provisioning/gcp/create_service_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"path/filepath"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"google.golang.org/api/cloudresourcemanager/v1"
"google.golang.org/api/iam/v1"
iamadminpb "google.golang.org/genproto/googleapis/iam/admin/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"google.golang.org/api/googleapi"
"google.golang.org/api/iam/v1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

iamCloud "cloud.google.com/go/iam"
"cloud.google.com/go/storage"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"google.golang.org/api/googleapi"
"google.golang.org/api/iam/v1"
pb "google.golang.org/genproto/googleapis/iam/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/provisioning/ibmcloud/create_service_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"strconv"
"testing"

"github.com/golang/mock/gomock"
"github.com/google/uuid"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/iamidentityv1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/provisioning/ibmcloud/delete_service_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"os"
"testing"

"github.com/golang/mock/gomock"
"github.com/google/uuid"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/iamidentityv1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/provisioning/ibmcloud/refresh-keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gcp/mock/client_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/ibmcloud/mock/client_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/operator/cleanup/cleanup_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"fmt"
"testing"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/microsoftgraph/msgraph-sdk-go/models"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"google.golang.org/api/cloudresourcemanager/v1"
iamadminpb "google.golang.org/genproto/googleapis/iam/admin/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

awssdk "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/iam"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/credentialsrequest/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
admissionv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/secretannotator/aws/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/secretannotator/gcp/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/secretannotator/vsphere/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/utils/gcp/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"google.golang.org/api/cloudresourcemanager/v1"

Expand Down Expand Up @@ -133,7 +133,7 @@ func TestCheckPermissionsAgainstPermissionListChunking(t *testing.T) {
testablePerms.lastUpdated = time.Now()
testablePerms.permSet = sets.NewString(permissionsList...)

mockCallList := []*gomock.Call{}
mockCallList := []any{}

for _, chunk := range test.chunks {
permRequest := &cloudresourcemanager.TestIamPermissionsRequest{
Expand Down
Loading