Skip to content

WIP: OSC plugins#3

Open
Akrog wants to merge 5 commits into
openstack-k8s-operators:mainfrom
Akrog:osc-plugins
Open

WIP: OSC plugins#3
Akrog wants to merge 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.

Akrog added 5 commits July 10, 2026 14:09
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.
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.
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 requested review from lpiwowar and umago July 10, 2026 12:10
@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Akrog

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

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

Copy link
Copy Markdown
Collaborator

/ok-to-test

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.

2 participants