mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-21 08:33:49 +00:00
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m11s
Post / coverage (push) Failing after 37m30s
Post / images (amd64, addon-manager) (push) Failing after 7m29s
Post / images (amd64, placement) (push) Failing after 6m57s
Post / images (amd64, registration) (push) Failing after 7m5s
Post / images (amd64, registration-operator) (push) Failing after 7m5s
Post / images (amd64, work) (push) Failing after 7m2s
Post / images (arm64, addon-manager) (push) Failing after 7m18s
Post / images (arm64, placement) (push) Failing after 7m7s
Post / images (arm64, registration) (push) Failing after 7m13s
Post / images (arm64, registration-operator) (push) Failing after 7m6s
Post / images (arm64, work) (push) Failing after 7m2s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 45s
* Use base controller in sdk-go We can leverage contextual logger in base controller. Signed-off-by: Jian Qiu <jqiu@redhat.com> * Fix integration test error Signed-off-by: Jian Qiu <jqiu@redhat.com> --------- Signed-off-by: Jian Qiu <jqiu@redhat.com>
44 lines
1.4 KiB
Go
44 lines
1.4 KiB
Go
package testing
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/openshift/library-go/pkg/operator/events"
|
|
"github.com/openshift/library-go/pkg/operator/events/eventstesting"
|
|
"k8s.io/client-go/util/workqueue"
|
|
)
|
|
|
|
type FakeSyncContext struct {
|
|
spokeName string
|
|
recorder events.Recorder
|
|
queue workqueue.RateLimitingInterface
|
|
}
|
|
|
|
func (f FakeSyncContext) Queue() workqueue.RateLimitingInterface { return f.queue }
|
|
func (f FakeSyncContext) QueueKey() string { return f.spokeName }
|
|
func (f FakeSyncContext) Recorder() events.Recorder { return f.recorder }
|
|
|
|
func NewFakeSyncContext(t *testing.T, clusterName string) *FakeSyncContext {
|
|
return &FakeSyncContext{
|
|
spokeName: clusterName,
|
|
recorder: eventstesting.NewTestingEventRecorder(t),
|
|
queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),
|
|
}
|
|
}
|
|
|
|
type FakeSDKSyncContext struct {
|
|
spokeName string
|
|
recorder events.Recorder
|
|
queue workqueue.TypedRateLimitingInterface[string]
|
|
}
|
|
|
|
func (f FakeSDKSyncContext) Queue() workqueue.TypedRateLimitingInterface[string] { return f.queue }
|
|
|
|
func NewFakeSDKSyncContext(t *testing.T, clusterName string) *FakeSDKSyncContext {
|
|
return &FakeSDKSyncContext{
|
|
spokeName: clusterName,
|
|
recorder: eventstesting.NewTestingEventRecorder(t),
|
|
queue: workqueue.NewTypedRateLimitingQueue[string](workqueue.DefaultTypedControllerRateLimiter[string]()),
|
|
}
|
|
}
|