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
15 changes: 15 additions & 0 deletions .github/workflows/verify-generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ jobs:

- name: Verify generated files are up to date and fail if anything changed
run: |
# Preserve the .metadata.annotations.createdAt value from the CSV file,
# because running 'make bundle' updates this timestamp automatically.
# This can cause 'git diff --exit-code' to fail, even if there are
# no meaningful changes (i.e., the PR author already updated the bundle
# files correctly).
OLD_CREATED_AT=$(
grep 'createdAt:' bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml \
| sed 's/.*createdAt: "\(.*\)"/\1/'
)

make generate
make manifests
make bundle

sed -i "s/createdAt: .*/createdAt: \"${OLD_CREATED_AT}\"/" \
bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml

git diff --exit-code
20 changes: 20 additions & 0 deletions bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM scratch

# Core bundle labels.
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=openstack-lightspeed-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.38.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/

# Copy files to locations specified by labels.
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/
162 changes: 162 additions & 0 deletions bundle/manifests/lightspeed.openstack.org_openstacklightspeeds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
creationTimestamp: null
name: openstacklightspeeds.lightspeed.openstack.org
spec:
group: lightspeed.openstack.org
names:
kind: OpenStackLightspeed
listKind: OpenStackLightspeedList
plural: openstacklightspeeds
singular: openstacklightspeed
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Status
jsonPath: .status.conditions[0].status
name: Status
type: string
- description: Message
jsonPath: .status.conditions[0].message
name: Message
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: OpenStackLightspeed is the Schema for the openstacklightspeeds
API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: OpenStackLightspeedSpec defines the desired state of OpenStackLightspeed
properties:
catalogSourceName:
default: redhat-operators
description: Name of the CatalogSource that contains the OLS Operator
type: string
catalogSourceNamespace:
default: openshift-marketplace
description: Namespace where the CatalogSource containing the OLS
operator is located
type: string
llmCredentials:
description: |-
Secret name containing API token for the LLMEndpoint. The key for the field
in the secret that holds the token should be "apitoken".
type: string
llmEndpoint:
description: URL pointing to the LLM
type: string
llmEndpointType:
description: Type of the provider serving the LLM
enum:
- azure_openai
- bam
- openai
- watsonx
- rhoai_vllm
- rhelai_vllm
- fake_provider
type: string
maxTokensForResponse:
description: MaxTokensForResponse defines the maximum number of tokens
to be used for the response generation
type: integer
modelName:
description: Name of the model to use at the API endpoint provided
in LLMEndpoint
type: string
ragImage:
description: ContainerImage for the OpenStack Lightspeed RAG container
(will be set to environmental default if empty)
type: string
tlsCACertBundle:
description: Configmap name containing a CA Certificates bundle
type: string
required:
- llmCredentials
- llmEndpoint
- llmEndpointType
- modelName
type: object
status:
description: OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed
properties:
conditions:
description: Conditions
items:
description: Condition defines an observation of a API resource
operational state.
properties:
lastTransitionTime:
description: |-
Last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition
in CamelCase.
type: string
severity:
description: |-
Severity provides a classification of Reason code, so the current situation is immediately
understandable and could act accordingly.
It is meant for situations where Status=False and it should be indicated if it is just
informational, warning (next reconciliation might fix it) or an error (e.g. DB create issue
and no actions to automatically resolve the issue can/should be done).
For conditions where Status=Unknown or Status=True the Severity should be SeverityNone.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition in CamelCase.
type: string
required:
- lastTransitionTime
- status
- type
type: object
type: array
observedGeneration:
description: ObservedGeneration - the most recent generation observed
for this object.
format: int64
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: null
storedVersions: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: openstack-lightspeed-operator-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: openstack-lightspeed-operator
control-plane: controller-manager
name: openstack-lightspeed-operator-metrics
spec:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: 8443
selector:
control-plane: controller-manager
status:
loadBalancer: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: openstack-lightspeed-operator
name: openstack-lightspeed-operator-openstacklightspeed-editor-role
rules:
- apiGroups:
- lightspeed.openstack.org
resources:
- openstacklightspeeds
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- lightspeed.openstack.org
resources:
- openstacklightspeeds/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: openstack-lightspeed-operator
name: openstack-lightspeed-operator-openstacklightspeed-viewer-role
rules:
- apiGroups:
- lightspeed.openstack.org
resources:
- openstacklightspeeds
verbs:
- get
- list
- watch
- apiGroups:
- lightspeed.openstack.org
resources:
- openstacklightspeeds/status
verbs:
- get
Loading
Loading