Skip to content

Commit dacc99a

Browse files
committed
Add PodDisruptionBudget
Signed-off-by: Yuri Sa <[email protected]>
1 parent 8f6159c commit dacc99a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

controllers/opentelemetrycollector_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (r *OpenTelemetryCollectorReconciler) Reconcile(ctx context.Context, req ct
143143
return ctrl.Result{}, err
144144
}
145145

146-
err = reconcileDesiredObjects(ctx, r.Client, log, &params.OtelCol, params.Scheme, desiredObjects, ownedObjects)
146+
err = reconcileDesiredObjects(ctx, r.Client, log, &instance, params.Scheme, desiredObjects, ownedObjects)
147147
return collectorStatus.HandleReconcileStatus(ctx, log, params, instance, err)
148148
}
149149

internal/api/convert/v1alpha.go

+6
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ func V1Alpha1to2(in v1alpha1.OpenTelemetryCollector) (v1alpha2.OpenTelemetryColl
5050
Pods: m.Pods,
5151
}
5252
}
53+
if copy.Spec.MaxReplicas != nil && copy.Spec.Autoscaler.MaxReplicas == nil {
54+
copy.Spec.Autoscaler.MaxReplicas = copy.Spec.MaxReplicas
55+
}
56+
if copy.Spec.MinReplicas != nil && copy.Spec.Autoscaler.MinReplicas == nil {
57+
copy.Spec.Autoscaler.MinReplicas = copy.Spec.MinReplicas
58+
}
5359
out.Spec.OpenTelemetryCommonFields.Autoscaler = &v1alpha2.AutoscalerSpec{
5460
MinReplicas: copy.Spec.Autoscaler.MinReplicas,
5561
MaxReplicas: copy.Spec.Autoscaler.MaxReplicas,

0 commit comments

Comments
 (0)