@@ -68,11 +68,7 @@ preview-%:
6868
6969.PHONY : operator-deploy
7070operator-deploy operator-upgrade : validate-prereq validate-origin validate-cluster # # runs helm install
71- @set -e -o pipefail
72- # Retry five times because the CRD might not be fully installed yet
73- for i in {1..5}; do \
74- helm template --include-crds --name-template $(NAME ) $(PATTERN_INSTALL_CHART ) $(HELM_OPTS ) | oc apply -f- && break || sleep 10; \
75- done
71+ @common/scripts/deploy-pattern.sh $(NAME ) $(PATTERN_INSTALL_CHART ) $(HELM_OPTS )
7672
7773.PHONY : uninstall
7874uninstall : # # runs helm uninstall
@@ -129,12 +125,22 @@ token-kubeconfig: ## Create a local ~/.kube/config with password (not usually ne
129125
130126# We only check the remote ssh git branch's existance if we're not running inside a container
131127# as getting ssh auth working inside a container seems a bit brittle
128+ # If the main repoUpstreamURL field is set, then we need to check against
129+ # that and not target_repo
132130.PHONY : validate-origin
133131validate-origin : # # verify the git origin is available
134132 @echo " Checking repository:"
135- @echo -n " $( TARGET_REPO) - branch '$( TARGET_BRANCH) ': "
136- @git ls-remote --exit-code --heads $(TARGET_REPO ) $(TARGET_BRANCH ) > /dev/null && \
137- echo " OK" || (echo " NOT FOUND" ; exit 1)
133+ $(eval UPSTREAMURL := $(shell yq -r '.main.git.repoUpstreamURL // (.main.git.repoUpstreamURL = "") ' values-global.yaml) )
134+ @if [ -z " $( UPSTREAMURL) " ]; then\
135+ echo -n " $( TARGET_REPO) - branch '$( TARGET_BRANCH) ': " ; \
136+ git ls-remote --exit-code --heads $(TARGET_REPO ) $(TARGET_BRANCH ) > /dev/null && \
137+ echo " OK" || (echo " NOT FOUND" ; exit 1); \
138+ else\
139+ echo " Upstream URL set to: $( UPSTREAMURL) " ; \
140+ echo -n " $( UPSTREAMURL) - branch '$( TARGET_BRANCH) ': " ; \
141+ git ls-remote --exit-code --heads $(UPSTREAMURL ) $(TARGET_BRANCH ) > /dev/null && \
142+ echo " OK" || (echo " NOT FOUND" ; exit 1); \
143+ fi
138144
139145.PHONY : validate-cluster
140146validate-cluster : # # Do some cluster validations before installing
0 commit comments