Skip to content

Commit b8640e0

Browse files
committed
Update preview script
Now the preview will work with remote charts, and local charts as well. Default helm registry will be oci://quay.io/repository/hybridcloudpatterns/.
1 parent 0d1cda8 commit b8640e0

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

scripts/preview.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
# DISCLAIMER
44
#
5-
# - Parsing of applications needs to be more clever. Currently the code assumes that all
6-
# targets will be local charts. This is not true, for example, in industrial-edge.
5+
# - Parsing of applications needs to be more clever.
76
# - There is currently not a mechanism to actually preview against multiple clusters
87
# (i.e. a hub and a remote). All previews will be done against the current.
98
# - Make output can be included in the YAML.
@@ -22,11 +21,22 @@ if [ "${APPNAME}" != "clustergroup" ]; then
2221
# path: charts/all/foo
2322
# So we retrieve the actual index ("foobar") given the name attribute of the application
2423
APP=$(yq ".clusterGroup.applications | with_entries(select(.value.name == \"$APPNAME\")) | keys | .[0]" values-$SITE.yaml)
25-
chart=$(yq ".clusterGroup.applications.$APP.path" values-$SITE.yaml)
24+
isLocalHelmChart=$(yq ".clusterGroup.applications.$APP.path" values-$SITE.yaml)
25+
if [ $isLocalHelmChart != "null" ]; then
26+
chart=$(yq ".clusterGroup.applications.$APP.path" values-$SITE.yaml)
27+
else
28+
helmrepo=$(yq ".clusterGroup.applications.$APP.repoURL" values-$SITE.yaml)
29+
helmrepo="${helmrepo:+oci://quay.io/hybridcloudpatterns}"
30+
chartversion=$(yq ".clusterGroup.applications.$APP.chartVersion" values-$SITE.yaml)
31+
chartname=$(yq ".clusterGroup.applications.$APP.chart" values-$SITE.yaml)
32+
chart="${helmrepo}/${chartname} --version ${chartversion}"
33+
fi
2634
namespace=$(yq ".clusterGroup.applications.$APP.namespace" values-$SITE.yaml)
2735
else
2836
APP=$APPNAME
29-
chart="common/clustergroup"
37+
clusterGroupChartVersion=$(yq ".main.multiSourceConfig.clusterGroupChartVersion" values-global.yaml)
38+
helmrepo="oci://quay.io/hybridcloudpatterns"
39+
chart="${helmrepo}/clustergroup --version ${clusterGroupChartVersion}"
3040
namespace="openshift-operators"
3141
fi
3242
pattern=$(yq ".global.pattern" values-global.yaml)

0 commit comments

Comments
 (0)