Skip to content

Commit cb2e7e5

Browse files
committed
docs: correct the guidance on vendored addon source URLs
The guide said these header comments are frequently stale and told the reader to fix the header to match the image tag. That is backwards. The header records which upstream revision the manifest body was derived from. Bumping a vendored addon is supposed to mean re-deriving the body from the new release and moving the header with it, so the two staying in agreement is the invariant. When they disagree the manifest has drifted and may be missing upstream changes that shipped with the newer image. Editing the header to match the image would assert a re-derivation that never happened and destroy the only record of what the body corresponds to. Say to re-derive instead, and warn against the shortcut.
1 parent 553b7db commit cb2e7e5

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

docs/dependency-updates.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,19 @@ header comment of their `helm-values.yaml`. A couple of `regenerate.sh` scripts
300300
output — read the script before assuming it is a plain `kustomize build`.
301301

302302
**Vendored addons** carry the upstream URL in a comment on the first few lines of the template,
303-
usually with the release tag embedded in the URL. **Bump the tag in that comment when you bump the
304-
addon** it is the only record of the source revision.
303+
usually with the release tag embedded in the URL. That header records **which upstream revision the
304+
manifest body was derived from**, and it is the only record of it.
305305

306-
> **These header comments are frequently stale**, sometimes by many minor versions. Read the
307-
> `image:` line for the current version, not the header — then fix the header.
306+
The header and the shipped `image:` tag are meant to stay in agreement, because bumping a vendored
307+
addon means re-deriving the manifest from the new upstream release and moving the header with it.
308+
309+
> **If the header and the image tag disagree, the manifest has drifted** — someone bumped the image
310+
> without re-deriving the body, so it may be missing upstream changes to RBAC, flags, probes, or
311+
> resource definitions. Treat that as a bug to report or fix, not as a stale comment.
312+
>
313+
> **Never resolve the disagreement by editing the header to match the image.** That asserts a
314+
> re-derivation that never happened and destroys the only record of what the body corresponds to.
315+
> Re-derive the manifest, then move the header.
308316
309317
Some addons have **no upstream pointer at all**; infer the source from the image registry and tag.
310318

@@ -317,8 +325,11 @@ Some addons have **no upstream pointer at all**; infer the source from the image
317325
`image.tag`. These are independent fields; both must move.
318326
- Pattern B/C → every `image:` line **and** every `app.kubernetes.io/version:` label.
319327
3. Refresh the manifest body: `./regenerate.sh`, or the `helm template` command from
320-
`helm-values.yaml`, or re-download the upstream YAML and re-apply the kOps deltas by hand.
321-
4. Update the upstream-source URL comment at the top of the template.
328+
`helm-values.yaml`, or re-download the upstream YAML at the new tag and re-apply the kOps deltas
329+
by hand. Do not skip this and change only the image tag — that is what causes the drift described
330+
above.
331+
4. Update the upstream-source URL comment at the top of the template to the tag you just derived
332+
from.
322333
5. `./hack/update-expected.sh`, and `git rm` any orphaned golden file.
323334
6. `make test` (or at minimum `go test ./cmd/kops/... ./upup/pkg/fi/cloudup/...`).
324335

0 commit comments

Comments
 (0)