Skip to content

Commit 333fa10

Browse files
committed
Remove EnableOCPRAG and OCPRAGVersionOverride
With the introduction of OKP the EnableOCPRAG and OCPRAGVersionOverride configuration options are no longer needed. This change remove all code related to EnableOCPRAG and OCPRAGVersionOverride, including the associated conditions, status field, shell script arguments, etc... The generic OCP version helper methods such as DetectOCPVersion and ParseMajorMinorVersion are retained as they are still used by the OKP chunk filter query and console image selection. Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
1 parent ed059d7 commit 333fa10

16 files changed

Lines changed: 13 additions & 718 deletions

api/v1beta1/conditions.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ const (
2727
// OpenShift Lightspeed Operator Status=True condition which indicates if OpenShift Lightspeed is installed and
2828
// operational and it can be used by OpenStack Lightspeed operator.
2929
OpenShiftLightspeedOperatorReadyCondition condition.Type = "OpenShiftLightspeedOperatorReady"
30-
31-
// OCPRAGCondition Status=True condition which indicates the OCP RAG version resolution status
32-
OCPRAGCondition condition.Type = "OCPRAGReady"
3330
)
3431

3532
// Common Messages used by API objects.
@@ -49,21 +46,6 @@ const (
4946
// OpenShiftLightspeedOperatorReady
5047
OpenShiftLightspeedOperatorReady = "OpenShift Lightspeed operator is ready."
5148

52-
// OCPRAGDisabledMessage
53-
OCPRAGDisabledMessage = "OCP RAG is disabled"
54-
55-
// OCPRAGVersionResolvedMessage
56-
OCPRAGVersionResolvedMessage = "OCP RAG version resolved: %s"
57-
58-
// OCPRAGVersionFallbackMessage
59-
OCPRAGVersionFallbackMessage = "Cluster version %s is not explicitly supported. Using 'latest' OCP documentation. Supported versions: %v"
60-
61-
// OCPRAGDetectionFailedMessage
62-
OCPRAGDetectionFailedMessage = "Failed to detect OCP cluster version"
63-
64-
// OCPRAGOverrideInvalidMessage
65-
OCPRAGOverrideInvalidMessage = "Invalid OCP RAG version override"
66-
6749
// DeploymentCheckFailedMessage
6850
DeploymentCheckFailedMessage = "Failed to check deployment status: %s"
6951

api/v1beta1/openstacklightspeed_types.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,6 @@ type DatabaseSpec struct {
9595
type OpenStackLightspeedSpec struct {
9696
OpenStackLightspeedCore `json:",inline"`
9797

98-
// +kubebuilder:validation:Optional
99-
// +kubebuilder:default=false
100-
// Enables automatic OCP documentation based on cluster version
101-
EnableOCPRAG bool `json:"enableOCPRAG,omitempty"`
102-
103-
// +kubebuilder:validation:Optional
104-
// Allows forcing a specific OCP version instead of auto-detection.
105-
// Format should be like "4.15", "4.16", etc.
106-
OCPRAGVersionOverride string `json:"ocpVersionOverride,omitempty"`
107-
10898
// +kubebuilder:validation:Optional
10999
// Database configures persistent storage for PostgreSQL data.
110100
// When omitted, an emptyDir volume is used (data is lost on pod reschedule).
@@ -211,11 +201,6 @@ type OpenStackLightspeedStatus struct {
211201

212202
// ObservedGeneration - the most recent generation observed for this object.
213203
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
214-
215-
// +optional
216-
// ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
217-
// Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
218-
ActiveOCPRAGVersion string `json:"activeOCPRAGVersion,omitempty"`
219204
}
220205

221206
// +kubebuilder:object:root=true

bundle/manifests/lightspeed.openstack.org_openstacklightspeeds.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ spec:
7575
This section is not part of the stable API and may change at any time without backward compatibility.
7676
type: object
7777
x-kubernetes-preserve-unknown-fields: true
78-
enableOCPRAG:
79-
default: false
80-
description: Enables automatic OCP documentation based on cluster
81-
version
82-
type: boolean
8378
feedbackDisabled:
8479
description: Disable feedback collection
8580
type: boolean
@@ -155,11 +150,6 @@ spec:
155150
description: Name of the model to use at the API endpoint provided
156151
in LLMEndpoint
157152
type: string
158-
ocpVersionOverride:
159-
description: |-
160-
Allows forcing a specific OCP version instead of auto-detection.
161-
Format should be like "4.15", "4.16", etc.
162-
type: string
163153
okp:
164154
description: OKP configures the Offline Knowledge Portal (OKP) RAG
165155
source.
@@ -193,11 +183,6 @@ spec:
193183
status:
194184
description: OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed
195185
properties:
196-
activeOCPRAGVersion:
197-
description: |-
198-
ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
199-
Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
200-
type: string
201186
conditions:
202187
description: Conditions
203188
items:

bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ metadata:
2525
]
2626
capabilities: Basic Install
2727
categories: AI/Machine Learning
28-
createdAt: "2026-07-03T16:05:52Z"
28+
createdAt: "2026-07-09T10:17:14Z"
2929
description: AI-powered virtual assistant for Red Hat OpenStack Services on OpenShift
3030
features.operators.openshift.io/cnf: "false"
3131
features.operators.openshift.io/cni: "false"

config/crd/bases/lightspeed.openstack.org_openstacklightspeeds.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ spec:
7575
This section is not part of the stable API and may change at any time without backward compatibility.
7676
type: object
7777
x-kubernetes-preserve-unknown-fields: true
78-
enableOCPRAG:
79-
default: false
80-
description: Enables automatic OCP documentation based on cluster
81-
version
82-
type: boolean
8378
feedbackDisabled:
8479
description: Disable feedback collection
8580
type: boolean
@@ -155,11 +150,6 @@ spec:
155150
description: Name of the model to use at the API endpoint provided
156151
in LLMEndpoint
157152
type: string
158-
ocpVersionOverride:
159-
description: |-
160-
Allows forcing a specific OCP version instead of auto-detection.
161-
Format should be like "4.15", "4.16", etc.
162-
type: string
163153
okp:
164154
description: OKP configures the Offline Knowledge Portal (OKP) RAG
165155
source.
@@ -193,11 +183,6 @@ spec:
193183
status:
194184
description: OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed
195185
properties:
196-
activeOCPRAGVersion:
197-
description: |-
198-
ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
199-
Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
200-
type: string
201186
conditions:
202187
description: Conditions
203188
items:

internal/controller/assets/vector_database_collect.sh

Lines changed: 4 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@
3131
# │ └── vector-db-data-N/
3232
# │ ├── faiss_store.db
3333
# │ └── llama-stack.yaml
34-
# ├── ocp_vector_db/
35-
# │ ├── ocp_X.YZ/
36-
# │ │ ├── faiss_store.db
37-
# │ │ └── llama-stack.yaml
38-
# │ └── ocp_latest/
39-
# │ ├── faiss_store.db
40-
# │ └── llama-stack.yaml
4134
# ├── embeddings_model/
4235
# │ └── <model_files>
4336
# └── okp_embeddings_model/
@@ -48,17 +41,14 @@
4841
# ├── <random-tmp-dir>/
4942
# │ ├── vector_db/
5043
# │ │ ├── vector-db-data-1/
51-
# │ │ ├── vector-db-data-N/
52-
# │ │ └── ocp_X.YZ/ (if --enable-ocp-rag true and --ocp-version X.YZ)
44+
# │ │ └── vector-db-data-N/
5345
# │ └── embeddings_model/
5446
# │ └── <model_files>
5547
# └── okp_embeddings_model/ (if --enable-okp true)
5648
# └── <model_files>
5749
#
5850
# Arguments:
5951
# --vector-db-path PATH Target directory for collected data (required)
60-
# --enable-ocp-rag BOOL Enable OCP vector DB collection: true/false (required)
61-
# --ocp-version VERSION OCP version to collect, e.g., "X.YZ" (required)
6252
# --enable-okp Enable OKP embedding model collection (flag, default: disabled)
6353

6454
set -eu
@@ -69,17 +59,6 @@ set -eu
6959
# image is mounted. Populated via parse_arguments_and_init.
7060
VECTOR_DB_VOLUME_MOUNT_PATH=""
7161

72-
# ENABLE_OCP_RAG specifies whether this script should collect vector database
73-
# content related to OCP (expected to be found under OCP_VECTOR_DB_DIR).
74-
# Must be set to "true" for the collection to be enabled. Populated via
75-
# parse_arguments_and_init.
76-
ENABLE_OCP_RAG=""
77-
78-
# OCP_VERSION specifies what version of OCP content should be collected from
79-
# the vector database image -> ${OCP_VECTOR_DB_DIR}/ocp_${OCP_VERSION}. Populated
80-
# via parse_arguments_and_init.
81-
OCP_VERSION=""
82-
8362
# ENABLE_OKP specifies whether this script should collect the OKP embedding
8463
# model (expected to be found under OKP_EMBEDDING_MODEL_SRC). Defaults to
8564
# "false"; set to "true" via --enable-okp to enable collection.
@@ -102,16 +81,6 @@ VECTOR_DB_DATA_COLLECT_DIR=""
10281
# embeddings model should be stored. Populated via parse_arguments_and_init.
10382
EMBEDDINGS_MODEL_DATA_COLLECT_DIR=""
10483

105-
# OCP_VECTOR_DB_DIR specifies the directory within the vector DB container image
106-
# where OCP-specific vector DB data must reside. This script expects to find the
107-
# OCP data exclusively at this location.
108-
OCP_VECTOR_DB_DIR="/rag/ocp_vector_db"
109-
110-
# OCP_VECTOR_DB_DIR_FALLBACK specifies the directory within the vector DB container
111-
# image that contains the default OCP vector DB data. This path is used when no data
112-
# matching the version specified via --ocp-version is found.
113-
OCP_VECTOR_DB_DIR_FALLBACK="/rag/ocp_vector_db/ocp_latest"
114-
11584
# VECTOR_DB_DIR specifies the directory within the vector DB container image
11685
# where general vector DB data must reside.
11786
VECTOR_DB_DIR="/rag/vector_db"
@@ -140,25 +109,15 @@ parse_arguments_and_init() {
140109
VECTOR_DB_VOLUME_MOUNT_PATH="$2"
141110
shift 2
142111
;;
143-
--enable-ocp-rag)
144-
ENABLE_OCP_RAG="$2"
145-
shift 2
146-
;;
147-
--ocp-version)
148-
OCP_VERSION="$2"
149-
shift 2
150-
;;
151112
--enable-okp)
152113
ENABLE_OKP="true"
153114
shift 1
154115
;;
155116
-h|--help)
156-
echo "Usage: $0 --vector-db-path PATH --enable-ocp-rag BOOL --ocp-version VERSION [--enable-okp]"
117+
echo "Usage: $0 --vector-db-path PATH [--enable-okp]"
157118
echo ""
158119
echo "Arguments:"
159120
echo " --vector-db-path Target path for vector DB data collection"
160-
echo " --enable-ocp-rag Enable OCP RAG collection (true/false)"
161-
echo " --ocp-version OCP version to collect (e.g., 4.16)"
162121
echo " --enable-okp Enable OKP embedding model collection (default: disabled)"
163122
echo " -h, --help Show this help message"
164123
exit 0
@@ -176,16 +135,6 @@ parse_arguments_and_init() {
176135
exit 1
177136
fi
178137

179-
if [ -z "${ENABLE_OCP_RAG:-}" ]; then
180-
echo "ERROR: --enable-ocp-rag is required"
181-
exit 1
182-
fi
183-
184-
if [ -z "${OCP_VERSION:-}" ]; then
185-
echo "ERROR: --ocp-version is required"
186-
exit 1
187-
fi
188-
189138
COLLECT_DIR=$(mktemp -d "${VECTOR_DB_VOLUME_MOUNT_PATH}/XXXXXXXXXX")
190139
VECTOR_DB_DATA_COLLECT_DIR="${COLLECT_DIR}/vector_db/"
191140
EMBEDDINGS_MODEL_DATA_COLLECT_DIR="${COLLECT_DIR}/embeddings_model"
@@ -210,26 +159,6 @@ validate_vector_db_dir() {
210159
fi
211160
}
212161

213-
collect_ocp_vector_db_data() {
214-
if [ "${ENABLE_OCP_RAG}" != "true" ]; then
215-
echo "Collecting of OCP vector db data is DISABLED => Skipping"
216-
return
217-
fi
218-
219-
echo "Collecting OCP vector DB data ..."
220-
mkdir -p "${VECTOR_DB_DATA_COLLECT_DIR}"
221-
222-
ocp_dir="${OCP_VECTOR_DB_DIR}/ocp_${OCP_VERSION}"
223-
if [ ! -d "${ocp_dir}" ]; then
224-
echo "Data for OCP version ${OCP_VERSION} not found. Using: ${OCP_VECTOR_DB_DIR_FALLBACK}"
225-
ocp_dir=${OCP_VECTOR_DB_DIR_FALLBACK}
226-
fi
227-
228-
validate_vector_db_dir "${ocp_dir}"
229-
cp -rL "${ocp_dir}" "${VECTOR_DB_DATA_COLLECT_DIR}"
230-
echo "Discovered and collected OCP vector DB data from ${ocp_dir}"
231-
}
232-
233162
collect_vector_db_data() {
234163
echo "Collecting vector DB data ..."
235164
mkdir -p "${VECTOR_DB_DATA_COLLECT_DIR}"
@@ -243,8 +172,8 @@ collect_vector_db_data() {
243172
echo "Discovered and collected vector DB data from ${dir}"
244173
done
245174

246-
if [ "${ENABLE_OCP_RAG}" != "true" ] && [ ${vector_db_data_collected} != "true" ]; then
247-
echo "ERROR: ENABLE_OCP_RAG='${ENABLE_OCP_RAG}' and no generic vector db data found."
175+
if [ ${vector_db_data_collected} != "true" ]; then
176+
echo "ERROR: no generic vector db data found."
248177
exit 1
249178
fi
250179
}
@@ -288,7 +217,6 @@ main() {
288217
# variables are initialized before proceeding.
289218
parse_arguments_and_init "$@"
290219
collect_vector_db_data
291-
collect_ocp_vector_db_data
292220
collect_embeddings_model
293221
collect_okp_embeddings_model
294222
}

internal/controller/lcore_deployment.go

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"fmt"
2222
"path"
2323
"slices"
24-
"strconv"
2524
"strings"
2625

2726
common_helper "github.com/openstack-k8s-operators/lib-common/modules/common/helper"
@@ -212,10 +211,7 @@ func buildLCorePodTemplateSpec(h *common_helper.Helper, ctx context.Context, ins
212211
return corev1.PodTemplateSpec{}, err
213212
}
214213

215-
initContainers, err := buildInitContainers(ctx, h, instance)
216-
if err != nil {
217-
return corev1.PodTemplateSpec{}, err
218-
}
214+
initContainers := buildInitContainers(instance)
219215

220216
return corev1.PodTemplateSpec{
221217
ObjectMeta: metav1.ObjectMeta{
@@ -237,16 +233,7 @@ func buildLCorePodTemplateSpec(h *common_helper.Helper, ctx context.Context, ins
237233
// and Lightspeed Stack configuration files, incorporating information from
238234
// the provided vector database images. For details on their logic, see:
239235
// (1) assets/vector_database_collect.sh and (2) assets/vector_database_build.py.
240-
func buildInitContainers(
241-
ctx context.Context,
242-
helper *common_helper.Helper,
243-
instance *apiv1beta1.OpenStackLightspeed,
244-
) ([]corev1.Container, error) {
245-
ocp_version, err := DetectOCPVersion(ctx, helper)
246-
if err != nil {
247-
return []corev1.Container{}, err
248-
}
249-
236+
func buildInitContainers(instance *apiv1beta1.OpenStackLightspeed) []corev1.Container {
250237
securityContext := &corev1.SecurityContext{
251238
RunAsNonRoot: &[]bool{true}[0],
252239
AllowPrivilegeEscalation: &[]bool{false}[0],
@@ -270,16 +257,11 @@ func buildInitContainers(
270257
containers = append(containers, corev1.Container{
271258
Name: "vector-database-collect",
272259
Image: apiv1beta1.OpenStackLightspeedDefaultValues.RAGImageURL,
273-
Command: func() []string {
274-
cmd := []string{
275-
"sh", VectorDBScriptsMountPath + "/" + VectorDBCollectScriptKey,
276-
"--vector-db-path", VectorDBVolumeMountPath,
277-
"--enable-ocp-rag", strconv.FormatBool(instance.Spec.EnableOCPRAG),
278-
"--ocp-version", ocp_version,
279-
}
280-
cmd = append(cmd, "--enable-okp")
281-
return cmd
282-
}(),
260+
Command: []string{
261+
"sh", VectorDBScriptsMountPath + "/" + VectorDBCollectScriptKey,
262+
"--vector-db-path", VectorDBVolumeMountPath,
263+
"--enable-okp",
264+
},
283265
SecurityContext: securityContext,
284266
Resources: resourceRequirements,
285267
VolumeMounts: []corev1.VolumeMount{
@@ -335,7 +317,7 @@ func buildInitContainers(
335317
},
336318
})
337319

338-
return containers, nil
320+
return containers
339321
}
340322

341323
// buildLightspeedStackConfigVolume returns the volume for the lightspeed-stack config.

0 commit comments

Comments
 (0)