quarkus-operator-sdk: Generated OLM Bundle is not usable out of the box
There are two primary issues with the generated OLM Bundle
OLM standard for configuraing watched namespaces is via olm.targetNamespaces
annotation whereas QOSKD uses QUARKUS_OPERATOR_SDK_NAMESPACES
for the exact same purpose (in boh cases empty value means “watch all”)
This can be easily remedied by generating the equivalend of the follwing yq
command
yq ea -i '.spec.install.spec.deployments[0].spec.template.spec.containers[0].env += [{"name": "QUARKUS_OPERATOR_SDK_NAMESPACES", "valueFrom": {"fieldRef": {"fieldPath": "metadata.annotations['"'"'olm.targetNamespaces'"'"']"}}}]' "$CSV_PATH"
The @CSVMetadata
annotation is too static – in a sense that it doesn’t allow setting values from properties. Modifying the sourcecs to change e.g. spec.replaces
of the generated CSV is not really practical.
This could be improved (for example) by one of the following
- Introduce new @CsvMetadata.ConfigValue(“prop.name”) annotation which could be used as the following
@CSVMetadata(replaces = @CsvMetadata.ConfigValue("dbz.version.prev"))
DebeziumCsvMetadata
This has of course the downside of replaces
no longer being a plain string. So we would have to figure out a more polished approach
- Simply make all CSV metadata defaults configurable via properties. So one would siply set a property during buld (or in application.properties) e.g.
quarkus.operator-sdk.bundle.metadata.replaces=X.Y.Z
This might be of course a bit more complex for metadata which are not a simple type (e.g. installModes)
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 18 (15 by maintainers)
Commits related to this issue
- feat: add env var interpolating namespaces from OLM in CSV manifests Fixes #711 Signed-off-by: Chris Laprun <claprun@redhat.com> — committed to quarkiverse/quarkus-operator-sdk by metacosm 9 months ago
- feat: add env var interpolating namespaces from OLM in CSV manifests (#714) Fixes #711 Signed-off-by: Chris Laprun <claprun@redhat.com> — committed to quarkiverse/quarkus-operator-sdk by metacosm 9 months ago
You’d current have to do something like:
quarkus.kubernetes.env.fields.“quarkus.operator-sdk.namespaces”=metadata.annotations[‘olm.targetNamespaces’]
Or if you have a deployment fragment, add in something similar.
However that does seem cumbersome - this is something that the sdk could take care of.
It does appear to be the case https://github.com/debezium/debezium-operator/pull/9/files#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8R47
OLM integration is just not merged yet (this PR was linked here multiple times 😉)