Skip to content

Commit 2f93c06

Browse files
authored
Merge pull request #467 from mbaldessari/common-automatic-update
Disable validate_origin if a token_secret is set
2 parents 39bf3ef + dd8cea4 commit 2f93c06

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

common/Makefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ ifneq ($(origin TARGET_SITE), undefined)
44
TARGET_SITE_OPT=--set main.clusterGroupName=$(TARGET_SITE)
55
endif
66

7-
# Set this to true if you want to skip any origin validation
8-
DISABLE_VALIDATE_ORIGIN ?= false
9-
ifeq ($(DISABLE_VALIDATE_ORIGIN),true)
10-
VALIDATE_ORIGIN :=
11-
else
12-
VALIDATE_ORIGIN := validate-origin
13-
endif
14-
157
# This variable can be set in order to pass additional helm arguments from the
168
# the command line. I.e. we can set things without having to tweak values files
179
EXTRA_HELM_OPTS ?=
@@ -48,6 +40,18 @@ endif
4840
TOKEN_SECRET ?=
4941
TOKEN_NAMESPACE ?= openshift-operators
5042

43+
# Set this to true if you want to skip any origin validation
44+
# if TOKEN_SECRET is set to something then we skip the validation as well
45+
DISABLE_VALIDATE_ORIGIN ?= false
46+
ifeq ($(DISABLE_VALIDATE_ORIGIN),true)
47+
VALIDATE_ORIGIN :=
48+
else ifneq ($(TOKEN_SECRET),)
49+
VALIDATE_ORIGIN :=
50+
else
51+
VALIDATE_ORIGIN := validate-origin
52+
endif
53+
54+
5155
ifeq ($(TOKEN_SECRET),)
5256
# SSH agents are not created for public repos (repos with no secret token) by the patterns operator so we convert to HTTPS
5357
TARGET_REPO := $(shell echo "$(TARGET_REPO_RAW)" | sed 's/^git@\(.*\):\(.*\)/https:\/\/\1\/\2/')

0 commit comments

Comments
 (0)