terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

Updated API version of `container_group` from `2021-03-01` to `2021-10-01`

Open dkuzmenok opened this issue 2 years ago • 5 comments

This PR updates API, used by container_group from 2021-03-01 to 2021-10-01.

API changes: https://docs.microsoft.com/en-us/azure/templates/microsoft.containerinstance/change-log/containergroups#2021-10-01

Included changes:

  • Removed network_profile_id (deprecated since 2021-07-01).
  • Added image_registry_credentials.user_assigned_identity_id (added in 2021-07-01).
  • Added subnets (added in 2021-07-01).
  • Added zones (added in 2021-09-01).
  • Added dns_name_label_reuse_policy (added in 2021-10-01).

Notes:

  • As with #17416, I had to set username and password to Optional: true as there are multiple image_registry_credentials and it requires either username of user_assigned_identity_id, and currently we cannot use ExactlyOneOf or AtLeastOneOf in a loop context with multiple elements.

Fixes #17371.

Tests:


TF_ACC=1 go test -v -timeout 300000s -run ^TestAccContainerGroup_ github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/
...
=== CONT  TestAccContainerGroup_SystemAssignedIdentity
=== CONT  TestAccContainerGroup_gitRepoVolume
=== CONT  TestAccContainerGroup_imageRegistryCredentials
=== CONT  TestAccContainerGroup_linuxBasicTagsUpdate
--- PASS: TestAccContainerGroup_imageRegistryCredentials (192.04s)
=== CONT  TestAccContainerGroup_withPrivateEmpty
--- PASS: TestAccContainerGroup_SystemAssignedIdentity (194.49s)
=== CONT  TestAccContainerGroup_windowsComplete
--- PASS: TestAccContainerGroup_gitRepoVolume (208.86s)
=== CONT  TestAccContainerGroup_windowsBasic
--- PASS: TestAccContainerGroup_linuxBasicTagsUpdate (233.73s)
=== CONT  TestAccContainerGroup_SystemAssignedIdentityVirtualNetwork
--- PASS: TestAccContainerGroup_withPrivateEmpty (146.22s)
=== CONT  TestAccContainerGroup_virtualNetworkParallel
--- PASS: TestAccContainerGroup_SystemAssignedIdentityVirtualNetwork (247.13s)
=== CONT  TestAccContainerGroup_virtualNetwork
--- PASS: TestAccContainerGroup_virtualNetworkParallel (252.23s)
=== CONT  TestAccContainerGroup_linuxComplete
--- PASS: TestAccContainerGroup_windowsBasic (462.40s)
=== CONT  TestAccContainerGroup_exposedPort
--- PASS: TestAccContainerGroup_virtualNetwork (310.90s)
=== CONT  TestAccContainerGroup_exposedPortUpdate
--- PASS: TestAccContainerGroup_exposedPort (146.25s)
=== CONT  TestAccContainerGroup_linuxBasicUpdate
--- PASS: TestAccContainerGroup_exposedPortUpdate (212.74s)
=== CONT  TestAccContainerGroup_requiresImport
--- PASS: TestAccContainerGroup_linuxBasicUpdate (203.53s)
=== CONT  TestAccContainerGroup_SystemAssignedIdentityWithZones
--- PASS: TestAccContainerGroup_windowsComplete (910.18s)
=== CONT  TestAccContainerGroup_multipleAssignedIdentities
--- PASS: TestAccContainerGroup_requiresImport (140.12s)
=== CONT  TestAccContainerGroup_UserAssignedIdentityWithVirtualNetwork
--- PASS: TestAccContainerGroup_SystemAssignedIdentityWithZones (129.69s)
=== CONT  TestAccContainerGroup_UserAssignedIdentity
--- PASS: TestAccContainerGroup_multipleAssignedIdentities (160.36s)
=== CONT  TestAccContainerGroup_logTypeUnset
--- PASS: TestAccContainerGroup_UserAssignedIdentity (143.85s)
=== CONT  TestAccContainerGroup_linuxBasic
--- PASS: TestAccContainerGroup_logTypeUnset (173.14s)
=== CONT  TestAccContainerGroup_imageRegistryCredentialsUpdate
--- PASS: TestAccContainerGroup_UserAssignedIdentityWithVirtualNetwork (331.17s)
=== CONT  TestAccContainerGroup_ProbeExec
--- PASS: TestAccContainerGroup_linuxBasic (188.85s)
=== CONT  TestAccContainerGroup_SystemAssignedIdentityNoNetwork
--- PASS: TestAccContainerGroup_ProbeExec (135.10s)
=== CONT  TestAccContainerGroup_withInitContainer
--- PASS: TestAccContainerGroup_SystemAssignedIdentityNoNetwork (136.86s)
=== CONT  TestAccContainerGroup_encryption
--- PASS: TestAccContainerGroup_imageRegistryCredentialsUpdate (217.63s)
=== CONT  TestAccContainerGroup_secretVolume
--- PASS: TestAccContainerGroup_withInitContainer (125.43s)
=== CONT  TestAccContainerGroup_emptyDirVolumeShared
--- PASS: TestAccContainerGroup_secretVolume (130.87s)
=== CONT  TestAccContainerGroup_emptyDirVolumeSharedWithInitContainer
--- PASS: TestAccContainerGroup_emptyDirVolumeShared (134.25s)
=== CONT  TestAccContainerGroup_ProbeHttpGet
--- PASS: TestAccContainerGroup_linuxComplete (1320.01s)
=== CONT  TestAccContainerGroup_emptyDirVolume
--- PASS: TestAccContainerGroup_emptyDirVolumeSharedWithInitContainer (128.24s)
--- PASS: TestAccContainerGroup_encryption (350.81s)
--- PASS: TestAccContainerGroup_ProbeHttpGet (137.60s)
--- PASS: TestAccContainerGroup_emptyDirVolume (136.39s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/containers    2046.927s

dkuzmenok avatar Jul 28 '22 10:07 dkuzmenok

@magodo I have resolved all the points, raised by you. Removed tests' modifications and now they look good. Tests TestAccContainerGroup_ are all passed.

dkuzmenok avatar Aug 12 '22 08:08 dkuzmenok

@magodo There was a failing check, coming from main branch (not related to this PR). I have fixed it in #18219, so this one should be fine and ready.

dkuzmenok avatar Sep 02 '22 06:09 dkuzmenok

@tombuildsstuff This PR has removed network_profile_id (similar as #17926), shall we move it to the v4 list?

magodo avatar Sep 05 '22 03:09 magodo

@tombuildsstuff This PR has removed network_profile_id (similar as #17926), shall we move it to the v4 list? Seems like #17926 was already merged. Is there any reason for waiting for v4, is it the breaking-change label? If v4 is the target release, what is the timeframe for that (ballpark)? Our current setup with azurerm (3.23.0) provider has issues when changing ACI config and Terraform has to do a destroy and create. That fails for ACI on the private network.

asbjorn-wiik avatar Sep 22 '22 08:09 asbjorn-wiik

@asbjorn-wiik That PR is then reverted in #18239.

magodo avatar Sep 22 '22 09:09 magodo

We also have some test failures: image

@katbyte I would fix the first one, but the second one is not linked to by changes, just showing that "K80" GPU SKU is not available in EUS2 location. I did expect to have PrimaryLocation being set to "North Europe", where this SKU is available - https://learn.microsoft.com/en-us/azure/container-instances/container-instances-gpu . Not sure what locations are used for running tests in your env.

dkuzmenok avatar Oct 14 '22 10:10 dkuzmenok

@katbyte I've updated this one. All tests now complete successfully. There is a Deprecated enabled over network_profile_id.

dkuzmenok avatar Oct 17 '22 11:10 dkuzmenok

This functionality has been released in v3.28.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] avatar Oct 24 '22 08:10 github-actions[bot]

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Nov 24 '22 02:11 github-actions[bot]