Skip to content

Commit 2b3af3e

Browse files
stuggiclaude
andcommitted
Remove rabbitmq/cluster-operator/v2 dependency
Replace the typed rabbitmqv2.RabbitmqCluster usage in removeRabbitmqClusterControllerReference with unstructured client. This was the only code importing the rabbitmq cluster-operator types. Remove the scheme registration from cmd/main.go and the CRD loading from the envtest suite. The unstructured client does not need the types registered in the scheme. This eliminates a dependency that required a pinned replace directive and complicated OCP version bumps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent f75fe43 commit 2b3af3e

6 files changed

Lines changed: 8 additions & 17 deletions

File tree

api/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ require (
120120
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e //allow-merging
121121

122122
// custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.16.0_patches)
123-
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec //allow-merging
124123

125124
// pin to support rabbitmq 2.16.0 rebase
126125
//replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250627150254-e9823e99808e //allow-merging

cmd/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ import (
8383
telemetryv1 "github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1"
8484
_ "github.com/openstack-k8s-operators/test-operator/api/v1beta1"
8585
watcherv1 "github.com/openstack-k8s-operators/watcher-operator/api/v1beta1"
86-
rabbitmqclusterv2 "github.com/rabbitmq/cluster-operator/v2/api/v1beta1"
8786
"k8s.io/client-go/kubernetes"
8887
"sigs.k8s.io/controller-runtime/pkg/client/config"
8988

@@ -106,7 +105,6 @@ func init() {
106105
utilruntime.Must(keystonev1.AddToScheme(scheme))
107106
utilruntime.Must(mariadbv1.AddToScheme(scheme))
108107
utilruntime.Must(memcachedv1.AddToScheme(scheme))
109-
utilruntime.Must(rabbitmqclusterv2.AddToScheme(scheme))
110108
utilruntime.Must(placementv1.AddToScheme(scheme))
111109
utilruntime.Must(glancev1.AddToScheme(scheme))
112110
utilruntime.Must(cinderv1.AddToScheme(scheme))

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ require (
4040
github.com/openstack-k8s-operators/test-operator/api v0.6.1-0.20260416110435-a3f78e737417
4141
github.com/openstack-k8s-operators/watcher-operator/api v0.6.1-0.20260414124111-458e17672b3c
4242
github.com/pkg/errors v0.9.1
43-
github.com/rabbitmq/cluster-operator/v2 v2.16.0
4443
github.com/stretchr/testify v1.11.1
4544
go.uber.org/zap v1.27.1
4645
gopkg.in/yaml.v3 v3.0.1
@@ -159,7 +158,6 @@ replace github.com/openstack-k8s-operators/openstack-operator/api => ./api //all
159158
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e //allow-merging
160159

161160
// custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.16.0_patches)
162-
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec //allow-merging
163161

164162
// pin to support rabbitmq 2.16.0 rebase
165163
replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250627150254-e9823e99808e //allow-merging

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ github.com/openstack-k8s-operators/ovn-operator/api v0.6.1-0.20260420053123-cf09
184184
github.com/openstack-k8s-operators/ovn-operator/api v0.6.1-0.20260420053123-cf0908d8cf39/go.mod h1:ODYNTFMUlzvjlqXAh9AGXrzpBNQBAOkWiNQ6UldsqFw=
185185
github.com/openstack-k8s-operators/placement-operator/api v0.6.1-0.20260413090520-f18a11875c1d h1:ZvVIq5E/F82tqQckheo3WnL6XywTPc+PiJWyrllkyVo=
186186
github.com/openstack-k8s-operators/placement-operator/api v0.6.1-0.20260413090520-f18a11875c1d/go.mod h1:34ka8QoEZ2LFmJv6wO5l9U29f9Kd1vizVzbkzRQnwVA=
187-
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec h1:saovr368HPAKHN0aRPh8h8n9s9dn3d8Frmfua0UYRlc=
188-
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec/go.mod h1:Nh2NEePLjovUQof2krTAg4JaAoLacqtPTZQXK6izNfg=
189187
github.com/openstack-k8s-operators/swift-operator/api v0.6.1-0.20260418085220-949c802081aa h1:pnzRdcdTy91mxcU93e7xp9gn+pNyWyOdB8w/WlRynvo=
190188
github.com/openstack-k8s-operators/swift-operator/api v0.6.1-0.20260418085220-949c802081aa/go.mod h1:REDdMRGrY7JhGOsrKXt4hNZJAq0f6b3ykVh/Wyy4UXs=
191189
github.com/openstack-k8s-operators/telemetry-operator/api v0.6.1-0.20260420053123-02a691a5b4d4 h1:82WLFtF/6P1VwcVoyfO9vjEdMnkQFpHkVq4I3YY7L28=

internal/openstack/rabbitmq.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ import (
3131
"k8s.io/apimachinery/pkg/types"
3232
ctrl "sigs.k8s.io/controller-runtime"
3333

34-
rabbitmqv2 "github.com/rabbitmq/cluster-operator/v2/api/v1beta1"
3534
corev1 "k8s.io/api/core/v1"
35+
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
36+
"k8s.io/apimachinery/pkg/runtime/schema"
3637
)
3738

3839
type mqStatus int
@@ -316,7 +317,12 @@ func removeRabbitmqClusterControllerReference(
316317
instance *corev1beta1.OpenStackControlPlane,
317318
name string,
318319
) error {
319-
rabbitmqCluster := &rabbitmqv2.RabbitmqCluster{}
320+
rabbitmqCluster := &unstructured.Unstructured{}
321+
rabbitmqCluster.SetGroupVersionKind(schema.GroupVersionKind{
322+
Group: "rabbitmq.com",
323+
Version: "v1beta1",
324+
Kind: "RabbitmqCluster",
325+
})
320326
namespacedName := types.NamespacedName{
321327
Name: name,
322328
Namespace: instance.Namespace,

test/functional/ctlplane/suite_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ import (
3232
certmgrv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
3333
k8s_networkingv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
3434
routev1 "github.com/openshift/api/route/v1"
35-
rabbitmqv2 "github.com/rabbitmq/cluster-operator/v2/api/v1beta1"
36-
3735
barbicanv1 "github.com/openstack-k8s-operators/barbican-operator/api/v1beta1"
3836
cinderv1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1"
3937
designatev1 "github.com/openstack-k8s-operators/designate-operator/api/v1beta1"
@@ -181,9 +179,6 @@ var _ = BeforeSuite(func() {
181179
barbicanv1CRDs, err := test.GetCRDDirFromModule(
182180
"github.com/openstack-k8s-operators/barbican-operator/api", gomod, "bases")
183181
Expect(err).ShouldNot(HaveOccurred())
184-
rabbitmqv2CRDs, err := test.GetCRDDirFromModule(
185-
"github.com/rabbitmq/cluster-operator/v2", gomod, "config/crd/bases")
186-
Expect(err).ShouldNot(HaveOccurred())
187182
certmgrv1CRDs, err := test.GetOpenShiftCRDDir("cert-manager/v1", gomod)
188183
Expect(err).ShouldNot(HaveOccurred())
189184
ocpconfigv1CRDs, err := test.GetOpenShiftCRDDir("config/v1", gomod)
@@ -218,7 +213,6 @@ var _ = BeforeSuite(func() {
218213
telemetryv1CRDs,
219214
designatev1CRDs,
220215
barbicanv1CRDs,
221-
rabbitmqv2CRDs,
222216
certmgrv1CRDs,
223217
ocpconfigv1CRDs,
224218
watcherCRDs,
@@ -308,8 +302,6 @@ var _ = BeforeSuite(func() {
308302
Expect(err).NotTo(HaveOccurred())
309303
err = barbicanv1.AddToScheme(scheme.Scheme)
310304
Expect(err).NotTo(HaveOccurred())
311-
err = rabbitmqv2.AddToScheme(scheme.Scheme)
312-
Expect(err).NotTo(HaveOccurred())
313305
err = certmgrv1.AddToScheme(scheme.Scheme)
314306
Expect(err).NotTo(HaveOccurred())
315307
err = networkv1.AddToScheme(scheme.Scheme)

0 commit comments

Comments
 (0)