feat(v0.1.59): in-cluster registry:2 — insecure HTTP mode, ImageExists error handling

This commit is contained in:
Naeel
2026-03-23 06:41:30 +03:00
parent 9edd43edc5
commit c033adec11
6 changed files with 143 additions and 79 deletions
+6 -1
View File
@@ -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)
+6 -1
View File
@@ -124,7 +124,12 @@ func (r *FunctionJobReconciler) startJobBuild(ctx context.Context, fj *slessv1al
imageRef := r.Builder.ImageRef(r.OperatorNamespace, fj.Name, fj.Spec.S3Key)
// Проверяем: образ с этим тегом уже существует в registry?
if r.Builder.ImageExists(ctx, imageRef) {
// Если registry недоступен — requeue, не запускаем сборку.
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.Info("image already exists in registry, skipping build", "imageRef", imageRef)
if fj.Annotations == nil {
+6 -1
View File
@@ -109,7 +109,12 @@ func (r *ServiceReconciler) startServiceBuild(ctx context.Context, svc *slessv1a
// Проверяем: образ с этим тегом уже существует в registry?
// Если да — пропускаем kaniko, сразу переходим в Ready с известным imageRef.
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)