Skip to content

PEM-9121: recreate virt-v2v pod on rerun so LUKS mount is picked up - #47

Draft
anujmandal-dev wants to merge 1 commit into
spectro-v2.9.2from
PEM-9121-fix
Draft

PEM-9121: recreate virt-v2v pod on rerun so LUKS mount is picked up#47
anujmandal-dev wants to merge 1 commit into
spectro-v2.9.2from
PEM-9121-fix

Conversation

@anujmandal-dev

@anujmandal-dev anujmandal-dev commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • Fixes PEM-9121: after a migration fails because spec.vms[].luks.name is missing, adding the LUKS secret and rerunning did not recover — the failed virt-v2v pod (created without the /etc/luks mount) was reused and the same could not read key from user error kept surfacing.
  • EnsureGuestConversionPod now looks up conversion pods scoped to the current migration UID first; if none exists, it deletes any stale conversion pods for the same plan+VM from prior attempts before creating a fresh pod, so the current plan spec (including the LUKS secret volume) is applied.
  • Pod-slot decision extracted into a small helper reserveConversionPodSlot and covered by three unit tests.

Test plan

  • go build ./pkg/controller/plan/...
  • go test ./pkg/controller/plan/ -run TestPlan -count=1 — 88/88 specs pass (3 new)
  • End-to-end: create a plan with LUKS disks but no luks.name, start migration, wait for failure, add luks.name to plan, rerun, confirm a new pod is created with /etc/luks mounted and the migration succeeds

