Skip to content

Commit 9c3e77c

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 c506004 commit 9c3e77c

6 files changed

Lines changed: 8 additions & 25 deletions

File tree

api/go.mod

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,6 @@ require (
119119
// must consistent within modules and service operators
120120
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e //allow-merging
121121

122-
// 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
124-
125-
// pin to support rabbitmq 2.16.0 rebase
126-
//replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250627150254-e9823e99808e //allow-merging
127-
128122
replace k8s.io/apimachinery => k8s.io/apimachinery v0.31.14 //allow-merging
129123

130124
replace k8s.io/api => k8s.io/api v0.31.14 //allow-merging

cmd/main.go

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

@@ -107,7 +106,6 @@ func init() {
107106
utilruntime.Must(keystonev1.AddToScheme(scheme))
108107
utilruntime.Must(mariadbv1.AddToScheme(scheme))
109108
utilruntime.Must(memcachedv1.AddToScheme(scheme))
110-
utilruntime.Must(rabbitmqclusterv2.AddToScheme(scheme))
111109
utilruntime.Must(placementv1.AddToScheme(scheme))
112110
utilruntime.Must(glancev1.AddToScheme(scheme))
113111
utilruntime.Must(cinderv1.AddToScheme(scheme))

go.mod

Lines changed: 0 additions & 5 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
@@ -158,10 +157,6 @@ replace github.com/openstack-k8s-operators/openstack-operator/api => ./api //all
158157
// must consistent within modules and service operators
159158
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e //allow-merging
160159

161-
// 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
163-
164-
// pin to support rabbitmq 2.16.0 rebase
165160
replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250627150254-e9823e99808e //allow-merging
166161

167162
replace k8s.io/apimachinery => k8s.io/apimachinery v0.31.14 //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"
@@ -182,9 +180,6 @@ var _ = BeforeSuite(func() {
182180
barbicanv1CRDs, err := test.GetCRDDirFromModule(
183181
"github.com/openstack-k8s-operators/barbican-operator/api", gomod, "bases")
184182
Expect(err).ShouldNot(HaveOccurred())
185-
rabbitmqv2CRDs, err := test.GetCRDDirFromModule(
186-
"github.com/rabbitmq/cluster-operator/v2", gomod, "config/crd/bases")
187-
Expect(err).ShouldNot(HaveOccurred())
188183
certmgrv1CRDs, err := test.GetOpenShiftCRDDir("cert-manager/v1", gomod)
189184
Expect(err).ShouldNot(HaveOccurred())
190185
ocpconfigv1CRDs, err := test.GetOpenShiftCRDDir("config/v1", gomod)
@@ -219,7 +214,6 @@ var _ = BeforeSuite(func() {
219214
telemetryv1CRDs,
220215
designatev1CRDs,
221216
barbicanv1CRDs,
222-
rabbitmqv2CRDs,
223217
certmgrv1CRDs,
224218
ocpconfigv1CRDs,
225219
watcherCRDs,
@@ -309,8 +303,6 @@ var _ = BeforeSuite(func() {
309303
Expect(err).NotTo(HaveOccurred())
310304
err = barbicanv1.AddToScheme(scheme.Scheme)
311305
Expect(err).NotTo(HaveOccurred())
312-
err = rabbitmqv2.AddToScheme(scheme.Scheme)
313-
Expect(err).NotTo(HaveOccurred())
314306
err = certmgrv1.AddToScheme(scheme.Scheme)
315307
Expect(err).NotTo(HaveOccurred())
316308
err = networkv1.AddToScheme(scheme.Scheme)

0 commit comments

Comments
 (0)