You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jenkins: route cosign/crane helper images via PULL_REGISTRY
In Harbor modes (HARBOR_ENABLED=true) the controller has no cgr.dev
credentials, so pulling the cosign helper (cgSign/cgVerify) and the
crane agent (refresh-cgimages-digests) directly from cgr.dev failed.
Source them via $PULL_REGISTRY the same way cgImage() routes the
application build/test agents — cgr.dev/<org> in Mode A, anonymous
localhost/cgr-proxy/<org> in Modes B/C.
Also align the surrounding docs (cgImages README, refresh-cgimages-
digests README) with the real cgLogin/PULL_REGISTRY flow, and drop the
obsolete .secrets/ entry from .gitignore (the OIDC flow writes to
/tmp/cgjenkins-home/.docker, no in-repo secrets dir is created).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: jenkins/ops/refresh-cgimages-digests/README.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,14 @@ Scheduled Jenkins job that re-resolves every digest in the [cgImages shared-libr
6
6
7
7
| Stage | Image | Purpose |
8
8
|-------|-------|---------|
9
-
| Refresh digests |`cgr.dev/${CHAINGUARD_ORG}/crane:latest-dev`| Runs [refresh-digests.sh](../../shared-libraries/cg-images/refresh-digests.sh) which calls `crane digest` for each entry. |
9
+
| Auth | (controller) | Runs `cgLogin()` — in Mode A this exchanges a Jenkins OIDC token for a chainctl session and writes a fresh docker config to `$DOCKER_CONFIG`; in Modes B/C (Harbor) it's a no-op because pulls go anonymously through the Harbor proxy. |
10
+
| Refresh digests |`${PULL_REGISTRY}/crane:latest-dev`| Runs [refresh-digests.sh](../../shared-libraries/cg-images/refresh-digests.sh) which calls `crane digest` for each entry. |
10
11
11
-
The agent container gets:
12
-
-`DOCKER_CONFIG=/dockerconfig` pointed at the bind-mounted pull-token config (so `crane` can authenticate to `cgr.dev`)
13
-
-`/tmp/cgjenkins-home/shared-libraries` mounted **read-write** at `/sources` so the script can rewrite `vars/cgImage.groovy`
12
+
The agent container inherits the controller's mounts (Jenkins docker-workflow `--volumes-from`), so:
13
+
-`DOCKER_CONFIG=/tmp/cgjenkins-home/.docker` points at the controller's docker config — populated by `cgLogin()` in Mode A so `crane` can authenticate to `cgr.dev`; unused in Modes B/C where the Harbor proxy serves manifests anonymously.
14
+
-`/tmp/cgjenkins-home/shared-libraries` is bind-mounted **read-write** so the script can rewrite `vars/cgImage.groovy` in place.
15
+
16
+
The crane image itself is pulled via `PULL_REGISTRY` (not `cgr.dev` directly), matching how `cgImage()` routes application build/test agents — so this job works in Harbor modes even though the controller has no cgr.dev creds.
14
17
15
18
When digests change, the next sample-app pipeline picks them up automatically — the cgImages library is live-loaded from the same bind-mounted dir on every build. No Jenkins restart needed.
Copy file name to clipboardExpand all lines: jenkins/shared-libraries/cg-images/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ To refresh the digests (e.g. to pick up a security patch in the underlying image
48
48
./refresh-digests.sh
49
49
```
50
50
51
-
The script reads the current `repo:tag` portion of each pinned reference, calls `crane digest cgr.dev/$CHAINGUARD_ORG/<repo>:<tag>` for each, and rewrites the digest in place. Requires `crane`. It picks up `CHAINGUARD_ORG` from `../../.env` so refreshing matches the org the demo is configured for.
51
+
The script reads the current `repo:tag` portion of each pinned reference, calls `crane digest $PULL_REGISTRY/<repo>:<tag>` for each, and rewrites the digest in place. Requires `crane`. It picks up `CHAINGUARD_ORG`(and, optionally, `PULL_REGISTRY`) from `../../.env`— so refreshing matches the org and pull routing the demo is configured for: `cgr.dev/<org>` directly in Mode A, or the anonymous `localhost/cgr-proxy/<org>` Harbor cache in Modes B/C.
0 commit comments