Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions internal/alertmanager/currentalert/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ func downScale(ctx context.Context, log logr.Logger, labels model.LabelSet, clie
brokerID = string(broker)
} else {
cruiseControlURL := scale.CruiseControlURLFromKafkaCluster(cr)
// FIXME: we should reuse the context of passed to AController.Start() here
cc, err := scale.NewCruiseControlScaler(context.TODO(), cruiseControlURL)
cc, err := scale.NewCruiseControlScaler(ctx, cruiseControlURL)
if err != nil {
return errors.WrapIfWithDetails(err, "failed to initialize Cruise Control Scaler",
"cruise control url", cruiseControlURL)
Expand Down
5 changes: 2 additions & 3 deletions pkg/resources/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (r *Reconciler) Reconcile(log logr.Logger) error {

func (r *Reconciler) reconcileKafkaPodDelete(ctx context.Context, log logr.Logger) error {
podList := &corev1.PodList{}
err := r.List(context.TODO(), podList,
err := r.List(ctx, podList,
client.InNamespace(r.KafkaCluster.Namespace),
client.MatchingLabels(apiutil.LabelsForKafka(r.KafkaCluster.Name)),
)
Expand Down Expand Up @@ -533,8 +533,7 @@ func (r *Reconciler) reconcileKafkaPodDelete(ctx context.Context, log logr.Logge

if len(podsDeletedFromSpec) > 0 {
if !arePodsAlreadyDeleted(podsDeletedFromSpec, log) {
// FIXME: we should reuse the context of the Kafka Controller
cc, err := r.CruiseControlScalerFactory(context.TODO(), r.KafkaCluster)
cc, err := r.CruiseControlScalerFactory(ctx, r.KafkaCluster)
if err != nil {
return errorfactory.New(errorfactory.CruiseControlNotReady{}, err,
"failed to initialize Cruise Control Scaler", "cruise control url", scale.CruiseControlURLFromKafkaCluster(r.KafkaCluster))
Expand Down
Loading