Skip to content

Commit 8b229c1

Browse files
committed
Merge remote-tracking branch 'common-upstream/main' into common-automatic-update
2 parents 69a4216 + 0a2478c commit 8b229c1

7 files changed

Lines changed: 21 additions & 10 deletions

common/Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,18 @@ ifneq ("$(wildcard $(UUID_FILE))","")
2828
UUID_HELM_OPTS := --set main.analyticsUUID=$(UUID)
2929
endif
3030

31-
HELM_OPTS=-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO)" --set main.git.revision=$(TARGET_BRANCH) $(TARGET_SITE_OPT) $(UUID_HELM_OPTS) $(EXTRA_HELM_OPTS)
31+
# Set the secret name *and* its namespace when deploying from private repositories
32+
# The format of said secret is documented here: https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#repositories
33+
TOKEN_SECRET ?=
34+
TOKEN_NAMESPACE ?=
35+
36+
ifeq ($(TOKEN_SECRET),)
37+
HELM_OPTS=-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO)" --set main.git.revision=$(TARGET_BRANCH) $(TARGET_SITE_OPT) $(UUID_HELM_OPTS) $(EXTRA_HELM_OPTS)
38+
else
39+
# When we are working with a private repository we do not escape the git URL as it might be using an ssh secret which does not use https://
40+
TARGET_CLEAN_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN))
41+
HELM_OPTS=-f values-global.yaml --set main.tokenSecret=$(TOKEN_SECRET) --set main.tokenSecretNamespace=$(TOKEN_NAMESPACE) --set main.git.repoURL="$(TARGET_CLEAN_REPO)" --set main.git.revision=$(TARGET_BRANCH) $(TARGET_SITE_OPT) $(UUID_HELM_OPTS) $(EXTRA_HELM_OPTS)
42+
endif
3243

3344

3445
##@ Pattern Common Tasks

common/operator-install/templates/pattern.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ spec:
88
gitSpec:
99
targetRepo: {{ .Values.main.git.repoURL }}
1010
targetRevision: {{ .Values.main.git.revision }}
11+
{{- if and .Values.main.tokenSecret .Values.main.tokenSecretNamespace }}
12+
tokenSecret: {{ .Values.main.tokenSecret }}
13+
tokenSecretNamespace: {{ .Values.main.tokenSecretNamespace }}
14+
{{- end }} {{/* if and .Values.main.tokenSecret .Values.main.tokenSecretNamespace */}}
1115
gitOpsSpec:
1216
operatorChannel: {{ default "gitops-1.8" .Values.main.gitops.channel }}
1317
operatorSource: {{ default "redhat-operators" .Values.main.gitops.operatorSource }}
@@ -16,10 +20,6 @@ spec:
1620
{{- if .Values.main.analyticsUUID }}
1721
analyticsUUID: {{ .Values.main.analyticsUUID }}
1822
{{- end }} {{/* if .Values.main.analyticsUUID */}}
19-
{{- if and .Values.main.tokenSecret .Values.main.tokenSecretNamespace }}
20-
tokenSecret: {{ .Values.main.tokenSecret }}
21-
tokenSecretNamespace: {{ .Values.main.tokenSecretNamespace }}
22-
{{- end }} {{/* if and .Values.main.tokenSecret .Values.main.tokenSecretNamespace */}}
2323
{{- if .Values.main.extraParameters }}
2424
extraParameters:
2525
{{- range .Values.main.extraParameters }}

common/tests/operator-install-industrial-edge-factory.expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
clusterGroupName: example
2525
gitSpec:
2626
targetRepo: https://github.com/pattern-clone/mypattern
27-
targetRevision: main
27+
targetRevision: main
2828
gitOpsSpec:
2929
operatorChannel: gitops-1.8
3030
operatorSource: redhat-operators

common/tests/operator-install-industrial-edge-hub.expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
clusterGroupName: example
2525
gitSpec:
2626
targetRepo: https://github.com/pattern-clone/mypattern
27-
targetRevision: main
27+
targetRevision: main
2828
gitOpsSpec:
2929
operatorChannel: gitops-1.8
3030
operatorSource: redhat-operators

common/tests/operator-install-medical-diagnosis-hub.expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
clusterGroupName: example
2525
gitSpec:
2626
targetRepo: https://github.com/pattern-clone/mypattern
27-
targetRevision: main
27+
targetRevision: main
2828
gitOpsSpec:
2929
operatorChannel: gitops-1.8
3030
operatorSource: redhat-operators

common/tests/operator-install-naked.expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
clusterGroupName: default
2525
gitSpec:
2626
targetRepo: https://github.com/pattern-clone/mypattern
27-
targetRevision: main
27+
targetRevision: main
2828
gitOpsSpec:
2929
operatorChannel: gitops-1.8
3030
operatorSource: redhat-operators

common/tests/operator-install-normal.expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
clusterGroupName: example
2525
gitSpec:
2626
targetRepo: https://github.com/pattern-clone/mypattern
27-
targetRevision: main
27+
targetRevision: main
2828
gitOpsSpec:
2929
operatorChannel: gitops-1.8
3030
operatorSource: redhat-operators

0 commit comments

Comments
 (0)