Skip to content

feat(manifests): honour the version argument, carry two Knative versions - #37

Merged
pyramation merged 1 commit into
mainfrom
feat/per-version-resources
Aug 13, 2026
Merged

feat(manifests): honour the version argument, carry two Knative versions#37
pyramation merged 1 commit into
mainfrom
feat/per-version-resources

Conversation

@pyramation

Copy link
Copy Markdown
Collaborator

getOperatorResources(id, version) accepted a version and ignored it, returning whatever codegen emitted as the default — the last version pulled.

That's not theoretical. It's what cost us the 18-minute failures: adding a second Knative version silently redirected the e2e suite at it. The suite pinned v1.15.0, reported installing v1.15.0, and applied v1.22.1 — then failed against a version nobody had chosen, while every log line named the right one.

The fix

A version now reads that version's vendored YAML. Read rather than embedded — carrying every version's docs in the generated objects would multiply the output by the number of versions, and the YAML already ships for getOperatorManifestPaths.

Callers passing no version keep the generated objects, so nothing existing changes.

Verified by reading the resources back

v1.15.0 -> 72 resources, webhook labelled 1.15.0
v1.22.1 -> 72 resources, webhook labelled 1.22.1

The webhook Deployment's own version label — proof the selection reaches the resources, which the old code could not produce.

Knative carries both versions again

This repo's e2e installs v1.15.0; downstream deploys v1.22.1. Each asks for the one it runs, which is what sources: Source[] was always for.

The plumbing was already there — setup.ts:151 has always passed operator.version through. Only the final accessor discarded it.

What this unblocks

Downstream can now consume this package for Knative instead of vendoring its own copy or fetching from GitHub releases at run time — the determinism goal this package exists for.

The real test is CI: the e2e pins v1.15.0 while the package carries both. If it comes back green at ~2.5 min, version selection holds end to end.

getOperatorResources accepted a version and ignored it, returning whatever
codegen emitted as the default -- the last version pulled. Every caller
therefore got the same resources regardless of what it asked for, and the
mismatch was invisible because logs still echoed the requested version.

That is not theoretical. Adding a second Knative version to this package
silently redirected the e2e suite at it: the suite pinned v1.15.0, reported
installing v1.15.0, and applied v1.22.1. It then failed for eighteen minutes
against a version nobody had chosen.

A version now reads that version's vendored YAML. Read rather than embedded:
carrying every version's docs in the generated objects would multiply the
output by the number of versions, and the YAML already ships for
getOperatorManifestPaths. Callers passing no version keep the generated
objects, so nothing existing changes.

With that fixed, Knative carries v1.15.0 and v1.22.1 again -- this repo's e2e
installs the former, downstream deploys the latter, and each asks for the one
it runs. Verified by reading back the webhook Deployment's version label:

  v1.15.0 -> 72 resources, webhook labelled 1.15.0
  v1.22.1 -> 72 resources, webhook labelled 1.22.1

The plumbing was already in place -- setup.ts has always passed
operator.version through; only the final accessor discarded it.
@pyramation
pyramation merged commit da7a209 into main Aug 13, 2026
13 checks passed
@pyramation
pyramation deleted the feat/per-version-resources branch August 13, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant