Add deprecation warning to GenerateResourcesAndImage helper (#8958)

This commit is contained in:
Vasilii Polikarpov
2023-12-06 13:56:10 +01:00
committed by GitHub
parent 5bd6a16cab
commit b0fc01efc6

View File

@@ -97,8 +97,10 @@ Function GenerateResourcesAndImage {
This parameter cannot be used in combination with the virtual_network_name packer parameter.
.PARAMETER Force
Delete the resource group if it exists without user confirmation.
This parameter is deprecated and will be removed in a future release.
.PARAMETER ReuseResourceGroup
Reuse the resource group if it exists without user confirmation.
This parameter is deprecated and will be removed in a future release.
.PARAMETER OnError
Specify how packer handles an error during image creation.
Options:
@@ -146,6 +148,10 @@ Function GenerateResourcesAndImage {
[hashtable] $Tags = @{}
)
if ($Force -or $ReuseResourceGroup) {
Write-Warning "The `ReuseResourceGroup` and `Force` parameters are deprecated and will be removed in a future release. The resource group will be reused when it already exists and an error will be thrown when it doesn't. If you want to delete the resource group, please delete it manually."
}
if ($Force -and $ReuseResourceGroup) {
throw "Force and ReuseResourceGroup cannot be used together."
}