diff --git a/PROJECT b/PROJECT index 2ed238b3..e4bc708b 100644 --- a/PROJECT +++ b/PROJECT @@ -2,7 +2,7 @@ # This file is used to track the info used to scaffold your project # and allow the plugins properly work. # More info: https://book.kubebuilder.io/reference/project-config.html -domain: lightspeed.openstack.org +domain: openstack.org layout: - go.kubebuilder.io/v4 plugins: @@ -16,8 +16,8 @@ resources: crdVersion: v1 namespaced: true controller: true - domain: lightspeed.openstack.org - group: api + domain: openstack.org + group: lightspeed kind: OpenStackLightspeed path: github.com/openstack-lightspeed/operator/api/v1beta1 version: v1beta1 diff --git a/bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml b/bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml index e4f06493..9bd67f79 100644 --- a/bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml +++ b/bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml @@ -24,7 +24,7 @@ metadata: } ] capabilities: Basic Install - createdAt: "2026-01-16T13:55:22Z" + createdAt: "2026-02-03T12:43:44Z" operatorframework.io/suggested-namespace: openshift-lightspeed operators.operatorframework.io/builder: operator-sdk-v1.38.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 @@ -35,37 +35,15 @@ spec: apiservicedefinitions: {} customresourcedefinitions: owned: - - kind: OpenStackLightspeed + - description: OpenStackLightspeed is the Schema for the openstacklightspeeds + API + displayName: Open Stack Lightspeed + kind: OpenStackLightspeed name: openstacklightspeeds.lightspeed.openstack.org specDescriptors: - - description: URL pointing to the LLM - displayName: LLMEndpoint - path: llmEndpoint - description: Type of the provider serving the LLM - displayName: LLMEndpointType + displayName: Provider Type path: llmEndpointType - - description: Name of the model to use at the API endpoint - displayName: ModelName - path: modelName - - description: Secret name containing API token for the LLMEndpoint - displayName: LLMCredentials - path: llmCredentials - x-descriptors: - - urn:alm:descriptor:io.kubernetes:Secret - - description: Configmap name containing a CA Certificates bundle - displayName: TLSCACertBundle - path: tlsCACertBundle - x-descriptors: - - urn:alm:descriptor:io.kubernetes:ConfigMap - - description: MaxTokensForResponse defines the maximum number of tokens to - be used for the response generation - displayName: MaxTokensForResponse - path: maxTokensForResponse - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:advanced - statusDescriptors: - - displayName: Conditions - path: conditions version: v1beta1 description: |- OpenStack Lightspeed is a generative AI-based virtual assistant for Red Hat OpenStack Services on OpenShift (RHOSO) users which integrates into the OpenShift Lightspeed. @@ -187,6 +165,8 @@ spec: valueFrom: fieldRef: fieldPath: metadata.annotations['olm.targetNamespaces'] + - name: RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT + value: quay.io/openstack-lightspeed/rag-content:os-docs-2025.2 image: quay.io/openstack-lightspeed/operator:latest livenessProbe: httpGet: @@ -307,7 +287,11 @@ spec: - email: Lukas Piwowarski name: lpiwowar@redhat.com maturity: alpha + minKubeVersion: 1.31.0 provider: name: Red Hat url: https://github.com/openstack-lightspeed/operator + relatedImages: + - image: quay.io/openstack-lightspeed/rag-content:os-docs-2025.2 + name: openstack-lightspeed-image-url-default version: 0.0.1 diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 780fd01c..788d464a 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -72,6 +72,8 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + - name: RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT + value: quay.io/openstack-lightspeed/rag-content:os-docs-2025.2 securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/config/manifests/bases/openstack-lightspeed-operator.clusterserviceversion.yaml b/config/manifests/bases/openstack-lightspeed-operator.clusterserviceversion.yaml index 10f2d5a2..c5db1917 100644 --- a/config/manifests/bases/openstack-lightspeed-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/openstack-lightspeed-operator.clusterserviceversion.yaml @@ -12,37 +12,15 @@ spec: apiservicedefinitions: {} customresourcedefinitions: owned: - - kind: OpenStackLightspeed + - description: OpenStackLightspeed is the Schema for the openstacklightspeeds + API + displayName: Open Stack Lightspeed + kind: OpenStackLightspeed name: openstacklightspeeds.lightspeed.openstack.org specDescriptors: - - description: URL pointing to the LLM - displayName: LLMEndpoint - path: llmEndpoint - description: Type of the provider serving the LLM - displayName: LLMEndpointType + displayName: Provider Type path: llmEndpointType - - description: Name of the model to use at the API endpoint - displayName: ModelName - path: modelName - - description: Secret name containing API token for the LLMEndpoint - displayName: LLMCredentials - path: llmCredentials - x-descriptors: - - urn:alm:descriptor:io.kubernetes:Secret - - description: Configmap name containing a CA Certificates bundle - displayName: TLSCACertBundle - path: tlsCACertBundle - x-descriptors: - - urn:alm:descriptor:io.kubernetes:ConfigMap - - description: MaxTokensForResponse defines the maximum number of tokens to - be used for the response generation - displayName: MaxTokensForResponse - path: maxTokensForResponse - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:advanced - statusDescriptors: - - displayName: Conditions - path: conditions version: v1beta1 description: |- OpenStack Lightspeed is a generative AI-based virtual assistant for Red Hat OpenStack Services on OpenShift (RHOSO) users which integrates into the OpenShift Lightspeed. @@ -83,6 +61,7 @@ spec: - email: Lukas Piwowarski name: lpiwowar@redhat.com maturity: alpha + minKubeVersion: 1.31.0 provider: name: Red Hat url: https://github.com/openstack-lightspeed/operator diff --git a/hack/pullspecs_replaceatron.sh b/hack/pullspecs_replaceatron.sh new file mode 100755 index 00000000..15fa409f --- /dev/null +++ b/hack/pullspecs_replaceatron.sh @@ -0,0 +1,66 @@ +#!/bin/bash +set -euo pipefail + +# Script to update RELATED_IMAGE_ environment variables in ClusterServiceVersion file +# with values from the current bash environment + +CSV_FILE="bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml" + +# Check if CSV file exists +if [[ ! -f "$CSV_FILE" ]]; then + echo "Error: ClusterServiceVersion file not found at $CSV_FILE" + echo "Please run 'make bundle' first to generate the bundle directory" + exit 1 +fi + +# Create a backup of the original file +cp "$CSV_FILE" "${CSV_FILE}.backup" + +echo "Updating RELATED_IMAGE_ environment variables in $CSV_FILE..." + +# Extract all RELATED_IMAGE_ env var names from the CSV file +RELATED_IMAGE_VARS=$(grep -o 'RELATED_IMAGE_[A-Z_]*' "$CSV_FILE" | sort -u) + +# Track if any errors occurred +ERRORS=0 + +# Process each RELATED_IMAGE_ variable +for var_name in $RELATED_IMAGE_VARS; do + # Check if the environment variable exists in the current bash environment + if [[ -n "${!var_name:-}" ]]; then + current_value="${!var_name}" + echo "Updating $var_name with value: $current_value" + + # Use sed to replace all occurrences of the current value in the CSV file + # First, we need to get the current value from the CSV file + current_csv_value=$(grep -A1 "name: $var_name" "$CSV_FILE" | grep "value:" | sed 's/.*value: //' | tr -d '"') + + if [[ -n "$current_csv_value" ]]; then + # Escape special characters for sed + escaped_current=$(printf '%s\n' "$current_csv_value" | sed 's/[[\.*^$()+?{|]/\\&/g') + escaped_new=$(printf '%s\n' "$current_value" | sed 's/[[\.*^$()+?{|]/\\&/g') + + # Replace all occurrences of the current value with the new value + sed -i "s|$escaped_current|$escaped_new|g" "$CSV_FILE" + else + echo "Warning: Could not find current value for $var_name in CSV file" + fi + else + echo "Error: Environment variable $var_name is not set" + ERRORS=$((ERRORS + 1)) + fi +done + +if [[ $ERRORS -gt 0 ]]; then + echo "" + echo "Error: $ERRORS environment variable(s) were not found" + echo "Please set all required RELATED_IMAGE_ environment variables before running this script" + echo "Restoring original file from backup..." + mv "${CSV_FILE}.backup" "$CSV_FILE" + exit 1 +else + echo "" + echo "Successfully updated all RELATED_IMAGE_ environment variables" + echo "Backup saved as ${CSV_FILE}.backup" + rm -f "${CSV_FILE}.backup" +fi