Commit f0bcffb0 authored by Edmund Ochieng's avatar Edmund Ochieng

add owner reference in hpas

parent ce0968b6
......@@ -635,6 +635,10 @@ func (r *GitLabReconciler) setupAutoscaling(ctx context.Context, cr *gitlabv1bet
if !strings.Contains(deploy.Name, "gitlab-exporter") {
hpa := gitlabctl.HorizontalAutoscaler(&deploy, cr)
if err := controllerutil.SetControllerReference(cr, hpa, r.Scheme); err != nil {
return err
}
found := &autoscalingv1.HorizontalPodAutoscaler{}
err := r.Get(ctx, types.NamespacedName{Name: hpa.Name, Namespace: cr.Namespace}, found)
if err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment