Skip to content

Commit cb9264d

Browse files
committed
fix: remove ACM workaround, bump ACM chart to 0.2.x
The duplicate bootstrap_secrets entry targeting openshift-gitops is no longer needed. The VP operator (0.0.70+) copies credentials into vp-gitops and automatically sets global.vpArgoNamespace. The ACM chart 0.2.x reads that variable, so the private-repo policy resolves without any manual override or duplicate secret. - Remove second bootstrap_secrets entries (SSH and HTTPS workarounds) - Bump ACM chartVersion from 0.1.* to 0.2.* - Update docs/private-repos.md and values-secret.yaml.template comments Signed-off-by: Min Zhang <minzhang@redhat.com>
1 parent 62dc5ea commit cb9264d

3 files changed

Lines changed: 32 additions & 76 deletions

File tree

docs/private-repos.md

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ from a private Git repository.
55

66
The Validated Patterns framework supports deploying from both SSH-secured and
77
HTTPS-secured (PAT) private repositories. The mechanism works by creating an
8-
ArgoCD repository secret **before** the pattern is deployed, so that both the
9-
Cluster ArgoCD and Hub ArgoCD instances can pull the pattern manifests.
8+
ArgoCD repository secret **before** the pattern is deployed, so that the VP
9+
operator can propagate credentials to all ArgoCD instances managed by the
10+
pattern.
1011

1112
> [!NOTE]
1213
> The upstream documentation is at
@@ -71,21 +72,6 @@ bootstrap_secrets:
7172
value: "true"
7273
- name: sshPrivateKey
7374
path: ~/.ssh/ztvp-deploy-key
74-
# ACM workaround (see Troubleshooting)
75-
- name: vp-private-repo-credentials
76-
targetNamespaces:
77-
- openshift-gitops
78-
labels:
79-
argocd.argoproj.io/secret-type: repository
80-
fields:
81-
- name: type
82-
value: git
83-
- name: url
84-
value: git@github.com:YOUR-ORG/layered-zero-trust.git
85-
- name: insecureIgnoreHostKey
86-
value: "true"
87-
- name: sshPrivateKey
88-
path: ~/.ssh/ztvp-deploy-key
8975
```
9076
9177
### 4. Deploy
@@ -139,21 +125,6 @@ bootstrap_secrets:
139125
value: YOUR-USERNAME
140126
- name: password
141127
path: ~/.config/validated-patterns/git-pat
142-
# ACM workaround (see Troubleshooting)
143-
- name: vp-private-repo-credentials
144-
targetNamespaces:
145-
- openshift-gitops
146-
labels:
147-
argocd.argoproj.io/secret-type: repository
148-
fields:
149-
- name: type
150-
value: git
151-
- name: url
152-
value: https://github.com/YOUR-ORG/layered-zero-trust.git
153-
- name: username
154-
value: YOUR-USERNAME
155-
- name: password
156-
path: ~/.config/validated-patterns/git-pat
157128
```
158129
159130
> [!NOTE]
@@ -192,8 +163,14 @@ for actual access; the validation is only a local convenience check.
192163

193164
3. The `TOKEN_SECRET` and `TOKEN_NAMESPACE` Make variables set the
194165
`tokenSecret` and `tokenSecretNamespace` fields on the Pattern Custom
195-
Resource, which propagates the credentials to all ArgoCD instances
196-
managed by the pattern.
166+
Resource. The VP operator copies the secret as
167+
`vp-private-repo-credentials` into `vp-gitops` (its managed ArgoCD
168+
namespace).
169+
170+
4. The ACM chart (0.2.x+) `vp-private-hub-policy` copies credentials from
171+
`global.vpArgoNamespace`, which the VP operator automatically sets to
172+
`vp-gitops`. This allows the policy to find the secret the VP operator
173+
placed there without any manual override.
197174

198175
## Verifying
199176

@@ -206,10 +183,19 @@ oc get secret private-repo -n openshift-operators \
206183

207184
Expected output: `repository`
208185

186+
Confirm the VP operator propagated the credential to `vp-gitops`:
187+
188+
```shell
189+
oc get secret vp-private-repo-credentials -n vp-gitops \
190+
-o jsonpath='{.metadata.labels.argocd\.argoproj\.io/secret-type}'
191+
```
192+
193+
Expected output: `repository`
194+
209195
Check the Cluster ArgoCD can see the repository:
210196

