Browse Source

IN-290

pull/14/head
Yaroslav Shishnev 4 weeks ago
parent
commit
7d070525ff

+ 11
- 2
pkg/controller/rabbitmq/rabbitmq_controller.go View File

@@ -329,6 +329,15 @@ func (r *ReconcileRabbitmq) Reconcile(request reconcile.Request) (reconcile.Resu
}
}

// reconcile PodDisruptionBudget
reqLogger.Info("Reconciling PodDisruptionBudget")

_, err = r.reconcilePdb(reqLogger, instance)
if err != nil {
raven.CaptureErrorAndWait(err, nil)
return reconcile.Result{}, err
}

_, err = r.reconcileFinalizers(reqLogger, instance)
if err != nil {
raven.CaptureErrorAndWait(err, nil)
@@ -473,8 +482,8 @@ func newStatefulSet(cr *rabbitmqv1.Rabbitmq, secretNames secretResouces) *v1.Sta
},
},
},
Containers: podContainers,
Tolerations: cr.Spec.Tolerations,
Containers: podContainers,
Tolerations: cr.Spec.Tolerations,
NodeSelector: cr.Spec.NodeSelector,
Volumes: []corev1.Volume{
{

+ 3
- 1
pkg/controller/rabbitmq/rabbitmq_pdb.go View File

@@ -13,7 +13,9 @@ import (
rabbitmqv1 "github.com/tekliner/rabbitmq-operator/pkg/apis/rabbitmq/v1"
)

func (r *ReconcileRabbitmq) reconcilePdb(reqLogger logr.Logger, cr *rabbitmqv1.Rabbitmq, pdb *v1beta1policy.PodDisruptionBudget) (reconcile.Result, error) {
func (r *ReconcileRabbitmq) reconcilePdb(reqLogger logr.Logger,
cr *rabbitmqv1.Rabbitmq,
pdb *v1beta1policy.PodDisruptionBudget) (reconcile.Result, error) {
reqLogger.Info("Started reconciling PodDisruptionBudget", "Pdb.Namespace", pdb.Namespace, "Pdb.Name", pdb.Name)

if err := controllerutil.SetControllerReference(cr, pdb, r.scheme); err != nil {

Loading…
Cancel
Save