Make the registry hostname configurable and drop the CA mount
buildDocker.groovy hardcoded harbor.35.238.248.203.nip.io as the push target, so the registry could not move without editing this shared library and every consumer moving in the same commit. It now reads config.harbor_registry, whose default lives in homelabPipeline.groovy beside harbor_project and every other key. The stage errors rather than defaulting when the value is missing. Carrying a second copy of the literal would leave two defaults free to disagree, and an unset value would otherwise build an image named "null/<project>/<repo>" — which docker accepts as a hostname and then fails to resolve, pointing nowhere near the cause. The dind pod no longer mounts the registry CA. That mount existed because the registry was a nip.io name, which no public CA will issue for, so cert-manager signed Harbor from a private CA; the node pool was told to trust it for pulls, but a push comes from dockerd inside the build pod, which has its own trust store. harbor.infra.deployshed.com carries a Let's Encrypt certificate that both already trust, so the mount, its volume and the whole arrangement go away rather than being repointed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEsTefWWifp4ikvhHF5s6N
This commit is contained in:
co-authored by
Claude Opus 5
parent
a9119d7b8e
commit
6d743cbe48
@@ -29,6 +29,17 @@ def call(Map config) {
|
||||
// "unauthorized: project <name> not found", which reads like a
|
||||
// credentials problem rather than a missing project.
|
||||
config.harbor_project = config.harbor_project ?: 'apps-registry'
|
||||
// The registry hostname images are pushed to and pulled from. This is
|
||||
// the ONLY default for it — buildDocker.groovy deliberately errors
|
||||
// rather than carrying a second copy, since two defaults for one value
|
||||
// are free to disagree and the loser only shows up as a push to the
|
||||
// wrong registry.
|
||||
//
|
||||
// It must be spelled identically here, in the dockerconfigjson auths
|
||||
// key, and in Harbor's own externalURL: docker matches both stored
|
||||
// credentials and TLS trust by exact hostname, so a mismatch fails as
|
||||
// "unauthorized" rather than as anything resembling a name problem.
|
||||
config.harbor_registry = config.harbor_registry ?: 'harbor.infra.deployshed.com'
|
||||
// Cluster DNS, not the ingress hostname: this clone happens from a build
|
||||
// pod, so it is pod-to-pod traffic and has no business leaving the
|
||||
// cluster and coming back in through Contour.
|
||||
|
||||
Reference in New Issue
Block a user