211197
```shell
212-
oc get application layered-zero-trust-hub -n openshift-gitops \
198+
oc get application layered-zero-trust-hub -n vp-gitops \
213199
-o jsonpath='{.status.sync.status}'
214200
```
215201

@@ -218,11 +204,11 @@ Expected output: `Synced` (or `OutOfSync` if you have uncommitted changes).
218204
## Troubleshooting
219205

220206
* **ACM shows Degraded (vp-private-hub-policy NonCompliant)** -- The ACM
221-
chart policy copies repo credentials from `openshift-gitops`, but the VP
222-
operator only places them in `vp-gitops`. Fix this by adding a second
223-
`bootstrap_secrets` entry named `vp-private-repo-credentials` targeting
224-
`openshift-gitops` (see the "ACM workaround" section in
225-
`values-secret.yaml.template`). Then re-run `load-secrets`.
207+
chart 0.1.x has `openshift-gitops` hardcoded in the private-repo policy
208+
template, but the VP operator (0.0.70+) places credentials in
209+
`vp-gitops`. Ensure `values-hub.yaml` uses ACM chart 0.2.x or later
210+
(`chartVersion: 0.2.*`), which reads `global.vpArgoNamespace` -- a value
211+
the VP operator sets automatically.
226212

227213
* **ArgoCD shows "repository not accessible"** -- Verify the SSH key or PAT
228214
has read access. For SSH, confirm the key has no passphrase (`ssh-keygen
@@ -238,7 +224,7 @@ Expected output: `Synced` (or `OutOfSync` if you have uncommitted changes).
238224
publicly trusted CAs and do not require this step.
239225

240226
The corporate CA must be in the cluster trust store **before** install
241-
because the VP operator needs it to clone the repo. Add the internal CA
227+
because the VP operator needs it to clone the repository. Add the internal CA
242228
as a pre-install step:
243229

244230
```shell

values-hub.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ clusterGroup:
276276
namespace: open-cluster-management
277277
project: hub
278278
chart: acm
279-
chartVersion: 0.1.*
279+
chartVersion: 0.2.*
280280
annotations:
281281
argocd.argoproj.io/sync-wave: "5"
282282
ignoreDifferences:

values-secret.yaml.template

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ secrets:
422422
# in a container that does not have the Git host's SSH fingerprint in its
423423
# known_hosts file. Without this flag, SSH connections fail with
424424
# "knownhosts: key is unknown".
425+
#
426+
# The VP operator copies this secret as vp-private-repo-credentials into
427+
# vp-gitops (its managed ArgoCD namespace). The ACM chart (0.2.x+) reads
428+
# global.vpArgoNamespace which the VP operator sets automatically.
425429

426430
#bootstrap_secrets:
427431
#- name: private-repo
@@ -438,24 +442,6 @@ secrets:
438442
# value: "true"
439443
# - name: sshPrivateKey
440444
# path: ~/.ssh/ztvp-deploy-key
441-
#
442-
# ACM workaround: The ACM chart policy copies repo credentials from
443-
# openshift-gitops, but the VP operator only places them in vp-gitops.
444-
# This second entry ensures the ACM policy can resolve.
445-
#- name: vp-private-repo-credentials
446-
# targetNamespaces:
447-
# - openshift-gitops
448-
# labels:
449-
# argocd.argoproj.io/secret-type: repository
450-
# fields:
451-
# - name: type
452-
# value: git
453-
# - name: url
454-
# value: git@github.com:YOUR-ORG/layered-zero-trust.git
455-
# - name: insecureIgnoreHostKey
456-
# value: "true"
457-
# - name: sshPrivateKey
458-
# path: ~/.ssh/ztvp-deploy-key
459445

460446
# --- OPTION B: HTTPS with Personal Access Token (PAT) ---
461447
# Create a PAT with read access to your repository.
@@ -477,19 +463,3 @@ secrets:
477463
# value: YOUR-USERNAME
478464
# - name: password
479465
# path: ~/.config/validated-patterns/git-pat
480-
#
481-
# ACM workaround (HTTPS version):
482-
#- name: vp-private-repo-credentials
483-
# targetNamespaces:
484-
# - openshift-gitops
485-
# labels:
486-
# argocd.argoproj.io/secret-type: repository
487-
# fields:
488-
# - name: type
489-
# value: git
490-
# - name: url
491-
# value: https://github.com/YOUR-ORG/layered-zero-trust.git
492-
# - name: username
493-
# value: YOUR-USERNAME
494-
# - name: password
495-
# path: ~/.config/validated-patterns/git-pat

0 commit comments

Comments
 (0)