Skip to content

Testkube CRDs are installed twice: by the chart and by vendored copies #263

Open

Description

@devantler

🤖 Generated by the Agentic Engineer (interactive Claude Code session)

Evidence

Found by the raw-manifest sweep on #205, against main at 679fe8b (2026-10-24):

  • k8s/bases/infrastructure/controllers/testkube/custom-resource-definitions/ vendors 13 Testkube CRDs, and the same directory's HelmRelease installs the Testkube chart, whose operator subchart installs those CRDs by default (testkube-operator.installCRD: true in the upstream values).
  • The vendored copies carry Helm's own ownership annotations (meta.helm.sh/release-name: testkube), so they look like a dump of an earlier chart install.
  • Nothing in the template uses a Testkube custom resource, so the copies give validation nothing either.

Audience and problem

Operators of platforms built from this template. Two owners apply the same CRDs: the chart moves them on every chart upgrade, and Flux re-applies the frozen copies, so the CRDs can drift back to an older schema after an upgrade, and the copies have to be refreshed by hand.

Smallest useful change

Confirm why the copies were added (history before this clone's depth). If nothing depends on them, remove them and let the chart own the CRDs; if something does, record that reason next to them.

Acceptance criteria

  • Exactly one owner installs the Testkube CRDs, or the copies carry the reason they must stay.
  • Both provider renders and both ksail workload validate runs stay green.

Size

XS.

Activity

  1. added theissue type on Oct 24, 2026
  2. moved this to 📥 Backlog in 🌊 Project Boardon Oct 24, 2026
  3. devantler commented on Oct 25, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer (interactive Claude Code session)

    Refined (2026-10-25): removing the copies in one step is not safe for existing platforms. Kept open, not implemented.

    What I checked, against main at 679fe8b:

    • Why the copies exist. They arrived with the template's first commit (39ac525), copied from the reference platform. The platform later removed its whole Testkube tree as dead weight (chore(infrastructure): remove dead Testkube manifests platform#2013); no commit here records a reason to keep the copies.
    • The chart already owns them. helm template of the pinned chart (2.9.5) renders 15 Testkube CRDs from its operator subchart's templates, while the template vendors only 13, so the chart is already the only source of two of them. The chart's one custom resource is a post-install/post-upgrade hook, so it never needs the CRDs before the release itself creates them.
    • The hazard. The infrastructure-controllers Flux Kustomization runs with prune: true. Deleting the files makes Flux garbage-collect the live CRDs on every platform already running the template, and Kubernetes then deletes every Testkube resource of those kinds (tests, workflows, execution history) before Helm's drift correction recreates the empty CRDs. Flux skips a prune only when the live object carries kustomize.toolkit.fluxcd.io/prune: disabled, so the annotation has to reach clusters before the files go.

    Proposed delivery, in two template releases:

    1. Add kustomize.toolkit.fluxcd.io/prune: disabled to the 13 vendored CRDs, so Flux stops being able to delete them.
    2. In a later release, remove the vendored copies and their naming-gate exemptions. The chart stays the only owner.

    A platform that takes both template-sync updates in one jump still gets the prune. So step 2 needs either a waiting period recorded on this issue, or a note in the sync pull request telling owners who use Testkube to apply step 1 first. A separate question, not decided here: whether the template should keep Testkube at all now that the reference platform has dropped it.

    Acceptance criteria are unchanged.

  4. added a commit that references this issue on Oct 28, 2026
  5. devantler commented on Oct 28, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer

    The removal needs a staged ownership handoff that preserves existing user data. Keep this issue open until that migration has passed its normal validation and adoption checks. No deletion was performed; this investigation is not counted as a completed resolution.

  6. devantler commented on Nov 3, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer

    Rechecked against current main a54b1461e6fbbfd57835c06bb79d5dc3dd37ec3c: the HelmRelease now pins Testkube 2.14.2 with empty values, while the template still vendors 13 CRDs.

    The current chart defaults testkube-operator.enabled to false, but that does not eliminate the duplicate owner. An actual client-side helm template --include-crds of the exact pinned chart rendered 85 resources, including 15 CRDs. This was static chart rendering; no cluster was contacted or changed.

    The issue remains relevant. Keep the staged ownership handoff and existing data-preservation requirements; neither the chart bump nor the disabled operator justifies directly deleting the vendored CRDs.

  7. devantler commented on Nov 4, 2026

    @devantler
    ContributorAuthor

    Step 1 of the staged handoff is merged. #365 (merged as 7a6592f) adds kustomize.toolkit.fluxcd.io/prune: disabled to all 13 vendored Testkube CRDs through an inline patch in their kustomization.yaml; the vendored files are unchanged and both KSail validations pass. The template itself publishes no releases (its release workflow skips this repository); instances receive the change from main through their weekly template-sync PR.

    Remaining here (step 2): remove the vendored copies and their naming-gate exemptions so the chart is the only owner. Do it only once instances have had time to take this change; two weekly sync cycles puts the earliest review at 2026-11-17. The step-2 sync PR should still tell owners who use Testkube to merge the sync carrying this change first, because an instance that takes both in one sync would get the prune.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions