4545shift $(( OPTIND - 1 ))
4646
4747# Select bundle documents
48- function select-bundle-documents() {
48+ select-bundle-documents () {
4949 jq ' select(.schema == "olm.bundle")'
5050}
5151
5252# Select bundles that declare AllNamespace install mode
5353# or declare nothing at all (older released bundles sans "olm.csv.metadata" property)
54- function that-support-allnamespace-install-mode() {
54+ that-support-allnamespace-install-mode () {
5555 jq ' select(
5656 all(.properties[].type; . != "olm.csv.metadata") or
5757 (.properties[]? |
@@ -65,23 +65,23 @@ function that-support-allnamespace-install-mode() {
6565}
6666
6767# Select bundles without dependencies
68- function that-dont-have-dependencies() {
68+ that-dont-have-dependencies () {
6969 jq ' select(all(.properties[].type; . != "olm.package.required" and . != "olm.gvk.required"))'
7070}
7171
7272# Select the "olm.package" property from the bundles
7373# This contains the packageName and version information
74- function extract-olm-package-property() {
74+ extract-olm-package-property () {
7575 jq ' .properties[] | select(.type == "olm.package") |.value'
7676}
7777
7878# Group packages by name and collect versions into an array
79- function group-versions-by-package-name() {
79+ group-versions-by-package-name () {
8080 jq -s ' group_by(.packageName) | map({packageName: .[0].packageName, versions: map(.version)})'
8181}
8282
8383# Apply regex on name
84- function filter-by-regex-if-necessary() {
84+ filter-by-regex-if-necessary () {
8585 jq --arg regex " $REGEX " '
8686 if $regex != "" then
8787 map(select(.packageName | test($regex)))
0 commit comments