Skip to content

Commit 86fca01

Browse files
Merge pull request #212 from openshift-cherrypick-robot/cherry-pick-211-to-release-4.16
Bug 2290351: [release-4.16] remove unused configuration of MultiClusterService
2 parents 65be851 + 4a863b3 commit 86fca01

File tree

8 files changed

+1
-91
lines changed

8 files changed

+1
-91
lines changed

addons/agent_mirrorpeer_controller.go

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
multiclusterv1alpha1 "github.com/red-hat-storage/odf-multicluster-orchestrator/api/v1alpha1"
3030
"github.com/red-hat-storage/odf-multicluster-orchestrator/controllers/utils"
3131
rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
32-
submarinerv1alpha1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
3332
corev1 "k8s.io/api/core/v1"
3433
storagev1 "k8s.io/api/storage/v1"
3534
"k8s.io/apimachinery/pkg/api/errors"
@@ -155,15 +154,6 @@ func (r *MirrorPeerReconciler) Reconcile(ctx context.Context, req ctrl.Request)
155154
if len(errs) > 0 {
156155
return ctrl.Result{}, fmt.Errorf("few failures occured while labeling RBD StorageClasses: %v", errs)
157156
}
158-
159-
// Trying this at last to allow bootstrapping to be completed
160-
if mirrorPeer.Spec.OverlappingCIDR {
161-
klog.Info("enabling multiclusterservice", "MirrorPeer", mirrorPeer.GetName(), "Peers", mirrorPeer.Spec.Items)
162-
err := r.enableMulticlusterService(ctx, scr.Name, scr.Namespace)
163-
if err != nil {
164-
return ctrl.Result{}, fmt.Errorf("failed to enable multiclusterservice for storagecluster %q in namespace %q: %v", scr.Name, scr.Namespace, err)
165-
}
166-
}
167157
}
168158
return ctrl.Result{}, nil
169159
}
@@ -302,49 +292,6 @@ func (r *MirrorPeerReconciler) getS3bucket(ctx context.Context, mirrorPeer multi
302292
return noobaaOBC, err
303293
}
304294

305-
// enableMulticlusterService sets the multiclusterservice flag on StorageCluster if submariner globalnet is enabled
306-
func (r *MirrorPeerReconciler) enableMulticlusterService(ctx context.Context, storageClusterName string, namespace string) error {
307-
klog.Infof("Enabling MCS for StorageCluster %q in %q namespace.", storageClusterName, namespace)
308-
var sc ocsv1.StorageCluster
309-
err := r.SpokeClient.Get(ctx, types.NamespacedName{
310-
Name: storageClusterName,
311-
Namespace: namespace,
312-
}, &sc)
313-
if err != nil {
314-
klog.Errorf("Error fetching StorageCluster while enabling MCS. Error: %v", err)
315-
return err
316-
}
317-
318-
var submariner submarinerv1alpha1.Submariner
319-
err = r.SpokeClient.Get(ctx, types.NamespacedName{
320-
Name: "submariner",
321-
Namespace: "submariner-operator"},
322-
&submariner)
323-
if err != nil {
324-
klog.Errorf("Error fetching Submariner config while enabling MCS. Error: %v", err)
325-
return err
326-
}
327-
328-
if sc.Spec.Network == nil {
329-
sc.Spec.Network = &rookv1.NetworkSpec{}
330-
klog.Infof("StorageCluster %q in %q namespace has no network config defined. Initializing it now. New NetworkSpec: %v", storageClusterName, namespace, sc.Spec.Network)
331-
}
332-
333-
if !sc.Spec.Network.MultiClusterService.Enabled || sc.Spec.Network.MultiClusterService.ClusterID == "" {
334-
sc.Spec.Network.MultiClusterService.Enabled = true
335-
sc.Spec.Network.MultiClusterService.ClusterID = submariner.Spec.ClusterID
336-
klog.Infof("StorageCluster %q in %q namespace has MCS disabled. Enabling it now. New MCS spec: %v", storageClusterName, namespace, sc.Spec.Network.MultiClusterService)
337-
err := r.SpokeClient.Update(ctx, &sc)
338-
if err != nil {
339-
klog.Errorf("Error updating MCS config for StorageCluster %q in %q namespace. Error: %v", storageClusterName, namespace, err)
340-
}
341-
return err
342-
}
343-
344-
klog.Infof("StorageCluster %q in %q namespace has MCS enabled already. Current MCS spec: %v", storageClusterName, namespace, sc.Spec.Network.MultiClusterService)
345-
return nil
346-
}
347-
348295
// enableMirroring is a wrapper function around toggleMirroring to enable mirroring in a storage cluster
349296
func (r *MirrorPeerReconciler) enableMirroring(ctx context.Context, storageClusterName string, namespace string, mp *multiclusterv1alpha1.MirrorPeer) error {
350297
return r.toggleMirroring(ctx, storageClusterName, namespace, true, mp)

addons/manager.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
multiclusterv1alpha1 "github.com/red-hat-storage/odf-multicluster-orchestrator/api/v1alpha1"
1717
rookv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
1818
"github.com/spf13/cobra"
19-
submarinerv1alpha1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
2019
appsv1 "k8s.io/api/apps/v1"
2120
corev1 "k8s.io/api/core/v1"
2221
extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
@@ -57,7 +56,6 @@ func init() {
5756
utilruntime.Must(ocsv1.AddToScheme(mgrScheme))
5857
utilruntime.Must(obv1alpha1.AddToScheme(mgrScheme))
5958
utilruntime.Must(routev1.AddToScheme(mgrScheme))
60-
utilruntime.Must(submarinerv1alpha1.AddToScheme(mgrScheme))
6159
utilruntime.Must(rookv1.AddToScheme(mgrScheme))
6260
utilruntime.Must(extv1.AddToScheme(mgrScheme))
6361
//+kubebuilder:scaffold:scheme

api/v1alpha1/mirrorpeer_types.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ type MirrorPeerSpec struct {
6969
// +kubebuilder:validation:Optional
7070
// +kubebuilder:default=false
7171
ManageS3 bool `json:"manageS3,omitempty"`
72-
73-
// OverlappingCIDR should be set to true if the peer clusters
74-
// have overlapping Pod or Service CIDR. This will enable storage
75-
// clusters to use submariner globalnet. Enabling this will cause
76-
// storage service disruption while network is being reconfigured.
77-
// +kubebuilder:validation:Optional
78-
// +kubebuilder:default=false
79-
OverlappingCIDR bool `json:"overlappingCIDR,omitempty"`
8072
}
8173

8274
// MirrorPeerStatus defines the observed state of MirrorPeer

api/v1alpha1/mirrorpeer_webhook.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ func (r *MirrorPeer) ValidateUpdate(old runtime.Object) (warnings admission.Warn
8080
}
8181
}
8282

83-
if oldMirrorPeer.Spec.OverlappingCIDR && !r.Spec.OverlappingCIDR {
84-
return []string{}, fmt.Errorf("error updating MirrorPeer: OverlappingCIDR value can not be changed from %t to %t. This is to prevent Disaster Recovery from being unusable between clusters that have overlapping IPs", oldMirrorPeer.Spec.OverlappingCIDR, r.Spec.OverlappingCIDR)
85-
}
8683
return []string{}, validateMirrorPeer(r)
8784
}
8885

