Claus Ibsen created CAMEL-27958:
-----------------------------------
Summary: camel-openstack: update from headers sends no ID, Glance
delete uses the Nova image API, Nova action operation
Key: CAMEL-27958
URL: https://issues.apache.org/jira/browse/CAMEL-27958
Project: Camel
Issue Type: Bug
Components: camel-openstack
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-openstack for
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31196).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. update from headers sends no ID
The update operation of Keystone (domains, groups, projects, users, regions),
Neutron (ports, routers) and Glance builds the model from the headers but never
reads CamelOpenstackId ({{DomainProducer.doUpdate}}, {{PortProducer.doUpdate}},
{{GlanceProducer.doUpdate}} and the others). openstack4j then gets an entity
with a null id: Neutron PortServiceImpl/RouterServiceImpl.update and Glance
ImageServiceImpl.update throw a NullPointerException
(Objects.requireNonNull(getId())), and the Keystone services send PATCH
/domains/null and so on. Update only works with an openstack4j model object in
the body.
Proposed change: set builder.id(...) from CamelOpenstackId (or the subsystem ID
header) in the messageTo* methods.
h4. 2. Glance delete uses the Nova image proxy
{{GlanceProducer.doDelete}} calls os.compute().images().delete(id), the Nova
image proxy (deprecated in Nova since microversion 2.36), while every other
Glance operation uses os.images().
Proposed change: os.images().delete(id).
h4. 3. Nova action operation
{{ServerProducer.doProcess}} has case NovaConstants.ACTION, which compares the
operation with the header name "CamelOpenstackNovaAction". The documented
operation "action" only works through the default branch, which also runs the
action for any unknown operation when the action header is set.
Proposed change: add an "action" operation constant and make the default branch
throw.
h4. 4. Smaller issues
Header labels are too narrow: Cinder CamelOpenstackCinderSnapshotId is labelled
volume and CamelOpenstackCinderVolumeId snapshot, Keystone DomainId and UserId
and Neutron NetworkId miss the subsystems that also read them.
CamelOpenstackNovaRxtxFactor is an Integer while FlavorBuilder.rxtxFactor takes
a float. The domain option defaults to "default" and is passed as a domain name
(Identifier.byName), while "default" is the ID of the default domain whose name
is "Default". Glance uses os.images(), the Glance v1 API of openstack4j 3.12,
which OpenStack has removed (imagesV2() is current). RouterProducer error
message typo "Unsuproutered operation".
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)