feat(v0.1.59): in-cluster registry:2 — insecure HTTP mode, ImageExists error handling
This commit is contained in:
@@ -115,7 +115,12 @@ func (r *FunctionReconciler) startBuild(ctx context.Context, fn *slessv1alpha1.F
|
||||
|
||||
// Проверяем: образ с этим тегом уже существует в registry?
|
||||
// Если да — пропускаем kaniko, сразу переходим в Ready.
|
||||
if r.Builder.ImageExists(ctx, imageRef) {
|
||||
// Если registry недоступен — requeue, не запускаем сборку (kaniko тоже упадёт).
|
||||
exists, err := r.Builder.ImageExists(ctx, imageRef)
|
||||
if err != nil {
|
||||
return ctrl.Result{RequeueAfter: 10 * time.Second}, fmt.Errorf("check image exists: %w", err)
|
||||
}
|
||||
if exists {
|
||||
logger := log.FromContext(ctx)
|
||||
logger.Info("image already exists in registry, skipping build", "imageRef", imageRef)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user