Skip to content

OKP: Filter by product version - #9

Merged
lpiwowar merged 1 commit into
openstack-k8s-operators:mainfrom
umago:okp-version-detection
Jul 8, 2026
Merged

OKP: Filter by product version#9
lpiwowar merged 1 commit into
openstack-k8s-operators:mainfrom
umago:okp-version-detection

Conversation

@umago

@umago umago commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Update the default OKP chunk_filter_query to include version-specific filters for both OpenStack and OpenShift.

For OCP version detection, the code reuses the DetectOCPVersion() and for OpenStack a new detectOpenStackVersion() was introduced.

The way the OpenStack version is determined is by mapping the OCP versions accordingly to RHOSO. For example, OCP <= 4.21 maps to OpenStack 18.0. In the future, once RHOSO 19.0 is out, we just need to add a new map entry for it. If no entry is mapped the code log a message and safely return a default version for RHOSO (right now, 18.0).

The dev.okpChunkFilterQuery override continues to bypass detection entirely.

Kuttl tests pin the query via that override to keep assertions deterministic across cluster environments.

@umago

umago commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Tested locally and also ran the kuttl tests:

=== NAME  kuttl
    harness.go:403: run tests finished
    harness.go:510: cleaning up
    harness.go:567: removing temp folder: ""
--- PASS: kuttl (416.49s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/basic-openstack-lightspeed-configuration (70.65s)
        --- PASS: kuttl/harness/persistent-database (137.87s)
        --- PASS: kuttl/harness/update-openstacklightspeed (107.45s)
        --- PASS: kuttl/harness/okp-configuration (100.50s)
PASS

@umago
umago requested review from lpiwowar and omkarjoshi0304 July 7, 2026 12:18
Comment thread internal/controller/openstack_version.go
@umago
umago marked this pull request as draft July 7, 2026 12:55
@umago
umago force-pushed the okp-version-detection branch from 12a8154 to df48e55 Compare July 7, 2026 13:00
@umago
umago marked this pull request as ready for review July 7, 2026 13:01

logger := h.GetLogger()

ocpVersion, err := DetectOCPVersion(ctx, h)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: I can see the DetectOCPVersion has been called multiple times , does it make sense to detect the version once and then pass it where ever call is made ?

@umago umago Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I looked a bit into that when i was reviewing the code but, to be honest, this is a cheap k8s API call that should be completely fine in practice. I would keep it like this for now to keep the code clearer and have buildLCoreConfigYAML() and buildLlamaStackYAML() independently (they both call this common method)

In the future I believe we should compeltely remove the buildLlamaStackYAML() cause in LCORE there are ways of generating the LlamaStack (OGX) config from the LCORE config itself and keep things consistent. We should do that instead IMHO.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

But if you guys think this duplication is something to address, I can do it no problem

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I like the OGX config generation from LCORE config for the future.

Akrog
Akrog previously approved these changes Jul 7, 2026

@Akrog Akrog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm

Comment thread internal/controller/common.go Outdated
Comment thread internal/controller/lcore_config.go Outdated

logger := h.GetLogger()

ocpVersion, err := DetectOCPVersion(ctx, h)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I like the OGX config generation from LCORE config for the future.

@omkarjoshi0304

Copy link
Copy Markdown
Collaborator

LGTM!!

lpiwowar
lpiwowar previously approved these changes Jul 7, 2026

@lpiwowar lpiwowar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thank you:). Just three super small nits.

Comment thread go.mod Outdated
Comment thread internal/controller/openstack_version.go Outdated
Comment thread internal/controller/openstack_version_test.go Outdated
Update the default OKP chunk_filter_query to include version-specific
filters for both OpenStack and OpenShift.

For OCP version detection, the code reuses the DetectOCPVersion() and
for OpenStack a new detectOpenStackVersion() was introduced.

The way the OpenStack version is determined is by mapping the OCP versions
accordingly to RHOSO. For example, OCP <= 4.21 maps to OpenStack 18.0.
In the future, once RHOSO 19.0 is out, we just need to add a new map
entry for it. If no entry is mapped the code log a message and safely
return a default version for RHOSO (right now, 18.0).

The dev.okpChunkFilterQuery override continues to bypass detection
entirely.

Kuttl tests pin the query via that override to keep assertions
deterministic across cluster environments. Unit-tests were added to
cover those kuttl gaps.

Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
@lpiwowar
lpiwowar merged commit 967e602 into openstack-k8s-operators:main Jul 8, 2026
3 checks passed
@umago
umago deleted the okp-version-detection branch July 8, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants