fix(promoter): correct Forgejo registry service hostname
CI / CI (pull_request) Failing after 2m6s

forgejo-gitea-http.cicd.svc.cluster.local (headless svc, port 3000)
not forgejo-gitea (doesn't exist). Also wire REGISTRY_BASE env var
in deployment.yaml so it can be overridden without code change.
This commit is contained in:
Admin Bot
2026-09-28 12:34:54 +08:00
parent 23fff1006a
commit 3ca654513f
3 changed files with 21 additions and 9 deletions
+10 -5
View File
@@ -31,7 +31,7 @@ const (
argoNamespace = "argocd"
saTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"
saCACertPath = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
defaultRegBase = "http://forgejo-gitea.cicd.svc.cluster.local:3000"
defaultRegBase = "http://forgejo-gitea-http.cicd.svc.cluster.local:3000"
defaultRegUser = "rock"
promoterTimeout = 20 * time.Second
)
@@ -224,10 +224,15 @@ func (p *ImagePromoter) patchApplication(ctx context.Context, entry promotionEnt
case "kustomize":
images := getKustomizeImages(app, entry.SourceIndex)
newImages := updateImageEntry(images, image, digest)
path := fmt.Sprintf("/spec/sources/%d/kustomize/images", entry.SourceIndex)
patch = []map[string]any{
{"op": "add", "path": path, "value": newImages},
}
// Patch the full kustomize block (not just /kustomize/images) so the
// op succeeds even when the kustomize key is absent from the source.
// These apps only use kustomize overrides for image pinning, so
// replacing the whole block is safe.
patch = []map[string]any{{
"op": "add",
"path": fmt.Sprintf("/spec/sources/%d/kustomize", entry.SourceIndex),
"value": map[string]any{"images": newImages},
}}
case "helm":
// Helm runners use spec.source (singular). Patch helm parameters