Skip to content

Chore/remove cdi#2394

Draft
Isteb4k wants to merge 12 commits into
mainfrom
chore/remove-cdi
Draft

Chore/remove cdi#2394
Isteb4k wants to merge 12 commits into
mainfrom
chore/remove-cdi

Conversation

@Isteb4k
Copy link
Copy Markdown
Contributor

@Isteb4k Isteb4k commented May 22, 2026

Description

Why do we need it, and what problem does it solve?

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: core
type: fix
summary: TODO

@Isteb4k Isteb4k added this to the v1.9.0 milestone May 22, 2026
Isteb4k and others added 5 commits May 22, 2026 13:12
…f config

The `importPackageImages` template emits entries that belong to the `import:`
section (they reference other images, not git sources). They were being
appended directly after the `git:` block, producing config where each
`- image:` / `before:` entry was parsed as an extra field of the git mount,
causing werf to reject it with `unknown fields: image, before`.

Co-authored-by: Cursor <[email protected]>
…ixture

After the CDI-as-operator removal, the disk importer is provided by the
standalone `virtual-disk-importer` image. Its camelCase name
`virtualDiskImporter` is referenced from
`templates/virtualization-controller/_helpers.tpl` via
`helm_lib_module_image`, so the kubeconform fixture must define a digest
for it. Without it, `helm template` fails with
`Image virtualization.virtualDiskImporter has no digest`.

Co-authored-by: Cursor <[email protected]>
…DI cleanup

The CDI removal commit added a `replace` directive in
images/virtualization-artifact/go.mod that pointed at a vendored copy of
the upstream API package under
images/cdi-artifact/containerized-data-importer/staging/..., but the
follow-up cleanup removed that entire `staging/` tree. As a result
`go mod download` (and every downstream `go build`/`go test`) failed
with: open .../staging/.../containerized-data-importer-api/go.mod: no
such file or directory.

Drop the dangling local replace so we resolve
kubevirt.io/containerized-data-importer-api v1.63.1 from the Go module
proxy, and restore the `fmt` import in cmd/virtualization-controller
that was accidentally dropped alongside the temporary debug print
removed by the same commit (the file still uses fmt.Sprintf).

Co-authored-by: Cursor <[email protected]>
@Isteb4k Isteb4k self-assigned this May 22, 2026
Isteb4k and others added 4 commits May 22, 2026 14:59
The changes that removed CDI and refactored VirtualDisk data sources to
the step-based pattern left a number of issues that golangci-lint v2.11
catches. Fix them in one pass:

- Drop unused helpers in pkg/controller/vd/internal/source/sources.go
  (setPhaseCondition*, getNodePlacement, retryPeriod,
  setQuotaExceededPhaseCondition, isStorageClassWFFC, the unused
  SupplementsCleaner / CleanUpSupplements / Cleaner). The step pattern
  handles these cases internally now.
- Drop the unused DiskService.isImmediateBindingMode helper.
- Auto-fix the gci/gofumpt/QF1008 issues in service/errors.go,
  storageprofile/storageprofile_controller.go, and the new VirtualDisk
  source tests.
- Replace the deprecated reconcile.Result.Requeue with RequeueAfter in
  Create{Importer,Uploader}Step, WaitForPVCImportStep, and the matching
  *_test.go assertions.
- Simplify VirtualImage reconcilePVCImportFromDVCR (its bool-result was
  always true) and inline the call sites in vi http/registry/upload.
- Cleanup gocritic findings in vd internal watchers (unlambda Pod
  watcher map func, singleCaseSwitch -> if in PVC watcher).
- test/e2e: drop the dangling local replace of
  containerized-data-importer-api (the staging tree was removed) so
  typecheck succeeds, and lowercase a few error strings in observer
  predicates flagged by ST1005.

Co-authored-by: Cursor <[email protected]>
…ub to drop CVEs

Trivy reports five github.com/docker/docker CVEs against the
cdi-importer binary (CVE-2026-34040, CVE-2026-33997, CVE-2026-41567,
CVE-2026-42306, CVE-2026-41568). docker/docker is only pulled into CDI
transitively via github.com/containers/image/v5/manifest, which uses
exactly one symbol — github.com/docker/docker/api/types/versions — for
manifest version comparison.

Mirror the workaround already in place in deckhouse/3p-containerized-data-importer:
keep a minimal staging/src/github.com/docker/docker stub that only
provides api/types/versions and an empty registry package, and replace
the upstream module with it. go mod tidy correspondingly prunes the
otel/grpc/genproto/containerd transitive dependencies that were only
brought in by the full docker/docker module.

Co-authored-by: Cursor <[email protected]>
The mocks regenerated in the previous chat were produced with a
different moq version that aliased k8s.io/api/storage/v1 as
storagev1. moq v0.5.3 (pinned in Taskfile.init.yaml) leaves the import
unaliased and uses *v1.StorageClass throughout, which is what the
"check auto-generated files are up-to-date" CI step expects. Run
`task controller:dev:gogenerate` and commit the resulting diff.

Co-authored-by: Cursor <[email protected]>
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