Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright 2025.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): I like this change 👍 . But whenever proposing a PR any changes that are not directly connected to the PR itself should be at least a separate commit.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -24,8 +25,11 @@ const (
OpenStackLightspeedReadyCondition condition.Type = "OpenStackLightspeedReady"

// OpenShift Lightspeed Operator Status=True condition which indicates if OpenShift Lightspeed is installed and
// operational and it can be used by OpenStack Lihgtspeed operator.
// operational and it can be used by OpenStack Lightspeed operator.
OpenShiftLightspeedOperatorReadyCondition condition.Type = "OpenShiftLightspeedOperatorReady"

// OCPRAGCondition Status=True condition which indicates the OCP RAG version resolution status
OCPRAGCondition condition.Type = "OCPRAGReady"
)

// Common Messages used by API objects.
Expand All @@ -42,6 +46,21 @@ const (
// OpenShiftLightspeedOperatorWaiting
OpenShiftLightspeedOperatorWaiting = "Waiting for the OpenShift Lightspeed operator to deploy."

// OpenShiftLigthspeedOperatorReady
// OpenShiftLightspeedOperatorReady
OpenShiftLightspeedOperatorReady = "OpenShift Lightspeed operator is ready."

// OCPRAGDisabledMessage
OCPRAGDisabledMessage = "OCP RAG is disabled"

// OCPRAGVersionResolvedMessage
OCPRAGVersionResolvedMessage = "OCP RAG version resolved: %s"

// OCPRAGVersionFallbackMessage
OCPRAGVersionFallbackMessage = "Cluster version %s is not explicitly supported. Using 'latest' OCP documentation. Supported versions: %v"

// OCPRAGDetectionFailedMessage
OCPRAGDetectionFailedMessage = "Failed to detect OCP cluster version"

// OCPRAGOverrideInvalidMessage
OCPRAGOverrideInvalidMessage = "Invalid OCP RAG version override"
)
15 changes: 15 additions & 0 deletions api/v1beta1/openstacklightspeed_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ type OpenStackLightspeedSpec struct {
// +kubebuilder:validation:Optional
// ContainerImage for the OpenStack Lightspeed RAG container (will be set to environmental default if empty)
RAGImage string `json:"ragImage"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// Enables automatic OCP documentation based on cluster version
EnableOCPRAG bool `json:"enableOCPRAG,omitempty"`

// +kubebuilder:validation:Optional
// Allows forcing a specific OCP version instead of auto-detection.
// Format should be like "4.15", "4.16", etc.
OCPRAGVersionOverride string `json:"ocpVersionOverride,omitempty"`
}

// OpenStackLightspeedCore defines the desired state of OpenStackLightspeed
Expand Down Expand Up @@ -106,6 +116,11 @@ type OpenStackLightspeedStatus struct {

// ObservedGeneration - the most recent generation observed for this object.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// +optional
// ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
// Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
ActiveOCPRAGVersion string `json:"activeOCPRAGVersion,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ spec:
description: Namespace where the CatalogSource containing the OLS
operator is located
type: string
enableOCPRAG:
default: false
description: Enables automatic OCP documentation based on cluster
version
type: boolean
feedbackDisabled:
description: Disable feedback collection
type: boolean
Expand Down Expand Up @@ -99,6 +104,11 @@ spec:
description: Name of the model to use at the API endpoint provided
in LLMEndpoint
type: string
ocpVersionOverride:
description: |-
Allows forcing a specific OCP version instead of auto-detection.
Format should be like "4.15", "4.16", etc.
type: string
ragImage:
description: ContainerImage for the OpenStack Lightspeed RAG container
(will be set to environmental default if empty)
Expand All @@ -118,6 +128,11 @@ spec:
status:
description: OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed
properties:
activeOCPRAGVersion:
description: |-
ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
type: string
conditions:
description: Conditions
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -81,6 +59,14 @@ spec:
spec:
clusterPermissions:
- rules:
- apiGroups:
- config.openshift.io
resources:
- clusterversions
verbs:
- get
- list
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also watch the object so the deployment can be changed if OCP is updated from 4.16 to 4.18.
If it's too much work maybe we can do it in a follow up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added watched object , we can see the changes in the RBAC and i have modified controller to set up watch

- watch
- apiGroups:
- lightspeed.openstack.org
resources:
Expand Down Expand Up @@ -187,6 +173,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:
Expand Down Expand Up @@ -307,7 +295,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
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ spec:
description: Namespace where the CatalogSource containing the OLS
operator is located
type: string
enableOCPRAG:
default: false
description: Enables automatic OCP documentation based on cluster
version
type: boolean
feedbackDisabled:
description: Disable feedback collection
type: boolean
Expand Down Expand Up @@ -99,6 +104,11 @@ spec:
description: Name of the model to use at the API endpoint provided
in LLMEndpoint
type: string
ocpVersionOverride:
description: |-
Allows forcing a specific OCP version instead of auto-detection.
Format should be like "4.15", "4.16", etc.
type: string
ragImage:
description: ContainerImage for the OpenStack Lightspeed RAG container
(will be set to environmental default if empty)
Expand All @@ -118,6 +128,11 @@ spec:
status:
description: OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed
properties:
activeOCPRAGVersion:
description: |-
ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
type: string
conditions:
description: Conditions
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ kind: ClusterRole
metadata:
name: manager-role
rules:
- apiGroups:
- config.openshift.io
resources:
- clusterversions
verbs:
- get
- list
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned above, shouldn't we also watch the object to detect updates?

- watch
- apiGroups:
- lightspeed.openstack.org
resources:
Expand Down
Loading
Loading