tadayosi commented on code in PR #3527:
URL: https://github.com/apache/camel-k/pull/3527#discussion_r949784327
##########
script/build_bundle_index.sh:
##########
@@ -58,43 +60,82 @@ fi
mkdir -p "${INDEX_DIR}"
-if [ ! -f ${INDEX_DIR}/bundles.yaml ]; then
- ${OPM} render ${BUNDLE_INDEX} -o yaml > ${INDEX_DIR}/bundles.yaml
+if [ ! -f ${INDEX_BASE_YAML} ]; then
+ ${OPM} render ${BUNDLE_INDEX} -o yaml > ${INDEX_BASE_YAML}
if [ $? != 0 ]; then
echo "Error: failed to render the base catalog"
exit 1
fi
fi
-${OPM} render --skip-tls -o yaml \
- ${BUNDLE_IMAGE} > ${PACKAGE_YAML}
-if [ $? != 0 ]; then
- echo "Error: failed to render the ${PACKAGE} bundle catalog"
- exit 1
+if [ ! -f ${PACKAGE_YAML} ]; then
+ ${OPM} render --skip-tls -o yaml \
+ ${BUNDLE_IMAGE} > ${PACKAGE_YAML}
+ if [ $? != 0 ]; then
+ echo "Error: failed to render the ${PACKAGE} bundle catalog"
+ exit 1
+ fi
fi
+#
+# Extract the camel-k channels
+#
+yq eval ". | select(.package == \"${PACKAGE}\" and .schema ==
\"olm.channel\")" ${INDEX_BASE_YAML} > ${CHANNELS_YAML}
Review Comment:
I don't think `yq` has been used anywhere else in the scripts before. It
should be better to note somewhere that `yq` is a requirement now and check the
existence of `yq` with `command -v` at the beginning of this script and fail
and warn early if it's not found.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]