Skip to content

Commit

Permalink
Virt-v2v: read LUKS keys
Browse files Browse the repository at this point in the history
This patch will read the given LUKS key provided to the container and
add them as arguments to the virt-v2v command. Since virt-v2v supports
this feature only since 2.2, it applies only for cold migrations.
It uses the `all:key` selector to each passphrase.

Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed May 23, 2024
1 parent bac55b7 commit 96b9f0c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions virt-v2v/cold/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ func buildCommand() []string {
virtV2vArgs = append(virtV2vArgs, "--mac", macToIp)
}
}
// Adds LUKS keys, if exist.
if envLUKS := os.Getenv("V2V_luks"); envLUKS != "" {
for _, key := range strings.Split(envLUKS, "\n") {
virtV2vArgs = append(virtV2vArgs, "--key", fmt.Sprintf("all:key:%s", key))
}
}

if info, err := os.Stat(VDDK); err == nil && info.IsDir() {
virtV2vArgs = append(virtV2vArgs,
Expand Down

0 comments on commit 96b9f0c

Please sign in to comment.