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
2 changes: 0 additions & 2 deletions install/0000_00_cluster-version-operator_30_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ spec:
fieldPath: spec.nodeName
- name: CLUSTER_PROFILE
value: '{{ .ClusterProfile }}'
- name: LIGHTSPEED_SKILLS_IMAGE
value: "quay.io/openshift/ci:ocp_5.0_agentic-skills"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is the main change since #1427, right? We'd previously used index .Images "agentic-skills" there, and it makes sense to me to not set the env-var at all, which is what we're doing this time around.

# this pod is hostNetwork and uses the internal LB DNS name when possible, which the kubelet also uses.
# this dnsPolicy allows us to use the same dnsConfig as the kubelet, without access to read it ourselves.
dnsPolicy: Default
Expand Down
4 changes: 4 additions & 0 deletions install/image-references
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ kind: ImageStream
apiVersion: image.openshift.io/v1
spec:
tags:
- name: agentic-skills
from:
kind: DockerImage
name: placeholder.url.oc.will.replace.this.example.org:agentic-skills
Comment on lines +5 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Complete the ImageStream metadata before adding this tag.

As supplied, this install manifest has no metadata.name, cluster-profile annotations, or kubernetes.io/description. Add the required metadata and annotations so the ImageStream can be rendered and installed consistently.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@install/image-references` around lines 5 - 8, Add the required metadata to
the agentic-skills ImageStream, including metadata.name, the cluster-profile
annotations, and the kubernetes.io/description annotation, following the
conventions used by other install manifest ImageStreams so it renders and
installs consistently.

Source: Path instructions

- name: cluster-update-console-plugin
from:
kind: DockerImage
Expand Down
12 changes: 10 additions & 2 deletions pkg/agenticrun/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ type Config struct {
// DefaultConfig returns the default configuration, checking env vars for overrides.
func DefaultConfig() Config {
return Config{
Namespace: envOrDefault("LIGHTSPEED_AGENTIC_RUN_NAMESPACE", "openshift-lightspeed"),
SkillsImage: envOrDefault("LIGHTSPEED_SKILLS_IMAGE", "quay.io/openshift/ci:ocp_5.0_agentic-skills"),
Namespace: envOrDefault("LIGHTSPEED_AGENTIC_RUN_NAMESPACE", "openshift-lightspeed"),
}
}

Expand Down Expand Up @@ -150,6 +149,10 @@ func (c *Controller) SetConsolePluginImage(image string) {
}
}

func (c *Controller) SetSkillsImage(image string) {
c.config.SkillsImage = image
}

func (c *Controller) crdAvailable() bool {
if time.Since(c.crdLastChecked) < crdCheckInterval {
return c.crdAvailableCache
Expand Down Expand Up @@ -213,6 +216,11 @@ func (c *Controller) Sync(ctx context.Context, key string) error {
}
}

if c.config.SkillsImage == "" {
klog.V(i.Normal).Infof("Skipping agentic run creation: skills image is not set")
return nil
}

updates, conditionalUpdates, err := c.updatesGetterFunc()
if err != nil {
klog.Errorf("Error getting available updates: %v", err)
Expand Down
19 changes: 10 additions & 9 deletions pkg/agenticrun/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Update path: Recommended
Tools: agenticrunv1alpha1.ToolsSpec{
Skills: []agenticrunv1alpha1.SkillsSource{
{
Image: "quay.io/openshift/ci:ocp_5.0_agentic-skills",
Image: "registry.example.com/agentic-skills:latest",
Paths: []string{
"/skills/cluster-update/update-advisor",
"/skills/cluster-update/product-lifecycle",
Expand All @@ -129,6 +129,7 @@ Update path: Recommended
c := NewController(tt.updatesGetterFunc, tt.client, nil, tt.cvGetterFunc, func() string {
return "4.22.1"
})
c.config.SkillsImage = "registry.example.com/agentic-skills:latest"
c.crdAvailableCache = true
c.crdLastChecked = time.Now()
actual := c.Sync(context.Background(), tt.name)
Expand Down Expand Up @@ -775,7 +776,7 @@ Other recommended versions available:
Tools: agenticrunv1alpha1.ToolsSpec{
Skills: []agenticrunv1alpha1.SkillsSource{
{
Image: "quay.io/openshift/ci:ocp_5.0_agentic-skills",
Image: "registry.example.com/agentic-skills:latest",
Paths: []string{
"/skills/cluster-update/update-advisor",
"/skills/cluster-update/product-lifecycle",
Expand Down Expand Up @@ -824,7 +825,7 @@ Other recommended versions available:
Tools: agenticrunv1alpha1.ToolsSpec{
Skills: []agenticrunv1alpha1.SkillsSource{
{
Image: "quay.io/openshift/ci:ocp_5.0_agentic-skills",
Image: "registry.example.com/agentic-skills:latest",
Paths: []string{
"/skills/cluster-update/update-advisor",
"/skills/cluster-update/product-lifecycle",
Expand Down Expand Up @@ -882,7 +883,7 @@ Other recommended versions available:
Tools: agenticrunv1alpha1.ToolsSpec{
Skills: []agenticrunv1alpha1.SkillsSource{
{
Image: "quay.io/openshift/ci:ocp_5.0_agentic-skills",
Image: "registry.example.com/agentic-skills:latest",
Paths: []string{
"/skills/cluster-update/update-advisor",
"/skills/cluster-update/product-lifecycle",
Expand Down Expand Up @@ -924,7 +925,7 @@ Other recommended versions available:
Tools: agenticrunv1alpha1.ToolsSpec{
Skills: []agenticrunv1alpha1.SkillsSource{
{
Image: "quay.io/openshift/ci:ocp_5.0_agentic-skills",
Image: "registry.example.com/agentic-skills:latest",
Paths: []string{
"/skills/cluster-update/update-advisor",
"/skills/cluster-update/product-lifecycle",
Expand Down Expand Up @@ -971,7 +972,7 @@ Other recommended versions available:
Tools: agenticrunv1alpha1.ToolsSpec{
Skills: []agenticrunv1alpha1.SkillsSource{
{
Image: "quay.io/openshift/ci:ocp_5.0_agentic-skills",
Image: "registry.example.com/agentic-skills:latest",
Paths: []string{
"/skills/cluster-update/update-advisor",
"/skills/cluster-update/product-lifecycle",
Expand Down Expand Up @@ -1018,7 +1019,7 @@ Other recommended versions available:
Tools: agenticrunv1alpha1.ToolsSpec{
Skills: []agenticrunv1alpha1.SkillsSource{
{
Image: "quay.io/openshift/ci:ocp_5.0_agentic-skills",
Image: "registry.example.com/agentic-skills:latest",
Paths: []string{
"/skills/cluster-update/update-advisor",
"/skills/cluster-update/product-lifecycle",
Expand Down Expand Up @@ -1073,7 +1074,7 @@ Other recommended versions available:
tt.currentVersion,
tt.channel,
tt.systemPrompt,
"quay.io/openshift/ci:ocp_5.0_agentic-skills",
"registry.example.com/agentic-skills:latest",
)

if diff := cmp.Diff(err, tt.expectError, cmp.Transformer("Error", func(e error) string {
Expand Down Expand Up @@ -1292,7 +1293,7 @@ func TestGetAgenticRuns_WithReadinessData(t *testing.T) {
"4.21.5",
"stable-4.21",
"Test prompt",
"quay.io/openshift/ci:ocp_5.0_agentic-skills",
"registry.example.com/agentic-skills:latest",
)
if err != nil {
t.Fatalf("getAgenticRuns returned error: %v", err)
Expand Down
9 changes: 7 additions & 2 deletions pkg/cvo/cvo.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,14 @@ func (optr *Operator) InitializeFromPayload(ctx context.Context, restConfig *res

if update.ImageRef != nil {
for _, tag := range update.ImageRef.Spec.Tags {
if tag.Name == "cluster-update-console-plugin" && tag.From != nil && tag.From.Kind == "DockerImage" {
if tag.From == nil || tag.From.Kind != "DockerImage" {
continue
}
switch tag.Name {
case "cluster-update-console-plugin":
optr.agenticRunController.SetConsolePluginImage(tag.From.Name)
break
case "agentic-skills":
optr.agenticRunController.SetSkillsImage(tag.From.Name)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ spec:
fieldPath: spec.nodeName
- name: CLUSTER_PROFILE
value: 'some-profile'
- name: LIGHTSPEED_SKILLS_IMAGE
value: "quay.io/openshift/ci:ocp_5.0_agentic-skills"
# this pod is hostNetwork and uses the internal LB DNS name when possible, which the kubelet also uses.
# this dnsPolicy allows us to use the same dnsConfig as the kubelet, without access to read it ourselves.
dnsPolicy: Default
Expand Down