Skip to content

OSC plugins#3

Merged
openshift-merge-bot[bot] merged 5 commits into
openstack-k8s-operators:mainfrom
Akrog:osc-plugins
Jul 16, 2026
Merged

OSC plugins#3
openshift-merge-bot[bot] merged 5 commits into
openstack-k8s-operators:mainfrom
Akrog:osc-plugins

Conversation

@Akrog

@Akrog Akrog commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

This commit changes our container image because it's currently missing
almost all the OSC plugins, unlike the openstackclient image.

In this patch we ensure the image includes the plugins by:

  • Adding the plugins to the project dependencies in the osc-plugin
    dependency group.

  • Changing the source for all our openstack related packages, so instead
    of using PyPi to install them we use RPMs by using the
    openstackclient container image as the base.

  • We use the Centos 10 base image of the openstackclient container so
    it has Python 3.12 instead of 3.9 that is in the Centos 9 container
    (quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified)
    because the MCP python library has a minimum requirement of Python
    3.10.

This not only resolves the missing plugins, but also ensures that the
packages used are not coming from PyPi, facilitating a more
secure downstream release.

Available plugins are sent as part of the openstack-cli MCP tool
description to help LLMs know what is installed, as they may assume only
basic commands are available.

We also update the allowed commands on read-only mode.

In adition the PR includes a couple of minor improvements to the MCP tool.

When an MCP request to OpenStack is received with incorrect arguments we
fail to return the error in the `stderr` field so it's always an empty
string.

This is because argparse ignores the `stderr` argument we pass to the
shell itself.

With this patch we fix it by ensuring we redirect the whole stderr when
running the command.
@openshift-ci
openshift-ci Bot requested review from lpiwowar and umago July 10, 2026 12:10
@Akrog Akrog changed the title OSC plugins WIP: OSC plugins Jul 10, 2026
@omkarjoshi0304

Copy link
Copy Markdown
Collaborator

/ok-to-test

@Akrog Akrog changed the title WIP: OSC plugins OSC plugins Jul 15, 2026
@Akrog

Akrog commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

I have removed the WIP as I have tried it with openstack-k8s-operators/lightspeed-operator#19 using this image quay.io/geguileo/rhos-mcps

@umago umago 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.

Few nits, otherwise looks good

Comment thread src/rhos_ls_mcps/osc.py
Comment thread Containerfile Outdated
Akrog added 3 commits July 16, 2026 13:14
We are currently seeing some errors logged multiple times. With this
patch we remove the cliff log handlers when running commands removing
duplicated errors on the console.
Some LLMs don't understand that available tools are not shell commands,
so they send shell commands with pipes.

In this patch we try to guard against such explicitly errors by
explicitly stating that the tools are not shell.
The `get-crc-creds.sh` script expects the currently selected project to
be `openstack`, but that's unlikely to happen if we are doing things on
the `openstack-lightspeed` namespace.

In this patch we update the script so it explicit sets the namespace on
the `oc` commands.

@Akrog Akrog left a comment

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 have made requested changes and I've also fixed another problem the container had with the dependencies of our pyproject.toml dependencies, which we want to take from the base image.

Comment thread Containerfile Outdated
Comment thread src/rhos_ls_mcps/osc.py
@Akrog

Akrog commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

Error in building the image is likely a buildah bug, as this builds just fine with podman.

Will change the approach (echo instead of cat) and see if it gets resolved.

This commit changes our container image because it's currently missing
almost all the OSC plugins, unlike the `openstackclient` image.

In this patch we ensure the image includes the plugins by:

* Adding the plugins to the project dependencies in the `osc-plugin`
  dependency group.

* Changing the source for all our openstack related packages, so instead
  of using PyPi to install them we use RPMs by using the
  `openstackclient` container image as the base.

* We use the Centos 10 base image of the `openstackclient` container so
  it has Python 3.12 instead of 3.9 that is in the Centos 9 container
  (quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified)
  because the MCP python library has a minimum requirement of Python
  3.10.

This not only resolves the missing plugins, but also ensures that the
packages used are not coming from PyPi, facilitating a more
secure downstream release.

Available plugins are sent as part of the `openstack-cli` MCP tool
description to help LLMs know what is installed, as they may assume only
basic commands are available.

We also update the allowed commands on read-only mode.
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Akrog, umago

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@umago

umago commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Jul 16, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit d0164d6 into openstack-k8s-operators:main Jul 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants