refactor(controllers): handle transient NotFound when reading listener config secret

This commit is contained in:
Junya Okabe 2026-05-17 02:27:41 +09:00
parent 9e6b88cb30
commit 137040b198
No known key found for this signature in database
GPG Key ID: 6B5D4AAC2A6B2534
1 changed files with 5 additions and 1 deletions

View File

@ -538,8 +538,12 @@ func (r *AutoscalingListenerReconciler) createListenerPod(ctx context.Context, a
var podConfig corev1.Secret
if err := r.Get(ctx, types.NamespacedName{Namespace: autoscalingListener.Namespace, Name: scaleSetListenerConfigName(autoscalingListener)}, &podConfig); err != nil {
if kerrors.IsNotFound(err) {
logger.Info("Listener config secret not yet visible, requeueing", "namespace", autoscalingListener.Namespace, "name", scaleSetListenerConfigName(autoscalingListener))
return ctrl.Result{Requeue: true}, nil
}
logger.Error(err, "Unable to get listener config secret", "namespace", autoscalingListener.Namespace, "name", scaleSetListenerConfigName(autoscalingListener))
return ctrl.Result{Requeue: true}, err
return ctrl.Result{}, err
}
newPod, err := r.newScaleSetListenerPod(autoscalingListener, &podConfig, serviceAccount, metricsConfig, envs...)