diff --git a/pkg/addon/controllers/addonowner/controller_test.go b/pkg/addon/controllers/addonowner/controller_test.go index 1e76652d5..c6c74904b 100644 --- a/pkg/addon/controllers/addonowner/controller_test.go +++ b/pkg/addon/controllers/addonowner/controller_test.go @@ -14,7 +14,7 @@ import ( addonapiv1alpha1 "open-cluster-management.io/api/addon/v1alpha1" fakeaddon "open-cluster-management.io/api/client/addon/clientset/versioned/fake" addoninformers "open-cluster-management.io/api/client/addon/informers/externalversions" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" ) func newClusterManagementOwner(name string) metav1.OwnerReference { diff --git a/pkg/addon/controllers/addonprogressing/controller_test.go b/pkg/addon/controllers/addonprogressing/controller_test.go index fc65be4a0..21e5b842b 100644 --- a/pkg/addon/controllers/addonprogressing/controller_test.go +++ b/pkg/addon/controllers/addonprogressing/controller_test.go @@ -21,7 +21,7 @@ import ( fakework "open-cluster-management.io/api/client/work/clientset/versioned/fake" workinformers "open-cluster-management.io/api/client/work/informers/externalversions" workapiv1 "open-cluster-management.io/api/work/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" ) func TestReconcile(t *testing.T) { diff --git a/pkg/addon/controllers/addontemplate/controller_test.go b/pkg/addon/controllers/addontemplate/controller_test.go index bc9462f30..8279fb551 100644 --- a/pkg/addon/controllers/addontemplate/controller_test.go +++ b/pkg/addon/controllers/addontemplate/controller_test.go @@ -23,7 +23,7 @@ import ( clusterv1informers "open-cluster-management.io/api/client/cluster/informers/externalversions" fakework "open-cluster-management.io/api/client/work/clientset/versioned/fake" workinformers "open-cluster-management.io/api/client/work/informers/externalversions" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" ) func TestReconcile(t *testing.T) { diff --git a/pkg/addon/controllers/managementaddoninstallprogression/controller_test.go b/pkg/addon/controllers/managementaddoninstallprogression/controller_test.go index 0e4d1c654..0bd164bec 100644 --- a/pkg/addon/controllers/managementaddoninstallprogression/controller_test.go +++ b/pkg/addon/controllers/managementaddoninstallprogression/controller_test.go @@ -15,7 +15,7 @@ import ( addonapiv1alpha1 "open-cluster-management.io/api/addon/v1alpha1" fakeaddon "open-cluster-management.io/api/client/addon/clientset/versioned/fake" addoninformers "open-cluster-management.io/api/client/addon/informers/externalversions" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" ) func TestReconcile(t *testing.T) { diff --git a/vendor/open-cluster-management.io/sdk-go/pkg/apply/interface.go b/pkg/common/apply/interface.go similarity index 100% rename from vendor/open-cluster-management.io/sdk-go/pkg/apply/interface.go rename to pkg/common/apply/interface.go diff --git a/vendor/open-cluster-management.io/sdk-go/pkg/apply/rbac.go b/pkg/common/apply/rbac.go similarity index 100% rename from vendor/open-cluster-management.io/sdk-go/pkg/apply/rbac.go rename to pkg/common/apply/rbac.go diff --git a/pkg/common/apply/rbac_test.go b/pkg/common/apply/rbac_test.go new file mode 100644 index 000000000..9cbe41fe3 --- /dev/null +++ b/pkg/common/apply/rbac_test.go @@ -0,0 +1,422 @@ +package apply + +import ( + "context" + "testing" + "time" + + "github.com/openshift/library-go/pkg/operator/events/eventstesting" + "github.com/openshift/library-go/pkg/operator/resource/resourceread" + rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/client-go/informers" + kubefake "k8s.io/client-go/kubernetes/fake" + clienttesting "k8s.io/client-go/testing" + + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" +) + +func TestPermissionApply(t *testing.T) { + tc := []struct { + name string + manifest string + existingManifest string + // filtered indicates if the existing manifest is in the informer cache or not. For example, + // it may not match the expected label/field selector of the informer factory. + filtered bool + validateAction func(t *testing.T, actions []clienttesting.Action) + }{ + { + name: "create clusterrole", + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: test +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "create") + }, + }, + { + name: "upate clusterrole", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: test +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch", "create"] +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: test +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "update") + }, + }, + { + name: "upate clusterrole with no cache", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: test +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch", "create"] +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: test +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + filtered: true, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "create", "get", "update") + }, + }, + { + name: "compare and no update clusterrole", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: test +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: test +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + validateAction: testingcommon.AssertNoActions, + }, + { + name: "create clusterrolebinding", + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: test +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test +subjects: + - kind: ServiceAccount + name: test + namespace: test +`, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "create") + }, + }, + { + name: "update clusterrolebinding", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: test +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test1 +subjects: + - kind: ServiceAccount + name: test + namespace: test1 +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: test +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test +subjects: + - kind: ServiceAccount + name: test + namespace: test +`, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "update") + }, + }, + { + name: "no update clusterrolebinding", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: test +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test +subjects: + - kind: ServiceAccount + name: test + namespace: test +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: test +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test +subjects: + - kind: ServiceAccount + name: test + namespace: test +`, + validateAction: testingcommon.AssertNoActions, + }, + { + name: "create role", + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: test + namespace: default +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "create") + }, + }, + { + name: "upate role", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: test + namespace: default +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch", "create"] +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: test + namespace: default +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "update") + }, + }, + { + name: "compare and no update clusterrole", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: test + namespace: default +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: test + namespace: default +rules: +- apiGroups: [""] + resources: ["configmaps", "events"] + verbs: ["get", "list", "watch"] +`, + validateAction: testingcommon.AssertNoActions, + }, + { + name: "create rolebinding", + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: test + namespace: default +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: test +subjects: + - kind: ServiceAccount + name: test + namespace: test +`, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "create") + }, + }, + { + name: "update rolebinding", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: test + namespace: default +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test1 +subjects: + - kind: ServiceAccount + name: test + namespace: test1 +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: test + namespace: default +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test +subjects: + - kind: ServiceAccount + name: test + namespace: test +`, + validateAction: func(t *testing.T, actions []clienttesting.Action) { + testingcommon.AssertActions(t, actions, "update") + }, + }, + { + name: "no update clusterrolebinding", + existingManifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: test + namespace: default +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test +subjects: + - kind: ServiceAccount + name: test + namespace: test +`, + manifest: ` +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: test + namespace: default +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test +subjects: + - kind: ServiceAccount + name: test + namespace: test +`, + validateAction: testingcommon.AssertNoActions, + }, + } + + for _, c := range tc { + t.Run(c.name, func(t *testing.T) { + var kubeClient *kubefake.Clientset + var informerFactory informers.SharedInformerFactory + if len(c.existingManifest) > 0 { + o, err := resourceread.ReadGenericWithUnstructured([]byte(c.existingManifest)) + if err != nil { + t.Fatal(err) + } + kubeClient = kubefake.NewSimpleClientset(o) + informerFactory = informers.NewSharedInformerFactory(kubeClient, 3*time.Minute) + if !c.filtered { + switch t := o.(type) { + case *rbacv1.ClusterRole: + err = informerFactory.Rbac().V1().ClusterRoles().Informer().GetStore().Add(t) + case *rbacv1.ClusterRoleBinding: + err = informerFactory.Rbac().V1().ClusterRoleBindings().Informer().GetStore().Add(t) + case *rbacv1.Role: + err = informerFactory.Rbac().V1().Roles().Informer().GetStore().Add(t) + case *rbacv1.RoleBinding: + err = informerFactory.Rbac().V1().RoleBindings().Informer().GetStore().Add(t) + } + if err != nil { + t.Fatal(err) + } + } + } else { + kubeClient = kubefake.NewSimpleClientset() + informerFactory = informers.NewSharedInformerFactory(kubeClient, 3*time.Minute) + } + + applier := NewPermissionApplier( + kubeClient, + informerFactory.Rbac().V1().Roles().Lister(), + informerFactory.Rbac().V1().RoleBindings().Lister(), + informerFactory.Rbac().V1().ClusterRoles().Lister(), + informerFactory.Rbac().V1().ClusterRoleBindings().Lister(), + ) + results := applier.Apply(context.TODO(), eventstesting.NewTestingEventRecorder(t), + func(name string) ([]byte, error) { + return []byte(c.manifest), nil + }, "test") + + for _, r := range results { + if r.Error != nil { + t.Error(r.Error) + } + } + c.validateAction(t, kubeClient.Actions()) + }) + } +} diff --git a/vendor/open-cluster-management.io/sdk-go/pkg/testing/assertion.go b/pkg/common/testing/assertion.go similarity index 91% rename from vendor/open-cluster-management.io/sdk-go/pkg/testing/assertion.go rename to pkg/common/testing/assertion.go index 0258e4c3e..6aca9f9f5 100644 --- a/vendor/open-cluster-management.io/sdk-go/pkg/testing/assertion.go +++ b/pkg/common/testing/assertion.go @@ -5,12 +5,9 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/diff" clienttesting "k8s.io/client-go/testing" ) @@ -169,15 +166,3 @@ func AssertEqualNameNamespace(t *testing.T, actualName, actualNamespace, name, n t.Errorf("Namespace of the object does not match, expected %s, actual %s", namespace, actualNamespace) } } - -// AssertFinalizers asserts the given runtime object has the expected finalizers -func AssertFinalizers(t *testing.T, obj runtime.Object, finalizers []string) { - accessor, _ := meta.Accessor(obj) - actual := accessor.GetFinalizers() - if len(actual) == 0 && len(finalizers) == 0 { - return - } - if !equality.Semantic.DeepEqual(actual, finalizers) { - t.Fatal(diff.ObjectDiff(actual, finalizers)) - } -} diff --git a/vendor/open-cluster-management.io/sdk-go/pkg/testing/fake_sync_context.go b/pkg/common/testing/fake_sync_context.go similarity index 100% rename from vendor/open-cluster-management.io/sdk-go/pkg/testing/fake_sync_context.go rename to pkg/common/testing/fake_sync_context.go diff --git a/pkg/operator/operators/clustermanager/controllers/certrotationcontroller/certrotation_controller_test.go b/pkg/operator/operators/clustermanager/controllers/certrotationcontroller/certrotation_controller_test.go index 5a78b0e9e..d74f3e7da 100644 --- a/pkg/operator/operators/clustermanager/controllers/certrotationcontroller/certrotation_controller_test.go +++ b/pkg/operator/operators/clustermanager/controllers/certrotationcontroller/certrotation_controller_test.go @@ -20,7 +20,7 @@ import ( fakeoperatorclient "open-cluster-management.io/api/client/operator/clientset/versioned/fake" operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions" operatorapiv1 "open-cluster-management.io/api/operator/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/ocm/pkg/operator/helpers" ) diff --git a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller_test.go b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller_test.go index 601ef01fe..3dda964f8 100644 --- a/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller_test.go +++ b/pkg/operator/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller_test.go @@ -29,8 +29,8 @@ import ( fakeoperatorlient "open-cluster-management.io/api/client/operator/clientset/versioned/fake" operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions" operatorapiv1 "open-cluster-management.io/api/operator/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" "open-cluster-management.io/ocm/pkg/operator/helpers" ) diff --git a/pkg/operator/operators/clustermanager/controllers/crdstatuccontroller/crd_status_controller_test.go b/pkg/operator/operators/clustermanager/controllers/crdstatuccontroller/crd_status_controller_test.go index 7a933c9a8..4d3fe5522 100644 --- a/pkg/operator/operators/clustermanager/controllers/crdstatuccontroller/crd_status_controller_test.go +++ b/pkg/operator/operators/clustermanager/controllers/crdstatuccontroller/crd_status_controller_test.go @@ -19,7 +19,7 @@ import ( fakeoperatorlient "open-cluster-management.io/api/client/operator/clientset/versioned/fake" operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions" operatorapiv1 "open-cluster-management.io/api/operator/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/ocm/pkg/operator/operators/clustermanager/controllers/migrationcontroller" ) diff --git a/pkg/operator/operators/clustermanager/controllers/migrationcontroller/migration_controller_test.go b/pkg/operator/operators/clustermanager/controllers/migrationcontroller/migration_controller_test.go index 2217056cb..7fd7b1848 100644 --- a/pkg/operator/operators/clustermanager/controllers/migrationcontroller/migration_controller_test.go +++ b/pkg/operator/operators/clustermanager/controllers/migrationcontroller/migration_controller_test.go @@ -23,8 +23,8 @@ import ( fakeoperatorlient "open-cluster-management.io/api/client/operator/clientset/versioned/fake" operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions" operatorapiv1 "open-cluster-management.io/api/operator/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" ) func newFakeCRD(name string, storageVersion string, versions ...string) runtime.Object { diff --git a/pkg/operator/operators/clustermanager/controllers/statuscontroller/clustermanager_status_controller_test.go b/pkg/operator/operators/clustermanager/controllers/statuscontroller/clustermanager_status_controller_test.go index fc049838b..9e9137085 100644 --- a/pkg/operator/operators/clustermanager/controllers/statuscontroller/clustermanager_status_controller_test.go +++ b/pkg/operator/operators/clustermanager/controllers/statuscontroller/clustermanager_status_controller_test.go @@ -17,8 +17,8 @@ import ( fakeoperatorclient "open-cluster-management.io/api/client/operator/clientset/versioned/fake" operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions" operatorapiv1 "open-cluster-management.io/api/operator/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelper "open-cluster-management.io/ocm/pkg/operator/helpers/testing" ) diff --git a/pkg/operator/operators/crdmanager/manager_test.go b/pkg/operator/operators/crdmanager/manager_test.go index 58394e280..64d15c4f9 100644 --- a/pkg/operator/operators/crdmanager/manager_test.go +++ b/pkg/operator/operators/crdmanager/manager_test.go @@ -20,7 +20,7 @@ import ( versionutil "k8s.io/apimachinery/pkg/util/version" clienttesting "k8s.io/client-go/testing" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" ) func TestApplyV1CRD(t *testing.T) { diff --git a/pkg/operator/operators/klusterlet/controllers/addonsecretcontroller/controller_test.go b/pkg/operator/operators/klusterlet/controllers/addonsecretcontroller/controller_test.go index ece7ee1cd..9d2a7769a 100644 --- a/pkg/operator/operators/klusterlet/controllers/addonsecretcontroller/controller_test.go +++ b/pkg/operator/operators/klusterlet/controllers/addonsecretcontroller/controller_test.go @@ -12,7 +12,7 @@ import ( "k8s.io/client-go/informers" kubefake "k8s.io/client-go/kubernetes/fake" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" ) func TestSync(t *testing.T) { diff --git a/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_cleanup_controller_test.go b/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_cleanup_controller_test.go index 436894e55..e69b3d784 100644 --- a/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_cleanup_controller_test.go +++ b/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_cleanup_controller_test.go @@ -13,7 +13,7 @@ import ( "k8s.io/klog/v2" workv1 "open-cluster-management.io/api/work/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/ocm/pkg/operator/helpers" ) diff --git a/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_controller_test.go b/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_controller_test.go index cd2fcda1a..8d8f00aae 100644 --- a/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_controller_test.go +++ b/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_controller_test.go @@ -34,8 +34,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" operatorapiv1 "open-cluster-management.io/api/operator/v1" workapiv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" "open-cluster-management.io/ocm/pkg/operator/helpers" testinghelper "open-cluster-management.io/ocm/pkg/operator/helpers/testing" diff --git a/pkg/operator/operators/klusterlet/controllers/ssarcontroller/klusterlet_ssar_controller_test.go b/pkg/operator/operators/klusterlet/controllers/ssarcontroller/klusterlet_ssar_controller_test.go index 9c1553607..848190d71 100644 --- a/pkg/operator/operators/klusterlet/controllers/ssarcontroller/klusterlet_ssar_controller_test.go +++ b/pkg/operator/operators/klusterlet/controllers/ssarcontroller/klusterlet_ssar_controller_test.go @@ -24,8 +24,8 @@ import ( fakeoperatorclient "open-cluster-management.io/api/client/operator/clientset/versioned/fake" operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions" operatorapiv1 "open-cluster-management.io/api/operator/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" "open-cluster-management.io/ocm/pkg/operator/helpers" testinghelper "open-cluster-management.io/ocm/pkg/operator/helpers/testing" diff --git a/pkg/operator/operators/klusterlet/controllers/statuscontroller/klusterlet_status_controller_test.go b/pkg/operator/operators/klusterlet/controllers/statuscontroller/klusterlet_status_controller_test.go index fb578551b..ce3ec0d7e 100644 --- a/pkg/operator/operators/klusterlet/controllers/statuscontroller/klusterlet_status_controller_test.go +++ b/pkg/operator/operators/klusterlet/controllers/statuscontroller/klusterlet_status_controller_test.go @@ -17,8 +17,8 @@ import ( fakeoperatorclient "open-cluster-management.io/api/client/operator/clientset/versioned/fake" operatorinformers "open-cluster-management.io/api/client/operator/informers/externalversions" operatorapiv1 "open-cluster-management.io/api/operator/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelper "open-cluster-management.io/ocm/pkg/operator/helpers/testing" ) diff --git a/pkg/placement/controllers/scheduling/cluster_event_handler_test.go b/pkg/placement/controllers/scheduling/cluster_event_handler_test.go index b7befa31c..d986b668e 100644 --- a/pkg/placement/controllers/scheduling/cluster_event_handler_test.go +++ b/pkg/placement/controllers/scheduling/cluster_event_handler_test.go @@ -13,7 +13,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterapiv1beta2 "open-cluster-management.io/api/cluster/v1beta2" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/placement/helpers/testing" ) diff --git a/pkg/placement/controllers/scheduling/enqueue_test.go b/pkg/placement/controllers/scheduling/enqueue_test.go index 585bbe2cb..b487aa603 100644 --- a/pkg/placement/controllers/scheduling/enqueue_test.go +++ b/pkg/placement/controllers/scheduling/enqueue_test.go @@ -19,7 +19,7 @@ import ( clusterapiv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" clusterapiv1beta1 "open-cluster-management.io/api/cluster/v1beta1" clusterapiv1beta2 "open-cluster-management.io/api/cluster/v1beta2" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/placement/helpers/testing" ) diff --git a/pkg/placement/controllers/scheduling/scheduling_controller_test.go b/pkg/placement/controllers/scheduling/scheduling_controller_test.go index 5aa295c24..abd8ae4e2 100644 --- a/pkg/placement/controllers/scheduling/scheduling_controller_test.go +++ b/pkg/placement/controllers/scheduling/scheduling_controller_test.go @@ -22,7 +22,7 @@ import ( clusterapiv1 "open-cluster-management.io/api/cluster/v1" clusterapiv1beta1 "open-cluster-management.io/api/cluster/v1beta1" clusterapiv1beta2 "open-cluster-management.io/api/cluster/v1beta2" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/ocm/pkg/placement/controllers/framework" "open-cluster-management.io/ocm/pkg/placement/controllers/metrics" diff --git a/pkg/registration/clientcert/certificate_test.go b/pkg/registration/clientcert/certificate_test.go index e6d5d946f..ae8e417ab 100644 --- a/pkg/registration/clientcert/certificate_test.go +++ b/pkg/registration/clientcert/certificate_test.go @@ -15,7 +15,7 @@ import ( certutil "k8s.io/client-go/util/cert" "k8s.io/klog/v2/ktesting" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/clientcert/controller_test.go b/pkg/registration/clientcert/controller_test.go index b9e51b164..c09c60b53 100644 --- a/pkg/registration/clientcert/controller_test.go +++ b/pkg/registration/clientcert/controller_test.go @@ -19,7 +19,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/klog/v2/ktesting" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" "open-cluster-management.io/ocm/pkg/registration/hub/user" diff --git a/pkg/registration/hub/addon/discovery_controller_test.go b/pkg/registration/hub/addon/discovery_controller_test.go index ea96d3b8d..58ef69c25 100644 --- a/pkg/registration/hub/addon/discovery_controller_test.go +++ b/pkg/registration/hub/addon/discovery_controller_test.go @@ -17,8 +17,8 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" ) func TestGetAddOnLabelValue(t *testing.T) { diff --git a/pkg/registration/hub/addon/healthcheck_controller_test.go b/pkg/registration/hub/addon/healthcheck_controller_test.go index 14141bd23..4c8c7799c 100644 --- a/pkg/registration/hub/addon/healthcheck_controller_test.go +++ b/pkg/registration/hub/addon/healthcheck_controller_test.go @@ -16,7 +16,7 @@ import ( addoninformers "open-cluster-management.io/api/client/addon/informers/externalversions" clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/clusterrole/controller.go b/pkg/registration/hub/clusterrole/controller.go index 98ec45b29..bb39a7e73 100644 --- a/pkg/registration/hub/clusterrole/controller.go +++ b/pkg/registration/hub/clusterrole/controller.go @@ -14,7 +14,7 @@ import ( clusterv1informer "open-cluster-management.io/api/client/cluster/informers/externalversions/cluster/v1" clusterv1listers "open-cluster-management.io/api/client/cluster/listers/cluster/v1" - "open-cluster-management.io/sdk-go/pkg/apply" + "open-cluster-management.io/ocm/pkg/common/apply" "open-cluster-management.io/ocm/pkg/common/queue" "open-cluster-management.io/ocm/pkg/registration/hub/manifests" diff --git a/pkg/registration/hub/clusterrole/controller_test.go b/pkg/registration/hub/clusterrole/controller_test.go index b5d84c51d..d51358a2e 100644 --- a/pkg/registration/hub/clusterrole/controller_test.go +++ b/pkg/registration/hub/clusterrole/controller_test.go @@ -16,8 +16,8 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" - "open-cluster-management.io/sdk-go/pkg/apply" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + "open-cluster-management.io/ocm/pkg/common/apply" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/csr/controller_beta_test.go b/pkg/registration/hub/csr/controller_beta_test.go index 9c4390c74..2acc8e44d 100644 --- a/pkg/registration/hub/csr/controller_beta_test.go +++ b/pkg/registration/hub/csr/controller_beta_test.go @@ -15,7 +15,7 @@ import ( kubefake "k8s.io/client-go/kubernetes/fake" clienttesting "k8s.io/client-go/testing" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" "open-cluster-management.io/ocm/pkg/registration/hub/user" diff --git a/pkg/registration/hub/csr/controller_test.go b/pkg/registration/hub/csr/controller_test.go index 6cbe2f2e6..b74b6f8d8 100644 --- a/pkg/registration/hub/csr/controller_test.go +++ b/pkg/registration/hub/csr/controller_test.go @@ -20,7 +20,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" "open-cluster-management.io/ocm/pkg/registration/hub/user" diff --git a/pkg/registration/hub/gc/controller_test.go b/pkg/registration/hub/gc/controller_test.go index b3dffc5ac..57df4faf0 100644 --- a/pkg/registration/hub/gc/controller_test.go +++ b/pkg/registration/hub/gc/controller_test.go @@ -18,8 +18,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" workinformers "open-cluster-management.io/api/client/work/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/gc/gc_cluster_rbac_test.go b/pkg/registration/hub/gc/gc_cluster_rbac_test.go index 80a062efd..b51d803c1 100644 --- a/pkg/registration/hub/gc/gc_cluster_rbac_test.go +++ b/pkg/registration/hub/gc/gc_cluster_rbac_test.go @@ -18,8 +18,8 @@ import ( workinformers "open-cluster-management.io/api/client/work/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" workv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/gc/gc_resources_test.go b/pkg/registration/hub/gc/gc_resources_test.go index 781b1a6cd..556af78da 100644 --- a/pkg/registration/hub/gc/gc_resources_test.go +++ b/pkg/registration/hub/gc/gc_resources_test.go @@ -15,7 +15,7 @@ import ( addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1" clusterv1 "open-cluster-management.io/api/cluster/v1" workv1 "open-cluster-management.io/api/work/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/lease/clocksynccontroller_test.go b/pkg/registration/hub/lease/clocksynccontroller_test.go index f5530ece9..6a595ec1c 100644 --- a/pkg/registration/hub/lease/clocksynccontroller_test.go +++ b/pkg/registration/hub/lease/clocksynccontroller_test.go @@ -16,8 +16,8 @@ import ( clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" v1 "open-cluster-management.io/api/cluster/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/lease/controller_test.go b/pkg/registration/hub/lease/controller_test.go index 5cdadf834..95e38e0da 100644 --- a/pkg/registration/hub/lease/controller_test.go +++ b/pkg/registration/hub/lease/controller_test.go @@ -17,8 +17,8 @@ import ( clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" v1 "open-cluster-management.io/api/cluster/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/managedcluster/controller.go b/pkg/registration/hub/managedcluster/controller.go index b15fb7dd5..4e2e15906 100644 --- a/pkg/registration/hub/managedcluster/controller.go +++ b/pkg/registration/hub/managedcluster/controller.go @@ -20,7 +20,7 @@ import ( informerv1 "open-cluster-management.io/api/client/cluster/informers/externalversions/cluster/v1" listerv1 "open-cluster-management.io/api/client/cluster/listers/cluster/v1" v1 "open-cluster-management.io/api/cluster/v1" - "open-cluster-management.io/sdk-go/pkg/apply" + "open-cluster-management.io/ocm/pkg/common/apply" "open-cluster-management.io/sdk-go/pkg/patcher" "open-cluster-management.io/ocm/pkg/common/queue" diff --git a/pkg/registration/hub/managedcluster/controller_test.go b/pkg/registration/hub/managedcluster/controller_test.go index ba4f7a218..e5ef83127 100644 --- a/pkg/registration/hub/managedcluster/controller_test.go +++ b/pkg/registration/hub/managedcluster/controller_test.go @@ -16,9 +16,9 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" v1 "open-cluster-management.io/api/cluster/v1" - "open-cluster-management.io/sdk-go/pkg/apply" + "open-cluster-management.io/ocm/pkg/common/apply" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/managedclusterset/controller_test.go b/pkg/registration/hub/managedclusterset/controller_test.go index 3067b08c9..c14ac032e 100644 --- a/pkg/registration/hub/managedclusterset/controller_test.go +++ b/pkg/registration/hub/managedclusterset/controller_test.go @@ -15,8 +15,8 @@ import ( clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" ) func TestSyncClusterSet(t *testing.T) { diff --git a/pkg/registration/hub/managedclusterset/default_managedclusterset_controller_test.go b/pkg/registration/hub/managedclusterset/default_managedclusterset_controller_test.go index 745ef51c1..19fd556f5 100644 --- a/pkg/registration/hub/managedclusterset/default_managedclusterset_controller_test.go +++ b/pkg/registration/hub/managedclusterset/default_managedclusterset_controller_test.go @@ -14,7 +14,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/managedclusterset/global_managedclusterset_controller_test.go b/pkg/registration/hub/managedclusterset/global_managedclusterset_controller_test.go index e3b34cdbe..33f72e6b4 100644 --- a/pkg/registration/hub/managedclusterset/global_managedclusterset_controller_test.go +++ b/pkg/registration/hub/managedclusterset/global_managedclusterset_controller_test.go @@ -14,7 +14,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/hub/managedclustersetbinding/controller_test.go b/pkg/registration/hub/managedclustersetbinding/controller_test.go index f12ee03e4..8e50d75fa 100644 --- a/pkg/registration/hub/managedclustersetbinding/controller_test.go +++ b/pkg/registration/hub/managedclustersetbinding/controller_test.go @@ -16,7 +16,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" ) func TestSync(t *testing.T) { diff --git a/pkg/registration/hub/taint/controller_test.go b/pkg/registration/hub/taint/controller_test.go index 887699ac2..976881205 100644 --- a/pkg/registration/hub/taint/controller_test.go +++ b/pkg/registration/hub/taint/controller_test.go @@ -14,8 +14,8 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" v1 "open-cluster-management.io/api/cluster/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/spoke/addon/lease_controller_test.go b/pkg/registration/spoke/addon/lease_controller_test.go index 5ee4a4ee9..d8b1ba266 100644 --- a/pkg/registration/spoke/addon/lease_controller_test.go +++ b/pkg/registration/spoke/addon/lease_controller_test.go @@ -16,8 +16,8 @@ import ( addonv1alpha1 "open-cluster-management.io/api/addon/v1alpha1" addonfake "open-cluster-management.io/api/client/addon/clientset/versioned/fake" addoninformers "open-cluster-management.io/api/client/addon/informers/externalversions" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/spoke/addon/registration_controller_test.go b/pkg/registration/spoke/addon/registration_controller_test.go index 5a3a8cf61..4b52357d0 100644 --- a/pkg/registration/spoke/addon/registration_controller_test.go +++ b/pkg/registration/spoke/addon/registration_controller_test.go @@ -17,7 +17,7 @@ import ( addonfake "open-cluster-management.io/api/client/addon/clientset/versioned/fake" addoninformers "open-cluster-management.io/api/client/addon/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" ) func TestFilterCSREvents(t *testing.T) { diff --git a/pkg/registration/spoke/lease/lease_controller_test.go b/pkg/registration/spoke/lease/lease_controller_test.go index 8cb07cbd7..af9b791c8 100644 --- a/pkg/registration/spoke/lease/lease_controller_test.go +++ b/pkg/registration/spoke/lease/lease_controller_test.go @@ -13,7 +13,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/spoke/managedcluster/claim_reconcile_test.go b/pkg/registration/spoke/managedcluster/claim_reconcile_test.go index af80adcd6..2f1e82228 100644 --- a/pkg/registration/spoke/managedcluster/claim_reconcile_test.go +++ b/pkg/registration/spoke/managedcluster/claim_reconcile_test.go @@ -20,7 +20,7 @@ import ( clusterv1 "open-cluster-management.io/api/cluster/v1" clusterv1alpha1 "open-cluster-management.io/api/cluster/v1alpha1" ocmfeature "open-cluster-management.io/api/feature" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/ocm/pkg/features" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" diff --git a/pkg/registration/spoke/managedcluster/joining_controller_test.go b/pkg/registration/spoke/managedcluster/joining_controller_test.go index c338ab14c..5561096de 100644 --- a/pkg/registration/spoke/managedcluster/joining_controller_test.go +++ b/pkg/registration/spoke/managedcluster/joining_controller_test.go @@ -16,7 +16,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/spoke/managedcluster/resource_reconcile_test.go b/pkg/registration/spoke/managedcluster/resource_reconcile_test.go index b69cd48b4..79eb5ea7e 100644 --- a/pkg/registration/spoke/managedcluster/resource_reconcile_test.go +++ b/pkg/registration/spoke/managedcluster/resource_reconcile_test.go @@ -22,7 +22,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterinformers "open-cluster-management.io/api/client/cluster/informers/externalversions" clusterv1 "open-cluster-management.io/api/cluster/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/spoke/registration/creating_controller_test.go b/pkg/registration/spoke/registration/creating_controller_test.go index 34de21f2b..36c919f10 100644 --- a/pkg/registration/spoke/registration/creating_controller_test.go +++ b/pkg/registration/spoke/registration/creating_controller_test.go @@ -9,7 +9,7 @@ import ( clusterfake "open-cluster-management.io/api/client/cluster/clientset/versioned/fake" clusterv1 "open-cluster-management.io/api/cluster/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/spoke/registration/registration_test.go b/pkg/registration/spoke/registration/registration_test.go index 394236e58..f46c48a70 100644 --- a/pkg/registration/spoke/registration/registration_test.go +++ b/pkg/registration/spoke/registration/registration_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" testinghelpers "open-cluster-management.io/ocm/pkg/registration/helpers/testing" ) diff --git a/pkg/registration/spoke/spokeagent_test.go b/pkg/registration/spoke/spokeagent_test.go index f83103921..cd177b24f 100644 --- a/pkg/registration/spoke/spokeagent_test.go +++ b/pkg/registration/spoke/spokeagent_test.go @@ -13,7 +13,7 @@ import ( "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" commonoptions "open-cluster-management.io/ocm/pkg/common/options" "open-cluster-management.io/ocm/pkg/registration/clientcert" diff --git a/pkg/work/hub/controllers/manifestworkreplicasetcontroller/manifestworkreplicaset_controllers_test.go b/pkg/work/hub/controllers/manifestworkreplicasetcontroller/manifestworkreplicaset_controllers_test.go index 6e78214b0..f0e959a68 100644 --- a/pkg/work/hub/controllers/manifestworkreplicasetcontroller/manifestworkreplicaset_controllers_test.go +++ b/pkg/work/hub/controllers/manifestworkreplicasetcontroller/manifestworkreplicaset_controllers_test.go @@ -18,7 +18,7 @@ import ( workinformers "open-cluster-management.io/api/client/work/informers/externalversions" clusterv1beta1 "open-cluster-management.io/api/cluster/v1beta1" workapiv1alpha1 "open-cluster-management.io/api/work/v1alpha1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" helpertest "open-cluster-management.io/ocm/pkg/work/hub/test" ) diff --git a/pkg/work/spoke/apply/create_only_apply_test.go b/pkg/work/spoke/apply/create_only_apply_test.go index 89260afa0..5a0792e71 100644 --- a/pkg/work/spoke/apply/create_only_apply_test.go +++ b/pkg/work/spoke/apply/create_only_apply_test.go @@ -12,7 +12,7 @@ import ( fakedynamic "k8s.io/client-go/dynamic/fake" clienttesting "k8s.io/client-go/testing" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/ocm/pkg/work/spoke/spoketesting" ) diff --git a/pkg/work/spoke/apply/server_side_apply_test.go b/pkg/work/spoke/apply/server_side_apply_test.go index 1b1b20f9b..3a015765a 100644 --- a/pkg/work/spoke/apply/server_side_apply_test.go +++ b/pkg/work/spoke/apply/server_side_apply_test.go @@ -17,7 +17,7 @@ import ( clienttesting "k8s.io/client-go/testing" workapiv1 "open-cluster-management.io/api/work/v1" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/ocm/pkg/work/spoke/spoketesting" ) diff --git a/pkg/work/spoke/apply/update_apply_test.go b/pkg/work/spoke/apply/update_apply_test.go index 9e2c0ec04..1e09d5bb1 100644 --- a/pkg/work/spoke/apply/update_apply_test.go +++ b/pkg/work/spoke/apply/update_apply_test.go @@ -16,7 +16,7 @@ import ( "k8s.io/client-go/kubernetes/fake" clienttesting "k8s.io/client-go/testing" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/ocm/pkg/work/spoke/spoketesting" ) diff --git a/pkg/work/spoke/controllers/appliedmanifestcontroller/appliedmanifestwork_controller_test.go b/pkg/work/spoke/controllers/appliedmanifestcontroller/appliedmanifestwork_controller_test.go index df9c3848e..79754de1f 100644 --- a/pkg/work/spoke/controllers/appliedmanifestcontroller/appliedmanifestwork_controller_test.go +++ b/pkg/work/spoke/controllers/appliedmanifestcontroller/appliedmanifestwork_controller_test.go @@ -20,8 +20,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" workinformers "open-cluster-management.io/api/client/work/informers/externalversions" workapiv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" "open-cluster-management.io/ocm/pkg/work/helper" "open-cluster-management.io/ocm/pkg/work/spoke/spoketesting" diff --git a/pkg/work/spoke/controllers/finalizercontroller/add_finalizer_controller_test.go b/pkg/work/spoke/controllers/finalizercontroller/add_finalizer_controller_test.go index 89a3f6257..9f16af36f 100644 --- a/pkg/work/spoke/controllers/finalizercontroller/add_finalizer_controller_test.go +++ b/pkg/work/spoke/controllers/finalizercontroller/add_finalizer_controller_test.go @@ -12,8 +12,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" workapiv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" "open-cluster-management.io/ocm/pkg/work/spoke/spoketesting" ) diff --git a/pkg/work/spoke/controllers/finalizercontroller/appliedmanifestwork_finalize_controller_test.go b/pkg/work/spoke/controllers/finalizercontroller/appliedmanifestwork_finalize_controller_test.go index 3182c5f60..9af157861 100644 --- a/pkg/work/spoke/controllers/finalizercontroller/appliedmanifestwork_finalize_controller_test.go +++ b/pkg/work/spoke/controllers/finalizercontroller/appliedmanifestwork_finalize_controller_test.go @@ -18,8 +18,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" workapiv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" "open-cluster-management.io/ocm/pkg/work/helper" "open-cluster-management.io/ocm/pkg/work/spoke/spoketesting" diff --git a/pkg/work/spoke/controllers/finalizercontroller/manifestwork_finalize_controller_test.go b/pkg/work/spoke/controllers/finalizercontroller/manifestwork_finalize_controller_test.go index b8bdb2ef5..db780547d 100644 --- a/pkg/work/spoke/controllers/finalizercontroller/manifestwork_finalize_controller_test.go +++ b/pkg/work/spoke/controllers/finalizercontroller/manifestwork_finalize_controller_test.go @@ -14,8 +14,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" workinformers "open-cluster-management.io/api/client/work/informers/externalversions" workapiv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" ) func TestSyncManifestWorkController(t *testing.T) { diff --git a/pkg/work/spoke/controllers/finalizercontroller/unmanaged_appliedmanifestwork_controller_test.go b/pkg/work/spoke/controllers/finalizercontroller/unmanaged_appliedmanifestwork_controller_test.go index f84a092e9..358d3a12d 100644 --- a/pkg/work/spoke/controllers/finalizercontroller/unmanaged_appliedmanifestwork_controller_test.go +++ b/pkg/work/spoke/controllers/finalizercontroller/unmanaged_appliedmanifestwork_controller_test.go @@ -13,8 +13,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" workinformers "open-cluster-management.io/api/client/work/informers/externalversions" workapiv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" ) func TestSyncUnamanagedAppliedWork(t *testing.T) { diff --git a/pkg/work/spoke/controllers/manifestcontroller/manifestwork_controller_test.go b/pkg/work/spoke/controllers/manifestcontroller/manifestwork_controller_test.go index 161b0af13..63acb872c 100644 --- a/pkg/work/spoke/controllers/manifestcontroller/manifestwork_controller_test.go +++ b/pkg/work/spoke/controllers/manifestcontroller/manifestwork_controller_test.go @@ -23,8 +23,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" workinformers "open-cluster-management.io/api/client/work/informers/externalversions" workapiv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" "open-cluster-management.io/ocm/pkg/work/helper" "open-cluster-management.io/ocm/pkg/work/spoke/apply" diff --git a/pkg/work/spoke/controllers/statuscontroller/availablestatus_controller_test.go b/pkg/work/spoke/controllers/statuscontroller/availablestatus_controller_test.go index ebb68fbfa..d9dead66e 100644 --- a/pkg/work/spoke/controllers/statuscontroller/availablestatus_controller_test.go +++ b/pkg/work/spoke/controllers/statuscontroller/availablestatus_controller_test.go @@ -17,8 +17,8 @@ import ( fakeworkclient "open-cluster-management.io/api/client/work/clientset/versioned/fake" ocmfeature "open-cluster-management.io/api/feature" workapiv1 "open-cluster-management.io/api/work/v1" + testingcommon "open-cluster-management.io/ocm/pkg/common/testing" "open-cluster-management.io/sdk-go/pkg/patcher" - testingcommon "open-cluster-management.io/sdk-go/pkg/testing" "open-cluster-management.io/ocm/pkg/features" "open-cluster-management.io/ocm/pkg/work/spoke/spoketesting" diff --git a/vendor/modules.txt b/vendor/modules.txt index b9b25b9cb..4357f2aad 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1586,7 +1586,6 @@ open-cluster-management.io/sdk-go/pkg/apis/cluster/v1beta1 open-cluster-management.io/sdk-go/pkg/apis/cluster/v1beta2 open-cluster-management.io/sdk-go/pkg/apis/work/v1/applier open-cluster-management.io/sdk-go/pkg/apis/work/v1/validator -open-cluster-management.io/sdk-go/pkg/apply open-cluster-management.io/sdk-go/pkg/cloudevents/generic open-cluster-management.io/sdk-go/pkg/cloudevents/generic/options open-cluster-management.io/sdk-go/pkg/cloudevents/generic/options/mqtt @@ -1601,7 +1600,6 @@ open-cluster-management.io/sdk-go/pkg/cloudevents/work/payload open-cluster-management.io/sdk-go/pkg/cloudevents/work/utils open-cluster-management.io/sdk-go/pkg/cloudevents/work/watcher open-cluster-management.io/sdk-go/pkg/patcher -open-cluster-management.io/sdk-go/pkg/testing # sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 ## explicit; go 1.20 sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client