diff --git a/controllers/worker_controller.go b/controllers/worker_controller.go index f3c5d07f0..eea036b36 100644 --- a/controllers/worker_controller.go +++ b/controllers/worker_controller.go @@ -24,6 +24,7 @@ import ( "github.com/go-logr/logr" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" @@ -216,7 +217,10 @@ func (r *WorkerReconciler) reconcileWhenWorkerReady(ctx context.Context, logger return err } if err = r.Client.Create(ctx, embedder); err != nil { - return err + // Ignore error when already exists + if !k8serrors.IsAlreadyExists(err) { + return err + } } case arcadiaworker.Update: // Skip update when found @@ -237,7 +241,10 @@ func (r *WorkerReconciler) reconcileWhenWorkerReady(ctx context.Context, logger return err } if err = r.Client.Create(ctx, llm); err != nil { - return err + // Ignore error when already exists + if !k8serrors.IsAlreadyExists(err) { + return err + } } case arcadiaworker.Update: // Skip update when found diff --git a/tests/example-test.sh b/tests/example-test.sh index 6db33ea1c..9a5ba1660 100755 --- a/tests/example-test.sh +++ b/tests/example-test.sh @@ -227,15 +227,12 @@ kubectl apply -f config/samples/arcadia_v1alpha1_dataset.yaml kubectl apply -f config/samples/arcadia_v1alpha1_versioneddataset.yaml waitCRDStatusReady "VersionedDataset" "arcadia" "dataset-playground-v1" -info "7.3 create embedder and wait it ready" -kubectl apply -f config/samples/arcadia_v1alpha1_embedders.yaml -waitCRDStatusReady "Embedders" "arcadia" "zhipuai-embedders-sample" -info "7.4 create knowledgebase and wait it ready" +info "7.3 create knowledgebase and wait it ready" kubectl apply -f config/samples/arcadia_v1alpha1_knowledgebase.yaml waitCRDStatusReady "KnowledgeBase" "arcadia" "knowledgebase-sample" -info "7.5 check this vectorstore has data" +info "7.4 check this vectorstore has data" kubectl port-forward -n arcadia svc/chroma-chromadb 8000:8000 >/dev/null 2>&1 & chroma_pid=$! info "port-forward chroma in pid: $minio_pid"