File tree Expand file tree Collapse file tree 10 files changed +28
-77
lines changed Expand file tree Collapse file tree 10 files changed +28
-77
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,9 @@ import (
1919
2020 "gopkg.in/ini.v1"
2121
22- rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
2322 "github.com/rabbitmq/cluster-operator/internal/metadata"
2423 corev1 "k8s.io/api/core/v1"
2524 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26- "k8s.io/apimachinery/pkg/runtime"
2725)
2826
2927const (
@@ -57,15 +55,11 @@ prometheus.ssl.port = 15691
5755)
5856
5957type ServerConfigMapBuilder struct {
60- Instance * rabbitmqv1beta1.RabbitmqCluster
61- Scheme * runtime.Scheme
58+ * RabbitmqResourceBuilder
6259}
6360
6461func (builder * RabbitmqResourceBuilder ) ServerConfigMap () * ServerConfigMapBuilder {
65- return & ServerConfigMapBuilder {
66- Instance : builder .Instance ,
67- Scheme : builder .Scheme ,
68- }
62+ return & ServerConfigMapBuilder {builder }
6963}
7064
7165func (builder * ServerConfigMapBuilder ) Build () (client.Object , error ) {
Original file line number Diff line number Diff line change @@ -12,16 +12,15 @@ package resource
1212import (
1313 "bytes"
1414 "fmt"
15+
1516 "sigs.k8s.io/controller-runtime/pkg/client"
1617
1718 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
1819
19- rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
2020 "github.com/rabbitmq/cluster-operator/internal/metadata"
2121 "gopkg.in/ini.v1"
2222 corev1 "k8s.io/api/core/v1"
2323 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24- "k8s.io/apimachinery/pkg/runtime"
2524)
2625
2726const (
@@ -31,15 +30,11 @@ const (
3130)
3231
3332type DefaultUserSecretBuilder struct {
34- Instance * rabbitmqv1beta1.RabbitmqCluster
35- Scheme * runtime.Scheme
33+ * RabbitmqResourceBuilder
3634}
3735
3836func (builder * RabbitmqResourceBuilder ) DefaultUserSecret () * DefaultUserSecretBuilder {
39- return & DefaultUserSecretBuilder {
40- Instance : builder .Instance ,
41- Scheme : builder .Scheme ,
42- }
37+ return & DefaultUserSecretBuilder {builder }
4338}
4439
4540func (builder * DefaultUserSecretBuilder ) Build () (client.Object , error ) {
Original file line number Diff line number Diff line change @@ -13,30 +13,25 @@ import (
1313 "crypto/rand"
1414 "encoding/base64"
1515 "fmt"
16+
1617 "sigs.k8s.io/controller-runtime/pkg/client"
1718 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
1819
19- rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
2020 "github.com/rabbitmq/cluster-operator/internal/metadata"
2121 corev1 "k8s.io/api/core/v1"
2222 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23- "k8s.io/apimachinery/pkg/runtime"
2423)
2524
2625const (
2726 erlangCookieName = "erlang-cookie"
2827)
2928
3029type ErlangCookieBuilder struct {
31- Instance * rabbitmqv1beta1.RabbitmqCluster
32- Scheme * runtime.Scheme
30+ * RabbitmqResourceBuilder
3331}
3432
3533func (builder * RabbitmqResourceBuilder ) ErlangCookie () * ErlangCookieBuilder {
36- return & ErlangCookieBuilder {
37- Instance : builder .Instance ,
38- Scheme : builder .Scheme ,
39- }
34+ return & ErlangCookieBuilder {builder }
4035}
4136
4237func (builder * ErlangCookieBuilder ) Build () (client.Object , error ) {
Original file line number Diff line number Diff line change @@ -11,13 +11,12 @@ package resource
1111
1212import (
1313 "fmt"
14+
1415 "sigs.k8s.io/controller-runtime/pkg/client"
1516
16- rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
1717 "github.com/rabbitmq/cluster-operator/internal/metadata"
1818 corev1 "k8s.io/api/core/v1"
1919 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
20- "k8s.io/apimachinery/pkg/runtime"
2120 "k8s.io/apimachinery/pkg/util/intstr"
2221 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
2322)
@@ -27,15 +26,11 @@ const (
2726)
2827
2928type HeadlessServiceBuilder struct {
30- Instance * rabbitmqv1beta1.RabbitmqCluster
31- Scheme * runtime.Scheme
29+ * RabbitmqResourceBuilder
3230}
3331
3432func (builder * RabbitmqResourceBuilder ) HeadlessService () * HeadlessServiceBuilder {
35- return & HeadlessServiceBuilder {
36- Instance : builder .Instance ,
37- Scheme : builder .Scheme ,
38- }
33+ return & HeadlessServiceBuilder {builder }
3934}
4035
4136func (builder * HeadlessServiceBuilder ) UpdateMayRequireStsRecreate () bool {
Original file line number Diff line number Diff line change @@ -2,16 +2,16 @@ package resource
22
33import (
44 "fmt"
5- "sigs.k8s.io/controller-runtime/pkg/client"
65 "strings"
76
7+ "sigs.k8s.io/controller-runtime/pkg/client"
8+
89 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
910
1011 rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
1112 "github.com/rabbitmq/cluster-operator/internal/metadata"
1213 corev1 "k8s.io/api/core/v1"
1314 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
14- "k8s.io/apimachinery/pkg/runtime"
1515)
1616
1717var requiredPlugins = []string {
@@ -23,15 +23,11 @@ var requiredPlugins = []string{
2323const PluginsConfigName = "plugins-conf"
2424
2525type RabbitmqPluginsConfigMapBuilder struct {
26- Instance * rabbitmqv1beta1.RabbitmqCluster
27- Scheme * runtime.Scheme
26+ * RabbitmqResourceBuilder
2827}
2928
3029func (builder * RabbitmqResourceBuilder ) RabbitmqPluginsConfigMap () * RabbitmqPluginsConfigMapBuilder {
31- return & RabbitmqPluginsConfigMapBuilder {
32- Instance : builder .Instance ,
33- Scheme : builder .Scheme ,
34- }
30+ return & RabbitmqPluginsConfigMapBuilder {builder }
3531}
3632
3733func (builder * RabbitmqPluginsConfigMapBuilder ) Build () (client.Object , error ) {
Original file line number Diff line number Diff line change @@ -11,13 +11,12 @@ package resource
1111
1212import (
1313 "fmt"
14+
1415 "sigs.k8s.io/controller-runtime/pkg/client"
1516
16- rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
1717 "github.com/rabbitmq/cluster-operator/internal/metadata"
1818 rbacv1 "k8s.io/api/rbac/v1"
1919 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
20- "k8s.io/apimachinery/pkg/runtime"
2120 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
2221)
2322
@@ -26,15 +25,11 @@ const (
2625)
2726
2827type RoleBuilder struct {
29- Instance * rabbitmqv1beta1.RabbitmqCluster
30- Scheme * runtime.Scheme
28+ * RabbitmqResourceBuilder
3129}
3230
3331func (builder * RabbitmqResourceBuilder ) Role () * RoleBuilder {
34- return & RoleBuilder {
35- Instance : builder .Instance ,
36- Scheme : builder .Scheme ,
37- }
32+ return & RoleBuilder {builder }
3833}
3934
4035func (builder * RoleBuilder ) Build () (client.Object , error ) {
Original file line number Diff line number Diff line change @@ -11,13 +11,12 @@ package resource
1111
1212import (
1313 "fmt"
14+
1415 rbacv1 "k8s.io/api/rbac/v1"
1516 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
16- "k8s.io/apimachinery/pkg/runtime"
1717 "sigs.k8s.io/controller-runtime/pkg/client"
1818 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
1919
20- rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
2120 "github.com/rabbitmq/cluster-operator/internal/metadata"
2221)
2322
@@ -26,15 +25,11 @@ const (
2625)
2726
2827type RoleBindingBuilder struct {
29- Instance * rabbitmqv1beta1.RabbitmqCluster
30- Scheme * runtime.Scheme
28+ * RabbitmqResourceBuilder
3129}
3230
3331func (builder * RabbitmqResourceBuilder ) RoleBinding () * RoleBindingBuilder {
34- return & RoleBindingBuilder {
35- Instance : builder .Instance ,
36- Scheme : builder .Scheme ,
37- }
32+ return & RoleBindingBuilder {builder }
3833}
3934
4035func (builder * RoleBindingBuilder ) UpdateMayRequireStsRecreate () bool {
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import (
2222 "github.com/rabbitmq/cluster-operator/internal/metadata"
2323 corev1 "k8s.io/api/core/v1"
2424 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25- "k8s.io/apimachinery/pkg/runtime"
2625 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
2726)
2827
@@ -31,15 +30,11 @@ const (
3130)
3231
3332type ServiceBuilder struct {
34- Instance * rabbitmqv1beta1.RabbitmqCluster
35- Scheme * runtime.Scheme
33+ * RabbitmqResourceBuilder
3634}
3735
3836func (builder * RabbitmqResourceBuilder ) Service () * ServiceBuilder {
39- return & ServiceBuilder {
40- Instance : builder .Instance ,
41- Scheme : builder .Scheme ,
42- }
37+ return & ServiceBuilder {builder }
4338}
4439
4540func (builder * ServiceBuilder ) Build () (client.Object , error ) {
Original file line number Diff line number Diff line change @@ -11,13 +11,12 @@ package resource
1111
1212import (
1313 "fmt"
14+
1415 "sigs.k8s.io/controller-runtime/pkg/client"
1516
16- rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
1717 "github.com/rabbitmq/cluster-operator/internal/metadata"
1818 corev1 "k8s.io/api/core/v1"
1919 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
20- "k8s.io/apimachinery/pkg/runtime"
2120 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
2221)
2322
@@ -26,15 +25,11 @@ const (
2625)
2726
2827type ServiceAccountBuilder struct {
29- Instance * rabbitmqv1beta1.RabbitmqCluster
30- Scheme * runtime.Scheme
28+ * RabbitmqResourceBuilder
3129}
3230
3331func (builder * RabbitmqResourceBuilder ) ServiceAccount () * ServiceAccountBuilder {
34- return & ServiceAccountBuilder {
35- Instance : builder .Instance ,
36- Scheme : builder .Scheme ,
37- }
32+ return & ServiceAccountBuilder {builder }
3833}
3934
4035func (builder * ServiceAccountBuilder ) Build () (client.Object , error ) {
Original file line number Diff line number Diff line change @@ -38,15 +38,11 @@ const (
3838)
3939
4040type StatefulSetBuilder struct {
41- Instance * rabbitmqv1beta1.RabbitmqCluster
42- Scheme * runtime.Scheme
41+ * RabbitmqResourceBuilder
4342}
4443
4544func (builder * RabbitmqResourceBuilder ) StatefulSet () * StatefulSetBuilder {
46- return & StatefulSetBuilder {
47- Instance : builder .Instance ,
48- Scheme : builder .Scheme ,
49- }
45+ return & StatefulSetBuilder {builder }
5046}
5147
5248func (builder * StatefulSetBuilder ) Build () (client.Object , error ) {
You can’t perform that action at this time.
0 commit comments