45
45
shift $(( OPTIND - 1 ))
46
46
47
47
# Select bundle documents
48
- function select-bundle-documents() {
48
+ select-bundle-documents () {
49
49
jq ' select(.schema == "olm.bundle")'
50
50
}
51
51
52
52
# Select bundles that declare AllNamespace install mode
53
53
# 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 () {
55
55
jq ' select(
56
56
all(.properties[].type; . != "olm.csv.metadata") or
57
57
(.properties[]? |
@@ -65,23 +65,23 @@ function that-support-allnamespace-install-mode() {
65
65
}
66
66
67
67
# Select bundles without dependencies
68
- function that-dont-have-dependencies() {
68
+ that-dont-have-dependencies () {
69
69
jq ' select(all(.properties[].type; . != "olm.package.required" and . != "olm.gvk.required"))'
70
70
}
71
71
72
72
# Select the "olm.package" property from the bundles
73
73
# This contains the packageName and version information
74
- function extract-olm-package-property() {
74
+ extract-olm-package-property () {
75
75
jq ' .properties[] | select(.type == "olm.package") |.value'
76
76
}
77
77
78
78
# Group packages by name and collect versions into an array
79
- function group-versions-by-package-name() {
79
+ group-versions-by-package-name () {
80
80
jq -s ' group_by(.packageName) | map({packageName: .[0].packageName, versions: map(.version)})'
81
81
}
82
82
83
83
# Apply regex on name
84
- function filter-by-regex-if-necessary() {
84
+ filter-by-regex-if-necessary () {
85
85
jq --arg regex " $REGEX " '
86
86
if $regex != "" then
87
87
map(select(.packageName | test($regex)))
0 commit comments