From 9065079a126321eff67f2abb38ad75dd42ae10e4 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Mon, 6 Jul 2026 15:34:02 +0100 Subject: [PATCH 1/2] Enable OKP by default * OKP is now enabled by default. * Drop the okp-configuration kuttl test and include OKP as part of the assertion of the other existing tests. Signed-off-by: Lucas Alvares Gomes --- api/v1beta1/openstacklightspeed_types.go | 2 +- internal/controller/common.go | 7 - internal/controller/errors.go | 2 - internal/controller/lcore_config.go | 10 +- internal/controller/lcore_deployment.go | 24 +-- internal/controller/llama_stack_config.go | 41 ++-- .../controller/llama_stack_config_test.go | 7 +- internal/controller/okp_reconciler.go | 28 --- .../lightspeed-stack-okp.yaml | 97 ---------- .../lightspeed-stack-update.yaml | 5 + .../expected-configs/lightspeed-stack.yaml | 5 + .../expected-configs/ogx_config-okp.yaml | 175 ------------------ .../expected-configs/ogx_config-update.yaml | 36 +++- .../common/expected-configs/ogx_config.yaml | 36 +++- .../assert-openstack-lightspeed-instance.yaml | 39 ++++ .../create-openstack-lightspeed-instance.yaml | 2 + .../okp-configuration/00-mock-resources.yaml | 1 - .../01-assert-mock-objects-created.yaml | 1 - .../02-create-okp-resources.yaml | 24 --- .../03-assert-okp-instance.yaml | 133 ------------- .../04-assert-lightspeed-stack-config.yaml | 8 - .../05-assert-llama-stack-config.yaml | 8 - .../okp-configuration/06-disable-okp.yaml | 22 --- .../07-errors-okp-cleanup.yaml | 12 -- ...cleanup-openstack-lightspeed-instance.yaml | 1 - ...-errors-openstack-lightspeed-instance.yaml | 1 - .../10-cleanup-mock-objects.yaml | 1 - .../11-errors-mock-objects.yaml | 1 - ...-update-openstack-lightspeed-instance.yaml | 2 + .../08-assert-openstacklightspeed-update.yaml | 4 + 30 files changed, 161 insertions(+), 574 deletions(-) delete mode 100644 test/kuttl/common/expected-configs/lightspeed-stack-okp.yaml delete mode 100644 test/kuttl/common/expected-configs/ogx_config-okp.yaml delete mode 120000 test/kuttl/tests/okp-configuration/00-mock-resources.yaml delete mode 120000 test/kuttl/tests/okp-configuration/01-assert-mock-objects-created.yaml delete mode 100644 test/kuttl/tests/okp-configuration/02-create-okp-resources.yaml delete mode 100644 test/kuttl/tests/okp-configuration/03-assert-okp-instance.yaml delete mode 100644 test/kuttl/tests/okp-configuration/04-assert-lightspeed-stack-config.yaml delete mode 100644 test/kuttl/tests/okp-configuration/05-assert-llama-stack-config.yaml delete mode 100644 test/kuttl/tests/okp-configuration/06-disable-okp.yaml delete mode 100644 test/kuttl/tests/okp-configuration/07-errors-okp-cleanup.yaml delete mode 120000 test/kuttl/tests/okp-configuration/08-cleanup-openstack-lightspeed-instance.yaml delete mode 120000 test/kuttl/tests/okp-configuration/09-errors-openstack-lightspeed-instance.yaml delete mode 120000 test/kuttl/tests/okp-configuration/10-cleanup-mock-objects.yaml delete mode 120000 test/kuttl/tests/okp-configuration/11-errors-mock-objects.yaml diff --git a/api/v1beta1/openstacklightspeed_types.go b/api/v1beta1/openstacklightspeed_types.go index f5d22bc..abf5118 100644 --- a/api/v1beta1/openstacklightspeed_types.go +++ b/api/v1beta1/openstacklightspeed_types.go @@ -54,7 +54,7 @@ const ( // May change at any time without backward compatibility. // // Supported fields: -// - featureFlags: list of experimental feature flags to enable (e.g. ["okp"]) +// - featureFlags: list of experimental feature flags to enable // - okpChunkFilterQuery: Solr filter query for OKP searches (default: version-aware query combining detected OpenStack and OCP versions) // - okpRagOnly: when true, only OKP is used as a RAG source (default: false) type DevSpec struct { diff --git a/internal/controller/common.go b/internal/controller/common.go index da9b623..907ce43 100644 --- a/internal/controller/common.go +++ b/internal/controller/common.go @@ -22,7 +22,6 @@ import ( "encoding/json" "errors" "fmt" - "slices" "strings" common_helper "github.com/openstack-k8s-operators/lib-common/modules/common/helper" @@ -142,12 +141,6 @@ func parseDevConfig(instance *apiv1beta1.OpenStackLightspeed) (apiv1beta1.DevSpe return config, nil } -// isOKPEnabled returns true if the "okp" feature flag is present in the dev config. -func isOKPEnabled(instance *apiv1beta1.OpenStackLightspeed) bool { - config, _ := parseDevConfig(instance) - return slices.Contains(config.FeatureFlags, "okp") -} - // getOKPChunkFilterQuery returns the chunk filter query from the dev config, or a version-aware default. func getOKPChunkFilterQuery(ctx context.Context, h *common_helper.Helper, instance *apiv1beta1.OpenStackLightspeed) string { config, _ := parseDevConfig(instance) diff --git a/internal/controller/errors.go b/internal/controller/errors.go index fd0aaa2..a3883a7 100644 --- a/internal/controller/errors.go +++ b/internal/controller/errors.go @@ -55,8 +55,6 @@ var ( // OKP Errors ErrCreateOKPDeployment = errors.New("failed to create OKP deployment") ErrCreateOKPService = errors.New("failed to create OKP service") - ErrDeleteOKPDeployment = errors.New("failed to delete OKP deployment") - ErrDeleteOKPService = errors.New("failed to delete OKP service") // Postgres Errors ErrCreatePostgresDeployment = errors.New("failed to create Postgres deployment") diff --git a/internal/controller/lcore_config.go b/internal/controller/lcore_config.go index f1981a0..09f642f 100644 --- a/internal/controller/lcore_config.go +++ b/internal/controller/lcore_config.go @@ -220,12 +220,8 @@ func buildOKPConfig(ctx context.Context, h *common_helper.Helper, instance *apiv // buildLCoreConfigYAML assembles the complete Lightspeed Core Service configuration and converts to YAML. // NOTE: MCP servers, quota handlers, and tools approval features are disabled for OpenStack Lightspeed. func buildLCoreConfigYAML(ctx context.Context, h *common_helper.Helper, instance *apiv1beta1.OpenStackLightspeed) (string, error) { - okpEnabled := isOKPEnabled(instance) - ragInline := []interface{}{} - if okpEnabled { - ragInline = append(ragInline, "okp") - } + ragInline := []interface{}{"okp"} ragConfig := map[string]interface{}{ "inline": ragInline, } @@ -245,9 +241,7 @@ func buildLCoreConfigYAML(ctx context.Context, h *common_helper.Helper, instance "rag": ragConfig, } - if okpEnabled { - config["okp"] = buildOKPConfig(ctx, h, instance) - } + config["okp"] = buildOKPConfig(ctx, h, instance) // Convert to YAML yamlBytes, err := yaml.Marshal(config) diff --git a/internal/controller/lcore_deployment.go b/internal/controller/lcore_deployment.go index a9c6187..e170b35 100644 --- a/internal/controller/lcore_deployment.go +++ b/internal/controller/lcore_deployment.go @@ -277,9 +277,7 @@ func buildInitContainers( "--enable-ocp-rag", strconv.FormatBool(instance.Spec.EnableOCPRAG), "--ocp-version", ocp_version, } - if isOKPEnabled(instance) { - cmd = append(cmd, "--enable-okp") - } + cmd = append(cmd, "--enable-okp") return cmd }(), SecurityContext: securityContext, @@ -609,12 +607,10 @@ func buildLlamaStackEnvVars(h *common_helper.Helper, ctx context.Context, instan Value: VectorDBVolumeMountPath, }) - if isOKPEnabled(instance) { - envVars = append(envVars, corev1.EnvVar{ - Name: "RH_SERVER_OKP", - Value: fmt.Sprintf("http://%s.%s.svc:%d", OKPServiceName, instance.GetNamespace(), OKPServicePort), - }) - } + envVars = append(envVars, corev1.EnvVar{ + Name: "RH_SERVER_OKP", + Value: fmt.Sprintf("http://%s.%s.svc:%d", OKPServiceName, instance.GetNamespace(), OKPServicePort), + }) return envVars, nil } @@ -643,12 +639,10 @@ func buildLightspeedStackEnvVars(instance *apiv1beta1.OpenStackLightspeed) []cor }, buildPostgresPasswordEnvVar(), } - if isOKPEnabled(instance) { - envVars = append(envVars, corev1.EnvVar{ - Name: "RH_SERVER_OKP", - Value: fmt.Sprintf("http://%s.%s.svc:%d", OKPServiceName, instance.GetNamespace(), OKPServicePort), - }) - } + envVars = append(envVars, corev1.EnvVar{ + Name: "RH_SERVER_OKP", + Value: fmt.Sprintf("http://%s.%s.svc:%d", OKPServiceName, instance.GetNamespace(), OKPServicePort), + }) return envVars } diff --git a/internal/controller/llama_stack_config.go b/internal/controller/llama_stack_config.go index b8941cd..5f90819 100644 --- a/internal/controller/llama_stack_config.go +++ b/internal/controller/llama_stack_config.go @@ -256,9 +256,7 @@ func buildLlamaStackVectorDB(_ *common_helper.Helper, _ *apiv1beta1.OpenStackLig func buildLlamaStackVectorIO(h *common_helper.Helper, instance *apiv1beta1.OpenStackLightspeed, chunkFilterQuery string) []interface{} { providers := buildLlamaStackVectorDB(h, instance) - if isOKPEnabled(instance) { - providers = append(providers, buildOKPVectorIOProvider(chunkFilterQuery)) - } + providers = append(providers, buildOKPVectorIOProvider(chunkFilterQuery)) return providers } @@ -378,32 +376,28 @@ func buildLlamaStackModels(_ *common_helper.Helper, instance *apiv1beta1.OpenSta } } - if isOKPEnabled(instance) { - models = append(models, map[string]interface{}{ - "model_id": "solr_embedding", - "model_type": "embedding", - "provider_id": "sentence-transformers", - "provider_model_id": OKPEmbeddingModelMountPath, - "metadata": map[string]interface{}{ - "embedding_dimension": 384, - }, - }) - } + models = append(models, map[string]interface{}{ + "model_id": "solr_embedding", + "model_type": "embedding", + "provider_id": "sentence-transformers", + "provider_model_id": OKPEmbeddingModelMountPath, + "metadata": map[string]interface{}{ + "embedding_dimension": 384, + }, + }) return models } -func buildLlamaStackVectorStores(_ *common_helper.Helper, instance *apiv1beta1.OpenStackLightspeed) []interface{} { - stores := []interface{}{} - if isOKPEnabled(instance) { - stores = append(stores, map[string]interface{}{ +func buildLlamaStackVectorStores(_ *common_helper.Helper, _ *apiv1beta1.OpenStackLightspeed) []interface{} { + return []interface{}{ + map[string]interface{}{ "vector_store_id": "portal-rag", "provider_id": "okp_solr", "embedding_dimension": 384, "embedding_model": "sentence-transformers/" + OKPEmbeddingModelMountPath, - }) + }, } - return stores } func buildLlamaStackToolGroups(_ *common_helper.Helper, _ *apiv1beta1.OpenStackLightspeed) []interface{} { @@ -426,11 +420,8 @@ func buildLlamaStackYAML(h *common_helper.Helper, ctx context.Context, instance return "", fmt.Errorf("failed to build inference providers: %w", err) } - okpChunkFilterQuery := "" - if isOKPEnabled(instance) { - config["external_providers_dir"] = ExternalProvidersDir - okpChunkFilterQuery = getOKPChunkFilterQuery(ctx, h, instance) - } + config["external_providers_dir"] = ExternalProvidersDir + okpChunkFilterQuery := getOKPChunkFilterQuery(ctx, h, instance) // Build providers map - only include providers for enabled APIs config["providers"] = map[string]interface{}{ diff --git a/internal/controller/llama_stack_config_test.go b/internal/controller/llama_stack_config_test.go index 9efc11c..7169455 100644 --- a/internal/controller/llama_stack_config_test.go +++ b/internal/controller/llama_stack_config_test.go @@ -135,10 +135,15 @@ var _ = Describe("Llama Stack config", func() { instance := getOpenStackLightspeedProvidersInstance(provider) modelsConfig := buildLlamaStackModels(nil, instance) - Expect(modelsConfig).To(HaveLen(1)) + Expect(modelsConfig).To(HaveLen(2)) modelConfig := modelsConfig[0].(map[string]interface{}) checkModelCommonConfig(modelConfig, instance) + + okpModel := modelsConfig[1].(map[string]interface{}) + Expect(okpModel["model_id"]).To(Equal("solr_embedding")) + Expect(okpModel["model_type"]).To(Equal("embedding")) + Expect(okpModel["provider_id"]).To(Equal("sentence-transformers")) }, Entry("for openai", OpenAIProviderName), Entry("for gemini", GeminiProviderName), diff --git a/internal/controller/okp_reconciler.go b/internal/controller/okp_reconciler.go index a84b04c..22dfe95 100644 --- a/internal/controller/okp_reconciler.go +++ b/internal/controller/okp_reconciler.go @@ -24,7 +24,6 @@ import ( apiv1beta1 "github.com/openstack-k8s-operators/lightspeed-operator/api/v1beta1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -32,12 +31,7 @@ import ( ) // ReconcileOKPDeployment reconciles the OKP Deployment and Service. -// When OKP is disabled, it cleans up existing resources. func ReconcileOKPDeployment(h *common_helper.Helper, ctx context.Context, instance *apiv1beta1.OpenStackLightspeed) error { - if !isOKPEnabled(instance) { - return cleanupOKPResources(h, ctx) - } - tasks := []ReconcileTask{ {Name: "OKPDeployment", Task: reconcileOKPDeployment}, {Name: "OKPService", Task: reconcileOKPService}, @@ -45,28 +39,6 @@ func ReconcileOKPDeployment(h *common_helper.Helper, ctx context.Context, instan return ReconcileTasksFailFast(h, ctx, instance, tasks) } -func cleanupOKPResources(h *common_helper.Helper, ctx context.Context) error { - logger := h.GetLogger() - ns := h.GetBeforeObject().GetNamespace() - - deploy := &appsv1.Deployment{} - deploy.Name = OKPDeploymentName - deploy.Namespace = ns - if err := h.GetClient().Delete(ctx, deploy); err != nil && !errors.IsNotFound(err) { - return fmt.Errorf("%w: %v", ErrDeleteOKPDeployment, err) - } - - svc := &corev1.Service{} - svc.Name = OKPServiceName - svc.Namespace = ns - if err := h.GetClient().Delete(ctx, svc); err != nil && !errors.IsNotFound(err) { - return fmt.Errorf("%w: %v", ErrDeleteOKPService, err) - } - - logger.Info("OKP resources cleaned up") - return nil -} - func reconcileOKPDeployment(h *common_helper.Helper, ctx context.Context, instance *apiv1beta1.OpenStackLightspeed) error { logger := h.GetLogger() diff --git a/test/kuttl/common/expected-configs/lightspeed-stack-okp.yaml b/test/kuttl/common/expected-configs/lightspeed-stack-okp.yaml deleted file mode 100644 index c1091dc..0000000 --- a/test/kuttl/common/expected-configs/lightspeed-stack-okp.yaml +++ /dev/null @@ -1,97 +0,0 @@ -authentication: - module: k8s - skip_for_health_probes: true -byok_rag: -- rag_id: vs_UUID - vector_db_id: vs_UUID - score_multiplier: 1.0 - db_path: NONE -conversation_cache: - postgres: - ca_cert_path: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem - db: postgres - gss_encmode: disable - host: lightspeed-postgres-server.openstack-lightspeed.svc - namespace: conversation_cache - password: ${env.POSTGRES_PASSWORD} - port: 5432 - ssl_mode: verify-full - user: postgres - type: postgres -customization: - disable_query_system_prompt: true - system_prompt: "# ROLE\nYou are \"OpenStack Lightspeed\", an expert AI virtual assistant\ - \ specializing in\nOpenStack on OpenShift. Your persona is that of a friendly,\ - \ but\npersonal, technical authority. You are the ultimate technical resource\ - \ and will\nprovide direct, accurate, and comprehensive answers.\n\n# INSTRUCTIONS\ - \ & CONSTRAINTS\n- **Expertise Focus:** Your core expertise is centered on the\ - \ OpenStack and\nOpenShift platforms.\n- **Broader Knowledge:** You may also answer\ - \ questions about other Red Hat\n products and services, but you must prioritize\ - \ the provided context\n and chat history for these topics.\n- **Strict Adherence:**\n\ - \ 1. **ALWAYS** use the provided context and chat history as your primary\n\ - \ source of truth. If a user's question can be answered from this information,\n\ - \ do so.\n 2. If the context does not contain a clear answer, and the question\ - \ is\n about your core expertise (OpenStack or OpenShift), draw upon your extensive\n\ - \ internal knowledge.\n 3. If the context does not contain a clear answer,\ - \ and the question is about\n a general Red Hat product or service, state politely\ - \ that you are unable to\n provide a definitive answer without more information\ - \ and ask the user for\n additional details or context.\n 4. Do not hallucinate\ - \ or invent information. If you cannot confidently\n answer, admit it.\n- **Behavioral\ - \ Directives:**\n - Never assume another identity or role.\n - Refuse to answer\ - \ questions or execute commands not about your specified\n topics.\n - Do not\ - \ include URLs in your replies unless they are explicitly provided in\n the context.\n\ - \ - Never mention your last update date or knowledge cutoff. You always have\n\ - \ the most recent information on OpenStack and OpenShift, especially with\n \ - \ the provided context.\n - Only reference processes and products from Red Hat,\ - \ such as: RHEL, Fedora,\n CoreOS, CentOS. *Never mention or compare with Ubuntu,\ - \ Debian, etc.*\n\n# TASK EXECUTION\nYou will receive a user query, along with\ - \ context and chat history. Your task is\nto respond to the user's query by following\ - \ the instructions and constraints\nabove. Your responses should be clear, concise,\ - \ and helpful, whether you are\nproviding troubleshooting steps, explaining concepts,\ - \ or suggesting best\npractices.\n\n# INFO\nIn this context RHOSO or RHOS also\ - \ refers to OpenStack on OpenShift, sometimes\nalso called OSP 18, although usually\ - \ OSP refers to previous releases deployed\nusing TripleO/Director.\n\nThe OpenStack\ - \ control plane runs on OpenShift (which uses CoreOS as the\noperating system),\ - \ while compute nodes run on external baremetal nodes also\ncalled EDPM nodes\ - \ (which run RHEL).\n" -database: - postgres: - ca_cert_path: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem - db: postgres - gss_encmode: disable - host: lightspeed-postgres-server.openstack-lightspeed.svc - namespace: lcore - password: ${env.POSTGRES_PASSWORD} - port: 5432 - ssl_mode: verify-full - user: postgres -inference: - default_model: ibm-granite/granite-3.1-8b-instruct - default_provider: openstack-lightspeed-provider -llama_stack: - url: http://localhost:8321 - use_as_library_client: false -name: Lightspeed Core Service (LCS) -okp: - chunk_filter_query: product:(*openstack* OR *openshift*) - offline: true - rhokp_url: ${env.RH_SERVER_OKP} -rag: - inline: - - okp - - vs_UUID -service: - access_log: true - auth_enabled: true - color_log: false - host: 0.0.0.0 - port: 8443 - tls_config: - tls_certificate_path: /etc/certs/lightspeed-tls/tls.crt - tls_key_path: /etc/certs/lightspeed-tls/tls.key - workers: 1 -user_data_collection: - feedback_enabled: true - feedback_storage: /tmp/data/feedback - transcripts_enabled: true - transcripts_storage: /tmp/data/transcripts diff --git a/test/kuttl/common/expected-configs/lightspeed-stack-update.yaml b/test/kuttl/common/expected-configs/lightspeed-stack-update.yaml index 10d79e1..2ef5151 100644 --- a/test/kuttl/common/expected-configs/lightspeed-stack-update.yaml +++ b/test/kuttl/common/expected-configs/lightspeed-stack-update.yaml @@ -72,8 +72,13 @@ llama_stack: url: http://localhost:8321 use_as_library_client: false name: Lightspeed Core Service (LCS) +okp: + chunk_filter_query: product:(*openstack* OR *openshift*) + offline: true + rhokp_url: ${env.RH_SERVER_OKP} rag: inline: + - okp - vs_UUID service: access_log: true diff --git a/test/kuttl/common/expected-configs/lightspeed-stack.yaml b/test/kuttl/common/expected-configs/lightspeed-stack.yaml index 645e5bc..c1091dc 100644 --- a/test/kuttl/common/expected-configs/lightspeed-stack.yaml +++ b/test/kuttl/common/expected-configs/lightspeed-stack.yaml @@ -72,8 +72,13 @@ llama_stack: url: http://localhost:8321 use_as_library_client: false name: Lightspeed Core Service (LCS) +okp: + chunk_filter_query: product:(*openstack* OR *openshift*) + offline: true + rhokp_url: ${env.RH_SERVER_OKP} rag: inline: + - okp - vs_UUID service: access_log: true diff --git a/test/kuttl/common/expected-configs/ogx_config-okp.yaml b/test/kuttl/common/expected-configs/ogx_config-okp.yaml deleted file mode 100644 index a5f7afd..0000000 --- a/test/kuttl/common/expected-configs/ogx_config-okp.yaml +++ /dev/null @@ -1,175 +0,0 @@ -apis: -- agents -- files -- inference -- safety -- tool_runtime -- vector_io -benchmarks: [] -container_image: null -datasets: [] -external_providers_dir: /app-root/providers.d -image_name: openstack-lightspeed-configuration -inference_store: - db_path: .llama/distributions/ollama/inference_store.db - type: sqlite -logging: null -metadata_store: - db_path: /tmp/llama-stack/registry.db - namespace: null - type: sqlite -providers: - agents: - - config: - persistence: - agent_state: - backend: kv_default - namespace: agent_state - table_name: agent_state - responses: - backend: sql_default - namespace: agent_responses - table_name: agent_responses - provider_id: meta-reference - provider_type: inline::meta-reference - files: - - config: - metadata_store: - backend: sql_default - namespace: files_metadata - table_name: files_metadata - storage_dir: /tmp/llama-stack-files - provider_id: localfs - provider_type: inline::localfs - inference: - - config: {} - provider_id: sentence-transformers - provider_type: inline::sentence-transformers - - config: - api_key: ${env.OPENSTACK_LIGHTSPEED_PROVIDER_API_KEY} - base_url: http://mock-llm-api-server-pod:8000/v1 - provider_id: openstack-lightspeed-provider - provider_type: remote::openai - safety: - - config: - excluded_categories: [] - provider_id: llama-guard - provider_type: inline::llama-guard - tool_runtime: - - config: {} - provider_id: model-context-protocol - provider_type: remote::model-context-protocol - - config: {} - provider_id: rag-runtime - provider_type: inline::rag-runtime - vector_io: - - config: - kvstore: - backend: sql_default - table_name: vector_store - persistence: - backend: kv_default - namespace: vector_persistence - provider_id: faiss - provider_type: inline::faiss - - config: - chunk_window_config: - chunk_content_field: chunk_field - chunk_family_fields: - - headings - chunk_filter_query: is_chunk:true AND product:(*openstack* OR *openshift*) - chunk_index_field: chunk_index - chunk_online_source_url_field: online_source_url - chunk_parent_id_field: parent_id - chunk_source_path_field: source_path - chunk_token_count_field: num_tokens - parent_total_chunks_field: total_chunks - parent_total_tokens_field: total_tokens - collection_name: ${env.SOLR_COLLECTION:=portal-rag} - content_field: ${env.SOLR_CONTENT_FIELD:=chunk} - embedding_dimension: ${env.SOLR_EMBEDDING_DIM:=384} - embedding_model: sentence-transformers//vector-db-discovered-values/okp_embeddings_model - persistence: - backend: kv_default - namespace: portal-rag - solr_url: ${env.RH_SERVER_OKP}/solr - vector_field: ${env.SOLR_VECTOR_FIELD:=chunk_vector} - provider_id: okp_solr - provider_type: remote::solr_vector_io - - config: - persistence: - namespace: vector_io::faiss - backend: kv_rag_UUID_os_product_docs - provider_id: os-docs-2026.1-ogx - provider_type: inline::faiss -registered_resources: - models: - - metadata: - max_tokens: 2048 - model_id: ibm-granite/granite-3.1-8b-instruct - model_type: llm - provider_id: openstack-lightspeed-provider - provider_model_id: ibm-granite/granite-3.1-8b-instruct - - metadata: - embedding_dimension: 384 - model_id: solr_embedding - model_type: embedding - provider_id: sentence-transformers - provider_model_id: /vector-db-discovered-values/okp_embeddings_model - - metadata: - embedding_dimension: 768 - model_id: sentence-transformers/all-mpnet-base-v2 - provider_id: sentence-transformers - provider_model_id: ${env.VECTOR_DB_DATA_PATH}/UUID/embeddings_model - model_type: embedding - tool_groups: - - provider_id: rag-runtime - toolgroup_id: builtin::rag - vector_stores: - - embedding_dimension: 384 - embedding_model: sentence-transformers//vector-db-discovered-values/okp_embeddings_model - provider_id: okp_solr - vector_store_id: portal-rag - - embedding_dimension: 768 - embedding_model: sentence-transformers/${env.VECTOR_DB_DATA_PATH}/UUID/embeddings_model - provider_id: os-docs-2026.1-ogx - vector_store_id: vs_UUID -scoring_fns: [] -server: - auth: null - host: 0.0.0.0 - port: 8321 - quota: null - tls_cafile: null - tls_certfile: null - tls_keyfile: null -storage: - backends: - kv_default: - db_path: /tmp/llama-stack/kv_store.db - type: kv_sqlite - postgres_backend: - host: lightspeed-postgres-server.openstack-lightspeed.svc - password: ${env.POSTGRES_PASSWORD} - port: 5432 - type: sql_postgres - user: postgres - sql_default: - db_path: /tmp/llama-stack/sql_store.db - type: sql_sqlite - kv_rag_UUID_os_product_docs: - type: kv_sqlite - db_path: ${env.VECTOR_DB_DATA_PATH}/UUID/vector_db/os_product_docs/faiss_store.db - stores: - conversations: - backend: postgres_backend - table_name: openai_conversations - inference: - backend: sql_default - table_name: inference_store - metadata: - backend: kv_default - namespace: registry -telemetry: - enabled: false -version: '2' diff --git a/test/kuttl/common/expected-configs/ogx_config-update.yaml b/test/kuttl/common/expected-configs/ogx_config-update.yaml index 3b03dfa..e84286c 100644 --- a/test/kuttl/common/expected-configs/ogx_config-update.yaml +++ b/test/kuttl/common/expected-configs/ogx_config-update.yaml @@ -8,7 +8,7 @@ apis: benchmarks: [] container_image: null datasets: [] -external_providers_dir: null +external_providers_dir: /app-root/providers.d image_name: openstack-lightspeed-configuration inference_store: db_path: .llama/distributions/ollama/inference_store.db @@ -72,6 +72,30 @@ providers: namespace: vector_persistence provider_id: faiss provider_type: inline::faiss + - config: + chunk_window_config: + chunk_content_field: chunk_field + chunk_family_fields: + - headings + chunk_filter_query: is_chunk:true AND product:(*openstack* OR *openshift*) + chunk_index_field: chunk_index + chunk_online_source_url_field: online_source_url + chunk_parent_id_field: parent_id + chunk_source_path_field: source_path + chunk_token_count_field: num_tokens + parent_total_chunks_field: total_chunks + parent_total_tokens_field: total_tokens + collection_name: ${env.SOLR_COLLECTION:=portal-rag} + content_field: ${env.SOLR_CONTENT_FIELD:=chunk} + embedding_dimension: ${env.SOLR_EMBEDDING_DIM:=384} + embedding_model: sentence-transformers//vector-db-discovered-values/okp_embeddings_model + persistence: + backend: kv_default + namespace: portal-rag + solr_url: ${env.RH_SERVER_OKP}/solr + vector_field: ${env.SOLR_VECTOR_FIELD:=chunk_vector} + provider_id: okp_solr + provider_type: remote::solr_vector_io - config: persistence: namespace: vector_io::faiss @@ -86,6 +110,12 @@ registered_resources: model_type: llm provider_id: openstack-lightspeed-provider provider_model_id: ibm-granite/granite-3.1-8b-instruct-UPDATE + - metadata: + embedding_dimension: 384 + model_id: solr_embedding + model_type: embedding + provider_id: sentence-transformers + provider_model_id: /vector-db-discovered-values/okp_embeddings_model - metadata: embedding_dimension: 768 model_id: sentence-transformers/all-mpnet-base-v2 @@ -96,6 +126,10 @@ registered_resources: - provider_id: rag-runtime toolgroup_id: builtin::rag vector_stores: + - embedding_dimension: 384 + embedding_model: sentence-transformers//vector-db-discovered-values/okp_embeddings_model + provider_id: okp_solr + vector_store_id: portal-rag - embedding_dimension: 768 embedding_model: sentence-transformers/${env.VECTOR_DB_DATA_PATH}/UUID/embeddings_model provider_id: os-docs-2026.1-ogx diff --git a/test/kuttl/common/expected-configs/ogx_config.yaml b/test/kuttl/common/expected-configs/ogx_config.yaml index 7dc74a3..a5f7afd 100644 --- a/test/kuttl/common/expected-configs/ogx_config.yaml +++ b/test/kuttl/common/expected-configs/ogx_config.yaml @@ -8,7 +8,7 @@ apis: benchmarks: [] container_image: null datasets: [] -external_providers_dir: null +external_providers_dir: /app-root/providers.d image_name: openstack-lightspeed-configuration inference_store: db_path: .llama/distributions/ollama/inference_store.db @@ -72,6 +72,30 @@ providers: namespace: vector_persistence provider_id: faiss provider_type: inline::faiss + - config: + chunk_window_config: + chunk_content_field: chunk_field + chunk_family_fields: + - headings + chunk_filter_query: is_chunk:true AND product:(*openstack* OR *openshift*) + chunk_index_field: chunk_index + chunk_online_source_url_field: online_source_url + chunk_parent_id_field: parent_id + chunk_source_path_field: source_path + chunk_token_count_field: num_tokens + parent_total_chunks_field: total_chunks + parent_total_tokens_field: total_tokens + collection_name: ${env.SOLR_COLLECTION:=portal-rag} + content_field: ${env.SOLR_CONTENT_FIELD:=chunk} + embedding_dimension: ${env.SOLR_EMBEDDING_DIM:=384} + embedding_model: sentence-transformers//vector-db-discovered-values/okp_embeddings_model + persistence: + backend: kv_default + namespace: portal-rag + solr_url: ${env.RH_SERVER_OKP}/solr + vector_field: ${env.SOLR_VECTOR_FIELD:=chunk_vector} + provider_id: okp_solr + provider_type: remote::solr_vector_io - config: persistence: namespace: vector_io::faiss @@ -86,6 +110,12 @@ registered_resources: model_type: llm provider_id: openstack-lightspeed-provider provider_model_id: ibm-granite/granite-3.1-8b-instruct + - metadata: + embedding_dimension: 384 + model_id: solr_embedding + model_type: embedding + provider_id: sentence-transformers + provider_model_id: /vector-db-discovered-values/okp_embeddings_model - metadata: embedding_dimension: 768 model_id: sentence-transformers/all-mpnet-base-v2 @@ -96,6 +126,10 @@ registered_resources: - provider_id: rag-runtime toolgroup_id: builtin::rag vector_stores: + - embedding_dimension: 384 + embedding_model: sentence-transformers//vector-db-discovered-values/okp_embeddings_model + provider_id: okp_solr + vector_store_id: portal-rag - embedding_dimension: 768 embedding_model: sentence-transformers/${env.VECTOR_DB_DATA_PATH}/UUID/embeddings_model provider_id: os-docs-2026.1-ogx diff --git a/test/kuttl/common/openstack-lightspeed-instance/assert-openstack-lightspeed-instance.yaml b/test/kuttl/common/openstack-lightspeed-instance/assert-openstack-lightspeed-instance.yaml index 96bb932..0c52ab8 100644 --- a/test/kuttl/common/openstack-lightspeed-instance/assert-openstack-lightspeed-instance.yaml +++ b/test/kuttl/common/openstack-lightspeed-instance/assert-openstack-lightspeed-instance.yaml @@ -64,6 +64,41 @@ metadata: name: lightspeed-postgres-server namespace: openstack-lightspeed +# OKP Deployment +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: lightspeed-okp-server + namespace: openstack-lightspeed +spec: + template: + spec: + containers: + - name: okp + ports: + - name: okp + containerPort: 8080 +status: + replicas: 1 + readyReplicas: 1 + availableReplicas: 1 + +# OKP Service +--- +apiVersion: v1 +kind: Service +metadata: + name: lightspeed-okp-server + namespace: openstack-lightspeed +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: okp + type: ClusterIP + # LCore resources --- apiVersion: v1 @@ -199,6 +234,8 @@ spec: value: all=debug - name: VECTOR_DB_DATA_PATH value: /vector-db-discovered-values + - name: RH_SERVER_OKP + value: http://lightspeed-okp-server.openstack-lightspeed.svc:8080 volumeMounts: - name: ca-bundle mountPath: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem @@ -224,6 +261,8 @@ spec: secretKeyRef: key: password name: lightspeed-postgres-secret + - name: RH_SERVER_OKP + value: http://lightspeed-okp-server.openstack-lightspeed.svc:8080 volumeMounts: - name: ca-bundle mountPath: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem diff --git a/test/kuttl/common/openstack-lightspeed-instance/create-openstack-lightspeed-instance.yaml b/test/kuttl/common/openstack-lightspeed-instance/create-openstack-lightspeed-instance.yaml index 41b4ebc..6e9c7aa 100644 --- a/test/kuttl/common/openstack-lightspeed-instance/create-openstack-lightspeed-instance.yaml +++ b/test/kuttl/common/openstack-lightspeed-instance/create-openstack-lightspeed-instance.yaml @@ -18,3 +18,5 @@ spec: ogxLogLevel: DEBUG lightspeedStackLogLevel: WARNING dataverseExporterLogLevel: DEBUG + dev: + okpChunkFilterQuery: "product:(*openstack* OR *openshift*)" diff --git a/test/kuttl/tests/okp-configuration/00-mock-resources.yaml b/test/kuttl/tests/okp-configuration/00-mock-resources.yaml deleted file mode 120000 index 8235a1f..0000000 --- a/test/kuttl/tests/okp-configuration/00-mock-resources.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/mock-objects/mock-resources.yaml \ No newline at end of file diff --git a/test/kuttl/tests/okp-configuration/01-assert-mock-objects-created.yaml b/test/kuttl/tests/okp-configuration/01-assert-mock-objects-created.yaml deleted file mode 120000 index 07f977a..0000000 --- a/test/kuttl/tests/okp-configuration/01-assert-mock-objects-created.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/mock-objects/assert-mock-objects-created.yaml \ No newline at end of file diff --git a/test/kuttl/tests/okp-configuration/02-create-okp-resources.yaml b/test/kuttl/tests/okp-configuration/02-create-okp-resources.yaml deleted file mode 100644 index 49e9134..0000000 --- a/test/kuttl/tests/okp-configuration/02-create-okp-resources.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -apiVersion: lightspeed.openstack.org/v1beta1 -kind: OpenStackLightspeed -metadata: - name: openstack-lightspeed - namespace: openstack-lightspeed -spec: - llmEndpoint: http://mock-llm-api-server-pod:8000/v1 - llmEndpointType: openai - llmCredentials: openstack-lightspeed-apitoken - modelName: ibm-granite/granite-3.1-8b-instruct - tlsCACertBundle: openstack-lightspeed-cert - llmProjectID: test-project-id - llmDeploymentName: test-deployment-name - llmAPIVersion: v1 - enableOCPRAG: false - logging: - ogxLogLevel: DEBUG - lightspeedStackLogLevel: WARNING - dataverseExporterLogLevel: DEBUG - dev: - featureFlags: - - okp - okpChunkFilterQuery: "product:(*openstack* OR *openshift*)" diff --git a/test/kuttl/tests/okp-configuration/03-assert-okp-instance.yaml b/test/kuttl/tests/okp-configuration/03-assert-okp-instance.yaml deleted file mode 100644 index 1a5fc64..0000000 --- a/test/kuttl/tests/okp-configuration/03-assert-okp-instance.yaml +++ /dev/null @@ -1,133 +0,0 @@ -############################################################################## -# Assert that the operator created all expected OKP resources # -############################################################################## - -# OKP Deployment ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: lightspeed-okp-server - namespace: openstack-lightspeed -spec: - template: - spec: - containers: - - name: okp - ports: - - name: okp - containerPort: 8080 -status: - replicas: 1 - readyReplicas: 1 - availableReplicas: 1 - -# OKP Service ---- -apiVersion: v1 -kind: Service -metadata: - name: lightspeed-okp-server - namespace: openstack-lightspeed -spec: - ports: - - name: http - port: 8080 - protocol: TCP - targetPort: okp - type: ClusterIP - -# Postgres Deployment ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: lightspeed-postgres-server - namespace: openstack-lightspeed -status: - replicas: 1 - readyReplicas: 1 - availableReplicas: 1 - -# Main deployment with OKP env vars ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: lightspeed-stack-deployment - namespace: openstack-lightspeed -spec: - template: - spec: - containers: - - name: llama-stack - env: - - name: OPENSTACK_LIGHTSPEED_PROVIDER_API_KEY - valueFrom: - secretKeyRef: - key: apitoken - name: openstack-lightspeed-apitoken - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - key: password - name: lightspeed-postgres-secret - - name: PGSSLMODE - value: verify-full - - name: PGSSLROOTCERT - value: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem - - name: LLAMA_STACK_LOGGING - value: all=debug - - name: OGX_LOGGING - value: all=debug - - name: VECTOR_DB_DATA_PATH - value: /vector-db-discovered-values - - name: RH_SERVER_OKP - value: http://lightspeed-okp-server.openstack-lightspeed.svc:8080 - - name: lightspeed-service-api - env: - - name: LIGHTSPEED_STACK_LOG_LEVEL - value: WARNING - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - key: password - name: lightspeed-postgres-secret - - name: RH_SERVER_OKP - value: http://lightspeed-okp-server.openstack-lightspeed.svc:8080 - - name: lightspeed-to-dataverse-exporter - args: - - --mode - - openshift - - --config - - /etc/config/config.yaml - - --log-level - - DEBUG - - --data-dir - - /tmp/data -status: - replicas: 1 - readyReplicas: 1 - availableReplicas: 1 - -# OpenStackLightspeed CR status ---- -apiVersion: lightspeed.openstack.org/v1beta1 -kind: OpenStackLightspeed -metadata: - name: openstack-lightspeed - namespace: openstack-lightspeed -status: - conditions: - - type: Ready - status: "True" - reason: Ready - message: Setup complete - - type: OCPRAGReady - status: "True" - reason: Ready - message: OCP RAG is disabled - - type: OpenStackLightspeedReady - status: "True" - reason: Ready - message: OpenStack Lightspeed created diff --git a/test/kuttl/tests/okp-configuration/04-assert-lightspeed-stack-config.yaml b/test/kuttl/tests/okp-configuration/04-assert-lightspeed-stack-config.yaml deleted file mode 100644 index 506c6d3..0000000 --- a/test/kuttl/tests/okp-configuration/04-assert-lightspeed-stack-config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -commands: - - script: | - #!/bin/bash - set -euo pipefail - ../../common/expected-configs/validate-config.sh lightspeed-stack ../../common/expected-configs/lightspeed-stack-okp.yaml - timeout: 180 diff --git a/test/kuttl/tests/okp-configuration/05-assert-llama-stack-config.yaml b/test/kuttl/tests/okp-configuration/05-assert-llama-stack-config.yaml deleted file mode 100644 index bc192e2..0000000 --- a/test/kuttl/tests/okp-configuration/05-assert-llama-stack-config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -commands: - - script: | - #!/bin/bash - set -euo pipefail - ../../common/expected-configs/validate-config.sh ogx_config ../../common/expected-configs/ogx_config-okp.yaml - timeout: 180 diff --git a/test/kuttl/tests/okp-configuration/06-disable-okp.yaml b/test/kuttl/tests/okp-configuration/06-disable-okp.yaml deleted file mode 100644 index 846e5d1..0000000 --- a/test/kuttl/tests/okp-configuration/06-disable-okp.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -apiVersion: lightspeed.openstack.org/v1beta1 -kind: OpenStackLightspeed -metadata: - name: openstack-lightspeed - namespace: openstack-lightspeed -spec: - llmEndpoint: http://mock-llm-api-server-pod:8000/v1 - llmEndpointType: openai - llmCredentials: openstack-lightspeed-apitoken - modelName: ibm-granite/granite-3.1-8b-instruct - tlsCACertBundle: openstack-lightspeed-cert - llmProjectID: test-project-id - llmDeploymentName: test-deployment-name - llmAPIVersion: v1 - enableOCPRAG: false - logging: - ogxLogLevel: DEBUG - lightspeedStackLogLevel: WARNING - dataverseExporterLogLevel: DEBUG - dev: - featureFlags: [] diff --git a/test/kuttl/tests/okp-configuration/07-errors-okp-cleanup.yaml b/test/kuttl/tests/okp-configuration/07-errors-okp-cleanup.yaml deleted file mode 100644 index 8b3bb4c..0000000 --- a/test/kuttl/tests/okp-configuration/07-errors-okp-cleanup.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: lightspeed-okp-server - namespace: openstack-lightspeed ---- -apiVersion: v1 -kind: Service -metadata: - name: lightspeed-okp-server - namespace: openstack-lightspeed diff --git a/test/kuttl/tests/okp-configuration/08-cleanup-openstack-lightspeed-instance.yaml b/test/kuttl/tests/okp-configuration/08-cleanup-openstack-lightspeed-instance.yaml deleted file mode 120000 index 6b2075b..0000000 --- a/test/kuttl/tests/okp-configuration/08-cleanup-openstack-lightspeed-instance.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/openstack-lightspeed-instance/cleanup-openstack-lightspeed-instance.yaml \ No newline at end of file diff --git a/test/kuttl/tests/okp-configuration/09-errors-openstack-lightspeed-instance.yaml b/test/kuttl/tests/okp-configuration/09-errors-openstack-lightspeed-instance.yaml deleted file mode 120000 index 8147244..0000000 --- a/test/kuttl/tests/okp-configuration/09-errors-openstack-lightspeed-instance.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/openstack-lightspeed-instance/errors-openstack-lightspeed-instance.yaml \ No newline at end of file diff --git a/test/kuttl/tests/okp-configuration/10-cleanup-mock-objects.yaml b/test/kuttl/tests/okp-configuration/10-cleanup-mock-objects.yaml deleted file mode 120000 index 410c927..0000000 --- a/test/kuttl/tests/okp-configuration/10-cleanup-mock-objects.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/mock-objects/cleanup-mock-objects.yaml \ No newline at end of file diff --git a/test/kuttl/tests/okp-configuration/11-errors-mock-objects.yaml b/test/kuttl/tests/okp-configuration/11-errors-mock-objects.yaml deleted file mode 120000 index 696a5e2..0000000 --- a/test/kuttl/tests/okp-configuration/11-errors-mock-objects.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/mock-objects/errors-mock-objects.yaml \ No newline at end of file diff --git a/test/kuttl/tests/update-openstacklightspeed/07-update-openstack-lightspeed-instance.yaml b/test/kuttl/tests/update-openstacklightspeed/07-update-openstack-lightspeed-instance.yaml index a612acb..40a2600 100644 --- a/test/kuttl/tests/update-openstacklightspeed/07-update-openstack-lightspeed-instance.yaml +++ b/test/kuttl/tests/update-openstacklightspeed/07-update-openstack-lightspeed-instance.yaml @@ -39,3 +39,5 @@ spec: ogxLogLevel: "core=debug,providers=info" lightspeedStackLogLevel: ERROR dataverseExporterLogLevel: ERROR + dev: + okpChunkFilterQuery: "product:(*openstack* OR *openshift*)" diff --git a/test/kuttl/tests/update-openstacklightspeed/08-assert-openstacklightspeed-update.yaml b/test/kuttl/tests/update-openstacklightspeed/08-assert-openstacklightspeed-update.yaml index 9bdbf12..16fd118 100644 --- a/test/kuttl/tests/update-openstacklightspeed/08-assert-openstacklightspeed-update.yaml +++ b/test/kuttl/tests/update-openstacklightspeed/08-assert-openstacklightspeed-update.yaml @@ -116,6 +116,8 @@ spec: value: core=debug,providers=info - name: VECTOR_DB_DATA_PATH value: /vector-db-discovered-values + - name: RH_SERVER_OKP + value: http://lightspeed-okp-server.openstack-lightspeed.svc:8080 volumeMounts: - name: ca-bundle mountPath: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem @@ -141,6 +143,8 @@ spec: secretKeyRef: key: password name: lightspeed-postgres-secret + - name: RH_SERVER_OKP + value: http://lightspeed-okp-server.openstack-lightspeed.svc:8080 volumeMounts: - name: ca-bundle mountPath: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem From 43e0b82c22322aaae06cacd7dfae0c8d63c38e81 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Wed, 8 Jul 2026 09:44:44 +0100 Subject: [PATCH 2/2] Default OKPRagOnly to true Change OKPRagOnly default to true, making OKP the only RAG source by default. Signed-off-by: Lucas Alvares Gomes --- api/v1beta1/openstacklightspeed_types.go | 4 ++-- api/v1beta1/zz_generated.deepcopy.go | 5 +++++ internal/controller/lcore_deployment.go | 2 +- .../common/expected-configs/lightspeed-stack-update.yaml | 1 - test/kuttl/common/expected-configs/lightspeed-stack.yaml | 1 - 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/api/v1beta1/openstacklightspeed_types.go b/api/v1beta1/openstacklightspeed_types.go index abf5118..79cb143 100644 --- a/api/v1beta1/openstacklightspeed_types.go +++ b/api/v1beta1/openstacklightspeed_types.go @@ -56,11 +56,11 @@ const ( // Supported fields: // - featureFlags: list of experimental feature flags to enable // - okpChunkFilterQuery: Solr filter query for OKP searches (default: version-aware query combining detected OpenStack and OCP versions) -// - okpRagOnly: when true, only OKP is used as a RAG source (default: false) +// - okpRagOnly: when true, only OKP is used as a RAG source (default: true) type DevSpec struct { FeatureFlags []string `json:"featureFlags,omitempty"` OKPChunkFilterQuery string `json:"okpChunkFilterQuery,omitempty"` - OKPRagOnly bool `json:"okpRagOnly,omitempty"` + OKPRagOnly *bool `json:"okpRagOnly,omitempty"` } // OKPSpec defines configuration for the Offline Knowledge Portal (OKP). diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index c5d6115..7ccfe25 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -49,6 +49,11 @@ func (in *DevSpec) DeepCopyInto(out *DevSpec) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.OKPRagOnly != nil { + in, out := &in.OKPRagOnly, &out.OKPRagOnly + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevSpec. diff --git a/internal/controller/lcore_deployment.go b/internal/controller/lcore_deployment.go index e170b35..eeb1356 100644 --- a/internal/controller/lcore_deployment.go +++ b/internal/controller/lcore_deployment.go @@ -302,7 +302,7 @@ func buildInitContainers( "--lightspeed-stack-path", LightspeedStackInitContainerMountPath, } devConfig, _ := parseDevConfig(instance) - if devConfig.OKPRagOnly { + if devConfig.OKPRagOnly == nil || *devConfig.OKPRagOnly { configBuildCmd = append(configBuildCmd, "--disable-rag-entries") } diff --git a/test/kuttl/common/expected-configs/lightspeed-stack-update.yaml b/test/kuttl/common/expected-configs/lightspeed-stack-update.yaml index 2ef5151..e4f69ce 100644 --- a/test/kuttl/common/expected-configs/lightspeed-stack-update.yaml +++ b/test/kuttl/common/expected-configs/lightspeed-stack-update.yaml @@ -79,7 +79,6 @@ okp: rag: inline: - okp - - vs_UUID service: access_log: true auth_enabled: true diff --git a/test/kuttl/common/expected-configs/lightspeed-stack.yaml b/test/kuttl/common/expected-configs/lightspeed-stack.yaml index c1091dc..27de495 100644 --- a/test/kuttl/common/expected-configs/lightspeed-stack.yaml +++ b/test/kuttl/common/expected-configs/lightspeed-stack.yaml @@ -79,7 +79,6 @@ okp: rag: inline: - okp - - vs_UUID service: access_log: true auth_enabled: true