Skip to content
Open
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
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= latest

AGENTIC_OPERATOR_REPO ?= https://github.com/openshift/lightspeed-agentic-operator
AGENTIC_OPERATOR_REF ?= main
AGENTIC_CRD_DIR = config/crd/bases

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
Expand Down Expand Up @@ -64,7 +68,7 @@ OPERATOR_SDK_VERSION ?= v1.36.1
IMG ?= $(IMAGE_TAG_BASE):$(VERSION)
export IMG
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27.1
ENVTEST_K8S_VERSION = 1.32.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -117,6 +121,10 @@ E2E_GO_TAGS := exclude_graphdriver_btrfs,containers_image_openpgp
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:allowDangerousTypes=true webhook $(CONTROLLER_GEN_PATHS) output:crd:artifacts:config=config/crd/bases

.PHONY: sync-agentic-operator
sync-agentic-operator: ## Fetch agentic CRDs, samples, and RBAC from lightspeed-agentic-operator at pinned ref.
hack/sync_agentic_operator.sh $(AGENTIC_OPERATOR_REPO) $(AGENTIC_OPERATOR_REF) $(AGENTIC_CRD_DIR)

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" $(CONTROLLER_GEN_PATHS)
Expand Down Expand Up @@ -299,6 +307,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

PATCH_FILE = config/default/deployment-patch.yaml
AGENTIC_PATCH_FILE = config/default/agentic-deployment-patch.yaml

.PHONY: deploy
deploy: manifests kustomize jq ## Deploy controller to the K8s cluster specified in ~/.kube/config. Override operator image with: make deploy IMG=myregistry/my-operator:mytag
Expand All @@ -315,6 +324,10 @@ deploy: manifests kustomize jq ## Deploy controller to the K8s cluster specified
echo "error: $(PATCH_FILE) not found"; \
exit 1; \
fi; \
if [ ! -f "$(AGENTIC_PATCH_FILE)" ]; then \
echo "error: $(AGENTIC_PATCH_FILE) not found"; \
exit 1; \
fi; \
if [ -z "$$OPERATOR_IMG" ]; then \
OPERATOR_IMG=$$($(JQ) -r '.[] | select(.name=="lightspeed-operator") | .image' related_images.json); \
fi; \
Expand All @@ -328,7 +341,7 @@ deploy: manifests kustomize jq ## Deploy controller to the K8s cluster specified
if [ "$$name" != "lightspeed-operator" ]; then \
img=$$($(JQ) -r --arg n "$$name" '.[] | select(.name==$$n) | .image' related_images.json); \
if [ -n "$$img" ] && [ "$$img" != "null" ]; then \
sed -i "s|$$placeholder|$$img|g" $(PATCH_FILE); \
sed -i "s|$$placeholder|$$img|g" $(PATCH_FILE) $(AGENTIC_PATCH_FILE); \
fi; \
fi; \
done
Expand Down Expand Up @@ -401,7 +414,7 @@ endif
## to set the default channel, use the DEFAULT_CHANNEL variable
## to use image digests instead of version tag, set the USE_IMAGE_DIGESTS variable to true
.PHONY: bundle
bundle: manifests kustomize operator-sdk yq jq ## Generate bundle manifests and metadata, then validate generated files.
bundle: manifests sync-agentic-operator kustomize operator-sdk yq jq ## Generate bundle manifests and metadata, then validate generated files.
YQ=$(YQ) JQ=$(JQ) BUNDLE_GEN_FLAGS="$(BUNDLE_GEN_FLAGS)" ./hack/update_bundle.sh -v $(BUNDLE_TAG) -i related_images.json

parking:
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,24 @@ conversationCache:
type: postgres
```

### Syncing Agentic CRDs

The OLM bundle includes CRDs, samples, and RBAC from the [lightspeed-agentic-operator](https://github.com/openshift/lightspeed-agentic-operator). These are fetched via a make target — do not hand-edit the agentic CRD, sample, or RBAC files.

To sync from the pinned ref (defaults to `main`):

```shell
make sync-agentic-operator
```

To sync from a specific tag or commit:

```shell
make sync-agentic-operator AGENTIC_OPERATOR_REF=v0.1.0
```

The pinned ref is controlled by `AGENTIC_OPERATOR_REF` in the Makefile. This target is also run automatically as part of `make bundle`.

### Modifying the API definitions

If you have updated the API definitions, you must update the CRD manifests with the following command
Expand Down
81 changes: 81 additions & 0 deletions bundle/manifests/agentic.openshift.io_agenticolsconfigs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
creationTimestamp: null
name: agenticolsconfigs.agentic.openshift.io
spec:
group: agentic.openshift.io
names:
kind: AgenticOLSConfig
listKind: AgenticOLSConfigList
plural: agenticolsconfigs
singular: agenticolsconfig
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.suspended
name: Suspended
type: boolean
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: "AgenticOLSConfig is a cluster-scoped singleton that controls
system-wide\nagentic behavior. The cluster admin creates a single AgenticOLSConfig\nnamed
\"cluster\". When spec.suspended is true, all non-terminal proposals\nare
terminated and no new workflow steps are started.\n\nWhen no AgenticOLSConfig
CR exists, the system behaves as if\nsuspended is false — the CR is not
required for normal operation.\n\nExample:\n\n\tapiVersion: agentic.openshift.io/v1alpha1\n\tkind:
AgenticOLSConfig\n\tmetadata:\n\t name: cluster\n\tspec:\n\t suspended:
false"
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: spec defines the desired system configuration.
minProperties: 1
properties:
suspended:
default: false
description: |-
suspended halts all agentic operations cluster-wide when set to true.
All non-terminal proposals are immediately terminated with an
EmergencyStopped condition. Setting back to false re-enables the
system for new proposals only — EmergencyStopped proposals remain
terminal and must be recreated explicitly.
type: boolean
type: object
required:
- spec
type: object
x-kubernetes-validations:
- message: AgenticOLSConfig must be named 'cluster' (singleton)
rule: self.metadata.name == 'cluster'
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: null
storedVersions: null
Loading