Update the code for anka v3 compatibility (#7044)

This commit is contained in:
Alexey-Ayupov
2023-02-05 16:08:22 +03:00
committed by GitHub
parent 7a8e77b24a
commit 2109acacd5
2 changed files with 10 additions and 1 deletions

View File

@@ -16,7 +16,7 @@ function Push-AnkaTemplateToRegistry {
# if registry uuid doesn't match than delete an image in registry
$images = anka --machine-readable registry --registry-path $RegistryUrl list | ConvertFrom-Json | ForEach-Object body
$images | Where-Object name -eq $TemplateName | ForEach-Object {
$id = $_.id
$id = $_.uuid
Show-StringWithFormat "Deleting '$TemplateName[$id]' VM and '$TagName' tag"
$uri = '{0}/registry/vm?id={1}' -f $RegistryUrl, $id
Invoke-WebRequest -Uri $uri -Method Delete | Out-Null

View File

@@ -1,3 +1,12 @@
packer {
required_plugins {
veertu-anka = {
version = "= v3.1.0"
source = "github.com/veertuinc/veertu-anka"
}
}
}
variable "source_vm_name" {
type = string
}