bundle/manifests/multicluster.odf.openshift.io_mirrorpeers.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ spec:
7272
manageS3:
7373
default: false
7474
type: boolean
75-
overlappingCIDR:
76-
default: false
77-
description: |-
78-
OverlappingCIDR should be set to true if the peer clusters
79-
have overlapping Pod or Service CIDR. This will enable storage
80-
clusters to use submariner globalnet. Enabling this will cause
81-
storage service disruption while network is being reconfigured.
82-
type: boolean
8375
schedulingIntervals:
8476
description: |-
8577
SchedulingIntervals is a list of intervals at which mirroring snapshots are taken.

config/crd/bases/multicluster.odf.openshift.io_mirrorpeers.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ spec:
7272
manageS3:
7373
default: false
7474
type: boolean
75-
overlappingCIDR:
76-
default: false
77-
description: |-
78-
OverlappingCIDR should be set to true if the peer clusters
79-
have overlapping Pod or Service CIDR. This will enable storage
80-
clusters to use submariner globalnet. Enabling this will cause
81-
storage service disruption while network is being reconfigured.
82-
type: boolean
8375
schedulingIntervals:
8476
description: |-
8577
SchedulingIntervals is a list of intervals at which mirroring snapshots are taken.

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ require (
1414
github.com/rook/rook/pkg/apis v0.0.0-20231204200402-5287527732f7
1515
github.com/spf13/cobra v1.8.0
1616
github.com/stretchr/testify v1.8.4
17-
github.com/submariner-io/submariner-operator v0.17.0
1817
golang.org/x/sync v0.5.0
1918
k8s.io/api v0.29.2
2019
k8s.io/apiextensions-apiserver v0.29.2
@@ -52,6 +51,7 @@ require (
5251
github.com/google/gnostic-models v0.6.8 // indirect
5352
github.com/google/go-cmp v0.6.0 // indirect
5453
github.com/google/gofuzz v1.2.0 // indirect
54+
github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 // indirect
5555
github.com/google/uuid v1.4.0 // indirect
5656
github.com/hashicorp/errwrap v1.1.0 // indirect
5757
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
@@ -93,8 +93,6 @@ require (
9393
github.com/sirupsen/logrus v1.9.3 // indirect
9494
github.com/spf13/pflag v1.0.5 // indirect
9595
github.com/stolostron/multicloud-operators-placementrule v1.2.4-1-20220311-8eedb3f.0.20230828200208-cd3c119a7fa0 // indirect
96-
github.com/submariner-io/admiral v0.17.0 // indirect
97-
github.com/submariner-io/submariner v0.17.0 // indirect
9896
go.uber.org/multierr v1.11.0 // indirect
9997
go.uber.org/zap v1.26.0 // indirect
10098
golang.org/x/crypto v0.19.0 // indirect

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -778,12 +778,6 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
778778
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
779779
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
780780
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
781-
github.com/submariner-io/admiral v0.17.0 h1:Hz722z70W8hPAlKv/Y70MhNGwmmjl4eMZ+bDw9S+BAQ=
782-
github.com/submariner-io/admiral v0.17.0/go.mod h1:OYkNN5EYaMZ1w1qxzVzD5q8hVNtojQkVoNPcO8/LL+Y=
783-
github.com/submariner-io/submariner v0.17.0 h1:IrD2kqf+2pTLw5ldNycoPv7eKURngQWaQ06vX7/pvPY=
784-
github.com/submariner-io/submariner v0.17.0/go.mod h1:mD6agq0P2OGSXHb74lblkSxGgxP7vy9/sa4ghzJBd1E=
785-
github.com/submariner-io/submariner-operator v0.17.0 h1:7fQW/KAaCTP4HPzaIN0w/9u8j1rqwpQTfLjU2F+Z0zg=
786-
github.com/submariner-io/submariner-operator v0.17.0/go.mod h1:/DrA6G1ll97bmyMvPDVj2OKU0htQUrYY0MtOpzlYM9I=
787781
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
788782
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
789783
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=

0 commit comments

Comments
 (0)