From 2bc037b66c725bd75f07369d55f54de575bd2952 Mon Sep 17 00:00:00 2001 From: Sergey Yedrikov Date: Mon, 6 Oct 2025 18:41:04 -0400 Subject: [PATCH] OLS-1980: Add autodiscovery for indexID value --- Makefile | 4 ++-- api/v1alpha1/olsconfig_types.go | 4 ++-- .../lightspeed-operator.clusterserviceversion.yaml | 8 ++++---- bundle/manifests/ols.openshift.io_olsconfigs.yaml | 5 +++-- config/crd/bases/ols.openshift.io_olsconfigs.yaml | 5 +++-- .../lightspeed-operator.clusterserviceversion.yaml | 3 ++- docs/olsconfig-ols-openshift-io-v1alpha1.adoc | 2 +- hack/template_bundle.Containerfile | 2 +- test/e2e/byok_test.go | 11 +++++++++++ 9 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index da3f5c248..70e065f57 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ IMAGE_TAG_BASE ?= quay.io/openshift-lightspeed/lightspeed-operator # BUNDLE_TAG defines the version of the bundle. # You can use it as an arg. (E.g make bundle BUNDLE_TAG=0.0.1) -BUNDLE_TAG ?= 1.0.5 +BUNDLE_TAG ?= 1.0.6 # set the base image for docker files # You can use it as an arg. (E.g make bundle BASE_IMG=registry.redhat.io/ubi9/ubi-minimal) @@ -431,4 +431,4 @@ catalog-push: ## Push a catalog image. .PHONY: konflux-release konflux-release: kustomize yq mkdir -p release-konflux - $(KUSTOMIZE) build hack/release-konflux | $(YQ) -s '"release-konflux/" + .metadata.name' \ No newline at end of file + $(KUSTOMIZE) build hack/release-konflux | $(YQ) -s '"release-konflux/" + .metadata.name' diff --git a/api/v1alpha1/olsconfig_types.go b/api/v1alpha1/olsconfig_types.go index 1555c98f2..cb47ee40f 100644 --- a/api/v1alpha1/olsconfig_types.go +++ b/api/v1alpha1/olsconfig_types.go @@ -143,8 +143,8 @@ type RAGSpec struct { // +kubebuilder:default:="/rag/vector_db" // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Index Path in the Image" IndexPath string `json:"indexPath,omitempty"` - // The Index ID of the RAG database - // +kubebuilder:default:="vector_db_index" + // The Index ID of the RAG database. Only needed if there are multiple indices in the database. + // +kubebuilder:default:="" // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Index ID" IndexID string `json:"indexID,omitempty"` // The URL of the container image to use as a RAG source diff --git a/bundle/manifests/lightspeed-operator.clusterserviceversion.yaml b/bundle/manifests/lightspeed-operator.clusterserviceversion.yaml index 0f5d32f7e..98fd14e5d 100644 --- a/bundle/manifests/lightspeed-operator.clusterserviceversion.yaml +++ b/bundle/manifests/lightspeed-operator.clusterserviceversion.yaml @@ -38,7 +38,7 @@ metadata: ] capabilities: Basic Install console.openshift.io/operator-monitoring-default: "true" - createdAt: "2025-10-03T15:49:27Z" + createdAt: "2025-10-10T17:31:05Z" features.operators.openshift.io/cnf: "false" features.operators.openshift.io/cni: "false" features.operators.openshift.io/csi: "false" @@ -97,7 +97,7 @@ spec: - description: List of models from the provider displayName: Models path: llm.providers[0].models - - description: Defines the model's context window size. Default is specific to provider/model. + - description: Defines the model's context window size, in tokens. The default is 128k tokens. displayName: Context Window Size path: llm.providers[0].models[0].contextWindowSize - description: Model name @@ -106,7 +106,7 @@ spec: - description: Model API parameters displayName: Parameters path: llm.providers[0].models[0].parameters - - description: Max tokens for response + - description: Max tokens for response. The default is 2048 tokens. displayName: Max Tokens For Response path: llm.providers[0].models[0].parameters.maxTokensForResponse - description: Model API URL @@ -330,7 +330,7 @@ spec: - description: The URL of the container image to use as a RAG source displayName: Image path: ols.rag[0].image - - description: The Index ID of the RAG database + - description: The Index ID of the RAG database. Only needed if there are multiple indices in the database. displayName: Index ID path: ols.rag[0].indexID - description: The path to the RAG database inside of the container image diff --git a/bundle/manifests/ols.openshift.io_olsconfigs.yaml b/bundle/manifests/ols.openshift.io_olsconfigs.yaml index 872393e9b..11a0875fb 100644 --- a/bundle/manifests/ols.openshift.io_olsconfigs.yaml +++ b/bundle/manifests/ols.openshift.io_olsconfigs.yaml @@ -1031,8 +1031,9 @@ spec: RAG source type: string indexID: - default: vector_db_index - description: The Index ID of the RAG database + default: "" + description: The Index ID of the RAG database. Only needed + if there are multiple indices in the database. type: string indexPath: default: /rag/vector_db diff --git a/config/crd/bases/ols.openshift.io_olsconfigs.yaml b/config/crd/bases/ols.openshift.io_olsconfigs.yaml index 7cd81a033..2215c8c9c 100644 --- a/config/crd/bases/ols.openshift.io_olsconfigs.yaml +++ b/config/crd/bases/ols.openshift.io_olsconfigs.yaml @@ -1031,8 +1031,9 @@ spec: RAG source type: string indexID: - default: vector_db_index - description: The Index ID of the RAG database + default: "" + description: The Index ID of the RAG database. Only needed + if there are multiple indices in the database. type: string indexPath: default: /rag/vector_db diff --git a/config/manifests/bases/lightspeed-operator.clusterserviceversion.yaml b/config/manifests/bases/lightspeed-operator.clusterserviceversion.yaml index 4ed5b3cb8..3954e3006 100644 --- a/config/manifests/bases/lightspeed-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/lightspeed-operator.clusterserviceversion.yaml @@ -304,7 +304,8 @@ spec: - description: The URL of the container image to use as a RAG source displayName: Image path: ols.rag[0].image - - description: The Index ID of the RAG database + - description: The Index ID of the RAG database. Only needed if there are multiple + indices in the database. displayName: Index ID path: ols.rag[0].indexID - description: The path to the RAG database inside of the container image diff --git a/docs/olsconfig-ols-openshift-io-v1alpha1.adoc b/docs/olsconfig-ols-openshift-io-v1alpha1.adoc index abe718684..18f0a40e9 100644 --- a/docs/olsconfig-ols-openshift-io-v1alpha1.adoc +++ b/docs/olsconfig-ols-openshift-io-v1alpha1.adoc @@ -1755,7 +1755,7 @@ Required:: | `indexID` | `string` -| The Index ID of the RAG database +| The Index ID of the RAG database. Only needed if there are multiple indices in the database. | `indexPath` | `string` diff --git a/hack/template_bundle.Containerfile b/hack/template_bundle.Containerfile index 1dd518dc9..0b2f87bf5 100644 --- a/hack/template_bundle.Containerfile +++ b/hack/template_bundle.Containerfile @@ -41,7 +41,7 @@ LABEL version={BUNDLE_VERSION} LABEL summary="Red Hat OpenShift Lightspeed" # OCP compatibility labels -LABEL com.redhat.openshift.versions=v4.16-v4.19 +LABEL com.redhat.openshift.versions=v4.16-v4.20 # Set user to non-root for security reasons. USER 1001 diff --git a/test/e2e/byok_test.go b/test/e2e/byok_test.go index 1e2fba271..91096b46b 100644 --- a/test/e2e/byok_test.go +++ b/test/e2e/byok_test.go @@ -7,6 +7,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" olsv1alpha1 "github.com/openshift/lightspeed-operator/api/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var _ = Describe("BYOK", Ordered, Label("BYOK"), func() { @@ -32,6 +33,16 @@ var _ = Describe("BYOK", Ordered, Label("BYOK"), func() { Expect(err).NotTo(HaveOccurred()) }) + It("should check that the default index ID is empty", FlakeAttempts(5), func() { + olsConfig := &olsv1alpha1.OLSConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: OLSCRName, + }} + err := env.Client.Get(olsConfig) + Expect(err).NotTo(HaveOccurred()) + Expect(olsConfig.Spec.OLSConfig.RAG[0].IndexID).To(BeEmpty()) + }) + It("should query the BYOK database", FlakeAttempts(5), func() { By("Testing OLS service activation") secret, err := TestOLSServiceActivation(env)