From bf9c5d37bf3a6b10d9a91a03fdfd017d1e734bc6 Mon Sep 17 00:00:00 2001 From: IvanHunters Date: Thu, 23 Jul 2026 17:56:25 +0300 Subject: [PATCH] fix(talos-log-collector): keep image ref out of generated schema The first-party image-ref guard rejects values.schema.json: the annotated image struct baked ghcr.io/cozystack/cozystack/vector into the generated schema default, an unenumerated second copy of the runtime ref that the promote and mirror tooling never touches. Move the reference into images/vector.tag (the enumerated .tag storage shape, read via .Files.Get) so the schema no longer carries it, matching every other package. Stamp the tag from make image and regenerate schema and README. Signed-off-by: IvanHunters --- packages/system/talos-log-collector/Makefile | 6 ++--- packages/system/talos-log-collector/README.md | 18 ++++++--------- .../talos-log-collector/images/vector.tag | 1 + .../templates/daemonset.yaml | 4 ++-- .../tests/talos-log-collector_test.yaml | 3 ++- .../talos-log-collector/values.schema.json | 22 ------------------- .../system/talos-log-collector/values.yaml | 11 ---------- 7 files changed, 14 insertions(+), 51 deletions(-) create mode 100644 packages/system/talos-log-collector/images/vector.tag diff --git a/packages/system/talos-log-collector/Makefile b/packages/system/talos-log-collector/Makefile index 5aa8a78d1..8aad5bfee 100644 --- a/packages/system/talos-log-collector/Makefile +++ b/packages/system/talos-log-collector/Makefile @@ -18,10 +18,8 @@ image: $(call cache-args,vector) \ --metadata-file images/vector.json \ $(BUILDX_ARGS) - REPOSITORY="$(REGISTRY)/vector" \ - yq -i '.image.repository = strenv(REPOSITORY)' values.yaml - TAG=$(IMAGE_TAG)@$$(yq e '."containerimage.digest"' images/vector.json -o json -r) \ - yq -i '.image.tag = strenv(TAG)' values.yaml + echo "$(REGISTRY)/vector:$(IMAGE_TAG)@$$(yq e '."containerimage.digest"' images/vector.json -o json -r)" \ + > images/vector.tag rm -f images/vector.json generate: diff --git a/packages/system/talos-log-collector/README.md b/packages/system/talos-log-collector/README.md index 4a93ff7f7..090d1b82d 100644 --- a/packages/system/talos-log-collector/README.md +++ b/packages/system/talos-log-collector/README.md @@ -78,17 +78,13 @@ url: "tcp://127.0.0.1:5170/" ### Common parameters -| Name | Description | Type | Value | -| ------------------ | ---------------------------------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------- | -| `logLevel` | Vector log verbosity (trace, debug, info, warn, error). | `string` | `warn` | -| `listenPort` | TCP port bound on the node loopback (127.0.0.1) where Talos machine.logging pushes logs. | `int` | `5170` | -| `image` | Vector container image. | `object` | `{}` | -| `image.repository` | Image repository. | `string` | `ghcr.io/cozystack/cozystack/vector` | -| `image.tag` | Image tag (digest-pinned by the build). | `string` | `0.56.0-alpine@sha256:0eb66216f5f9322264e2ba83f4606428ef77a2cd4dea619a5bea610ac80ccc43` | -| `image.pullPolicy` | Image pull policy. | `string` | `IfNotPresent` | -| `resources` | Compute resources for the collector. | `object` | `{}` | -| `resources.cpu` | CPU request. | `quantity` | `100m` | -| `resources.memory` | Memory request and limit. | `quantity` | `128Mi` | +| Name | Description | Type | Value | +| ------------------ | ---------------------------------------------------------------------------------------- | ---------- | ------- | +| `logLevel` | Vector log verbosity (trace, debug, info, warn, error). | `string` | `warn` | +| `listenPort` | TCP port bound on the node loopback (127.0.0.1) where Talos machine.logging pushes logs. | `int` | `5170` | +| `resources` | Compute resources for the collector. | `object` | `{}` | +| `resources.cpu` | CPU request. | `quantity` | `100m` | +| `resources.memory` | Memory request and limit. | `quantity` | `128Mi` | ### VictoriaLogs destination diff --git a/packages/system/talos-log-collector/images/vector.tag b/packages/system/talos-log-collector/images/vector.tag new file mode 100644 index 000000000..7b6e15913 --- /dev/null +++ b/packages/system/talos-log-collector/images/vector.tag @@ -0,0 +1 @@ +ghcr.io/cozystack/cozystack/vector:0.56.0-alpine@sha256:0eb66216f5f9322264e2ba83f4606428ef77a2cd4dea619a5bea610ac80ccc43 diff --git a/packages/system/talos-log-collector/templates/daemonset.yaml b/packages/system/talos-log-collector/templates/daemonset.yaml index 59c88c0a5..ad76aa01b 100644 --- a/packages/system/talos-log-collector/templates/daemonset.yaml +++ b/packages/system/talos-log-collector/templates/daemonset.yaml @@ -39,8 +39,8 @@ spec: type: RuntimeDefault containers: - name: vector - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ $.Files.Get "images/vector.tag" | trim }}" + imagePullPolicy: IfNotPresent args: ["--config", "/etc/vector/vector.yaml"] livenessProbe: tcpSocket: diff --git a/packages/system/talos-log-collector/tests/talos-log-collector_test.yaml b/packages/system/talos-log-collector/tests/talos-log-collector_test.yaml index 7817e2cf6..5f4e2781d 100644 --- a/packages/system/talos-log-collector/tests/talos-log-collector_test.yaml +++ b/packages/system/talos-log-collector/tests/talos-log-collector_test.yaml @@ -2,7 +2,8 @@ suite: talos-log-collector receive/forward wiring # Pins the surface this package owns: # - the DaemonSet pulls the first-party vector image from the cozystack -# registry (repository is the load-bearing ref re-pinned by `make image`); +# registry (the load-bearing ref lives in images/vector.tag, re-pinned by +# `make image`); # - Talos logs are received on the node loopback via hostPort+hostIP (the pod # stays on the pod network for the sink; the loopback socket is published # via portmap), NOT via hostNetwork; diff --git a/packages/system/talos-log-collector/values.schema.json b/packages/system/talos-log-collector/values.schema.json index cbb9cd826..24c18b525 100644 --- a/packages/system/talos-log-collector/values.schema.json +++ b/packages/system/talos-log-collector/values.schema.json @@ -21,28 +21,6 @@ "maximum": 65535, "minimum": 1 }, - "image": { - "description": "Vector container image.", - "type": "object", - "default": {}, - "properties": { - "pullPolicy": { - "description": "Image pull policy.", - "type": "string", - "default": "IfNotPresent" - }, - "repository": { - "description": "Image repository.", - "type": "string", - "default": "ghcr.io/cozystack/cozystack/vector" - }, - "tag": { - "description": "Image tag (digest-pinned by the build).", - "type": "string", - "default": "0.56.0-alpine@sha256:0eb66216f5f9322264e2ba83f4606428ef77a2cd4dea619a5bea610ac80ccc43" - } - } - }, "resources": { "description": "Compute resources for the collector.", "type": "object", diff --git a/packages/system/talos-log-collector/values.yaml b/packages/system/talos-log-collector/values.yaml index e313b3988..3b45fb91b 100644 --- a/packages/system/talos-log-collector/values.yaml +++ b/packages/system/talos-log-collector/values.yaml @@ -17,17 +17,6 @@ logLevel: warn ## @maximum 65535 listenPort: 5170 -## @typedef {struct} Image - Vector container image. -## @field {string} [repository] - Image repository. -## @field {string} [tag] - Image tag (digest-pinned by the build). -## @field {string} [pullPolicy] - Image pull policy. - -## @param {Image} [image] - Vector container image. -image: - repository: ghcr.io/cozystack/cozystack/vector - tag: 0.56.0-alpine@sha256:0eb66216f5f9322264e2ba83f4606428ef77a2cd4dea619a5bea610ac80ccc43 - pullPolicy: IfNotPresent - ## @typedef {struct} Resources - Compute resources for the collector. ## @field {quantity} [cpu] - CPU request. ## @field {quantity} [memory] - Memory request and limit.