Notes

  • Supersedes the prior WIP on remote branch PEM-9121 (Sharada's Feb-23 commit, no PR opened). This PR takes a broader approach — scoping the pod lookup by migration UID rather than only deleting Failed/Succeeded pods — and adds tests.
  • The upstream Jira note says this can be contributed back to konveyor/forklift; happy to open that PR after this one lands.

🤖 Generated with Claude Code

EnsureGuestConversionPod queried existing conversion pods with the
migration label stripped and skipped pod creation whenever any pod was
found. When a migration failed because spec.vms[].luks.name was not set
on the plan, the failed virt-v2v pod (created without the /etc/luks
mount) was reused on rerun, so the migration kept failing with
"could not read key from user" even after the LUKS secret was added.

Look up conversion pods scoped to the current migration UID first; if
none exists, delete any stale conversion pods for this plan+VM from
prior attempts before creating a fresh pod so the current plan spec
(including the LUKS secret volume mount) is applied.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@anujmandal-dev
anujmandal-dev requested a review from shphadnis July 15, 2026 11:13

@bulwark-sc-ent bulwark-sc-ent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ GoVulnCheck scan found vulnerabilities:

  1. GO-2026-4958
    • Module: github.com/moby/spdystream
    • Found in: v0.5.0
    • Fixed in: v0.5.1
    • Example Traces:
      1. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdy.newConnection
      2. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdy.NewClientConnectionWithPings
      3. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdystream.NewConnection
      4. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdystream.ReadFrame
  2. GO-2026-5026
    • Module: golang.org/x/net
    • Found in: v0.43.0
    • Fixed in: v0.55.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http2.authorityAddr
  3. GO-2026-4918
    • Module: golang.org/x/net
    • Found in: v0.43.0
    • Fixed in: v0.53.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      2. pkg/controller/plan/adapter/vsphere/client.go:180:32: vsphere.Close calls soap.CloseIdleConnections, which eventually calls http2.run
      3. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      4. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
  4. GO-2024-2955
    • Module: github.com/gin-contrib/cors
    • Found in: v1.3.1
    • Fixed in: v1.6.0
    • Example Traces:
      1. pkg/lib/inventory/web/web.go:45:21: web.Start calls cors.New, which eventually calls web.Start

Please review these findings and fix the issues before merging.

@bulwark-sc-ent bulwark-sc-ent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ GoVulnCheck scan found vulnerabilities:

  1. GO-2026-4958
    • Module: github.com/moby/spdystream
    • Found in: v0.5.0
    • Fixed in: v0.5.1
    • Example Traces:
      1. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdystream.ReadFrame
      2. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdy.newConnection
      3. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdy.NewClientConnectionWithPings
      4. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdystream.NewConnection
  2. GO-2026-4918
    • Module: golang.org/x/net
    • Found in: v0.43.0
    • Fixed in: v0.53.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      2. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      3. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      4. pkg/controller/plan/adapter/vsphere/client.go:180:32: vsphere.Close calls soap.CloseIdleConnections, which eventually calls http2.run
  3. GO-2024-2955
    • Module: github.com/gin-contrib/cors
    • Found in: v1.3.1
    • Fixed in: v1.6.0
    • Example Traces:
      1. pkg/lib/inventory/web/web.go:45:21: web.Start calls cors.New, which eventually calls web.Start
  4. GO-2026-5026
    • Module: golang.org/x/net
    • Found in: v0.43.0
    • Fixed in: v0.55.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http2.authorityAddr

Please review these findings and fix the issues before merging.

@shphadnis

Copy link
Copy Markdown

Hi @anujmandal-dev Changes look good. Have you tested out these changes?

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

This pull request is stale because it has been open for 15 days with no activity.

@github-actions github-actions Bot added the stale label Aug 1, 2026
@github-actions

Copy link
Copy Markdown

This pull request was closed because it has been inactive for 15 days since being marked as stale.

@github-actions github-actions Bot closed this Aug 17, 2026
@anujmandal-dev anujmandal-dev reopened this Sep 3, 2026

@bulwark-sc-ent bulwark-sc-ent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ GoVulnCheck scan found vulnerabilities:

  1. GO-2026-5970
    • Module: golang.org/x/text
    • Found in: v0.28.0
    • Fixed in: v0.39.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls idna.validateRegistration
      2. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls idna.validateAndMap
      3. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls idna.validateAndMap
      4. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls idna.validateAndMap
  2. GO-2024-2955
    • Module: github.com/gin-contrib/cors
    • Found in: v1.3.1
    • Fixed in: v1.6.0
    • Example Traces:
      1. pkg/lib/inventory/web/web.go:45:21: web.Start calls cors.New, which eventually calls web.Start
  3. GO-2026-4918
    • Module: golang.org/x/net
    • Found in: v0.43.0
    • Fixed in: v0.53.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      2. pkg/controller/plan/adapter/vsphere/client.go:180:32: vsphere.Close calls soap.CloseIdleConnections, which eventually calls http2.run
      3. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      4. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
  4. GO-2026-5026
    • Module: golang.org/x/net
    • Found in: v0.43.0
    • Fixed in: v0.55.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http2.authorityAddr
  5. GO-2026-4958
    • Module: github.com/moby/spdystream
    • Found in: v0.5.0
    • Fixed in: v0.5.1
    • Example Traces:
      1. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdystream.NewConnection
      2. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdystream.ReadFrame
      3. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdy.newConnection
      4. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdy.NewClientConnectionWithPings

Please review these findings and fix the issues before merging.

@bulwark-sc-ent bulwark-sc-ent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ GoVulnCheck scan found vulnerabilities:

  1. GO-2026-5970
    • Module: golang.org/x/text
    • Found in: v0.28.0
    • Fixed in: v0.39.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls idna.validateAndMap
      2. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls idna.validateRegistration
      3. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls idna.validateAndMap
      4. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls idna.validateAndMap
  2. GO-2026-4918
    • Module: golang.org/x/net
    • Found in: v0.43.0
    • Fixed in: v0.53.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      2. pkg/controller/plan/adapter/vsphere/client.go:180:32: vsphere.Close calls soap.CloseIdleConnections, which eventually calls http2.run
      3. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
      4. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http.roundTrip
  3. GO-2026-4958
    • Module: github.com/moby/spdystream
    • Found in: v0.5.0
    • Fixed in: v0.5.1
    • Example Traces:
      1. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdystream.NewConnection
      2. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdy.NewClientConnectionWithPings
      3. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdy.newConnection
      4. tests/suit/framework/exec_util.go:74:16: framework.ExecWithOptions calls framework.execute, which eventually calls spdystream.ReadFrame
  4. GO-2024-2955
    • Module: github.com/gin-contrib/cors
    • Found in: v1.3.1
    • Fixed in: v1.6.0
    • Example Traces:
      1. pkg/lib/inventory/web/web.go:45:21: web.Start calls cors.New, which eventually calls web.Start
  5. GO-2026-5026
    • Module: golang.org/x/net
    • Found in: v0.43.0
    • Fixed in: v0.55.0
    • Example Traces:
      1. pkg/controller/plan/adapter/ovirt/client.go:180:34: ovirt.PowerOn calls go-ovirt.Send, which eventually calls http2.authorityAddr

Please review these findings and fix the issues before merging.

@anujmandal-dev
anujmandal-dev marked this pull request as draft September 3, 2026 17:56
@github-actions github-actions Bot removed the stale label Sep 4, 2026
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.

2 participants