Skip to content

Commit 0c5806c

Browse files
committed
WIP: drop operatorclient from reconciler
This client is not used anywhere so it can be removed.
1 parent 264228e commit 0c5806c

File tree

266 files changed

+4
-30342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+4
-30342
lines changed

cmd/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ import (
4646
controllers "github.com/hybrid-cloud-patterns/patterns-operator/internal/controller"
4747
"github.com/hybrid-cloud-patterns/patterns-operator/version"
4848
apiv1 "github.com/openshift/api/config/v1"
49+
operatorv1 "github.com/openshift/api/operator/v1"
50+
operatorv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
4951
corev1 "k8s.io/api/core/v1"
5052
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5153
"k8s.io/client-go/kubernetes"
@@ -62,7 +64,9 @@ func init() {
6264

6365
utilruntime.Must(gitopsv1alpha1.AddToScheme(scheme))
6466
utilruntime.Must(apiv1.Install(scheme))
67+
utilruntime.Must(operatorv1.Install(scheme))
6568
utilruntime.Must(argoapi.AddToScheme(scheme))
69+
utilruntime.Must(operatorv1alpha1.AddToScheme(scheme))
6670
//+kubebuilder:scaffold:scheme
6771
}
6872

internal/controller/pattern_controller.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import (
4545
corev1 "k8s.io/api/core/v1"
4646

4747
api "github.com/hybrid-cloud-patterns/patterns-operator/api/v1alpha1"
48-
operatorclient "github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1"
4948
)
5049

5150
const ReconcileLoopRequeueTime = 180 * time.Second
@@ -60,7 +59,6 @@ type PatternReconciler struct {
6059

6160
config *rest.Config
6261
routeClient routeclient.Interface
63-
operatorClient operatorclient.OperatorV1Interface
6462
driftWatcher driftWatcher
6563
gitOperations GitOperations
6664
giteaOperations GiteaOperations
@@ -594,10 +592,6 @@ func (r *PatternReconciler) SetupWithManager(mgr ctrl.Manager) error {
594592
var err error
595593
r.config = mgr.GetConfig()
596594

597-
if r.operatorClient, err = operatorclient.NewForConfig(r.config); err != nil {
598-
return err
599-
}
600-
601595
if r.routeClient, err = routeclient.NewForConfig(r.config); err != nil {
602596
return err
603597
}

internal/controller/pattern_controller_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import (
2727
. "github.com/onsi/ginkgo/v2"
2828
. "github.com/onsi/gomega"
2929
v1 "github.com/openshift/api/config/v1"
30-
operatorv1 "github.com/openshift/api/operator/v1"
31-
operatorclient "github.com/openshift/client-go/operator/clientset/versioned/fake"
3230
gomock "go.uber.org/mock/gomock"
3331

3432
corev1 "k8s.io/api/core/v1"
@@ -216,10 +214,6 @@ func newFakeReconciler(initObjects ...runtime.Object) *PatternReconciler {
216214
},
217215
}
218216
clusterInfra := &v1.Infrastructure{ObjectMeta: metav1.ObjectMeta{Name: "cluster"}, Spec: v1.InfrastructureSpec{PlatformSpec: v1.PlatformSpec{Type: "AWS"}}}
219-
osControlManager := &operatorv1.OpenShiftControllerManager{
220-
ObjectMeta: metav1.ObjectMeta{Name: "cluster"},
221-
Spec: operatorv1.OpenShiftControllerManagerSpec{},
222-
Status: operatorv1.OpenShiftControllerManagerStatus{OperatorStatus: operatorv1.OperatorStatus{Version: "4.10.3"}}}
223217
ingress := &v1.Ingress{ObjectMeta: metav1.ObjectMeta{Name: "cluster"}, Spec: v1.IngressSpec{Domain: "hello.world"}}
224218
fakeClient := fake.NewClientBuilder().WithScheme(scheme.Scheme).WithRuntimeObjects(initObjects...).
225219
WithRuntimeObjects(clusterVersion, clusterInfra, ingress).Build()
@@ -228,7 +222,6 @@ func newFakeReconciler(initObjects ...runtime.Object) *PatternReconciler {
228222
Scheme: scheme.Scheme,
229223
Client: fakeClient,
230224
driftWatcher: watcher,
231-
operatorClient: operatorclient.NewSimpleClientset(osControlManager).OperatorV1(),
232225
AnalyticsClient: AnalyticsInit(true, logr.New(log.NullLogSink{})),
233226
gitOperations: mockGitOps,
234227
}

vendor/github.com/openshift/api/operator/v1alpha1/0000_10_01_etcdbackup-TechPreviewNoUpgrade.crd.yaml

Lines changed: 0 additions & 114 deletions
This file was deleted.

vendor/github.com/openshift/api/operator/v1alpha1/0000_10_config-operator_01_imagecontentsourcepolicy.crd.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)