Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add init_container to azurerm_container_group resource. #16204

Merged
merged 2 commits into from
Apr 12, 2022

Conversation

lonegunmanb
Copy link
Contributor

An enhancement as #8085 described.
Two acc tests failed, but they also failed on the main branch, and since these two cases involved no volume at all, I think the failure is irrelevant to this pr.

=== RUN TestAccContainerGroup_SystemAssignedIdentity
=== PAUSE TestAccContainerGroup_SystemAssignedIdentity
=== CONT TestAccContainerGroup_SystemAssignedIdentity
--- PASS: TestAccContainerGroup_SystemAssignedIdentity (254.60s)
=== RUN TestAccContainerGroup_SystemAssignedIdentityNoNetwork
=== PAUSE TestAccContainerGroup_SystemAssignedIdentityNoNetwork
=== CONT TestAccContainerGroup_SystemAssignedIdentityNoNetwork
--- PASS: TestAccContainerGroup_SystemAssignedIdentityNoNetwork (189.04s)
=== RUN TestAccContainerGroup_UserAssignedIdentity
=== PAUSE TestAccContainerGroup_UserAssignedIdentity
=== CONT TestAccContainerGroup_UserAssignedIdentity
--- PASS: TestAccContainerGroup_UserAssignedIdentity (192.73s)
=== RUN TestAccContainerGroup_multipleAssignedIdentities
=== PAUSE TestAccContainerGroup_multipleAssignedIdentities
=== CONT TestAccContainerGroup_multipleAssignedIdentities
--- PASS: TestAccContainerGroup_multipleAssignedIdentities (261.77s)
=== RUN TestAccContainerGroup_imageRegistryCredentials
=== PAUSE TestAccContainerGroup_imageRegistryCredentials
=== CONT TestAccContainerGroup_imageRegistryCredentials
--- PASS: TestAccContainerGroup_imageRegistryCredentials (198.96s)
=== RUN TestAccContainerGroup_imageRegistryCredentialsUpdate
=== PAUSE TestAccContainerGroup_imageRegistryCredentialsUpdate
=== CONT TestAccContainerGroup_imageRegistryCredentialsUpdate
--- PASS: TestAccContainerGroup_imageRegistryCredentialsUpdate (294.66s)
=== RUN TestAccContainerGroup_logTypeUnset
=== PAUSE TestAccContainerGroup_logTypeUnset
=== CONT TestAccContainerGroup_logTypeUnset
--- PASS: TestAccContainerGroup_logTypeUnset (257.66s)
=== RUN TestAccContainerGroup_linuxBasic
=== PAUSE TestAccContainerGroup_linuxBasic
=== CONT TestAccContainerGroup_linuxBasic
--- PASS: TestAccContainerGroup_linuxBasic (236.79s)
=== RUN TestAccContainerGroup_exposedPort
=== PAUSE TestAccContainerGroup_exposedPort
=== CONT TestAccContainerGroup_exposedPort
--- PASS: TestAccContainerGroup_exposedPort (234.27s)
=== RUN TestAccContainerGroup_requiresImport
=== PAUSE TestAccContainerGroup_requiresImport
=== CONT TestAccContainerGroup_requiresImport
--- PASS: TestAccContainerGroup_requiresImport (267.85s)
=== RUN TestAccContainerGroup_linuxBasicUpdate
=== PAUSE TestAccContainerGroup_linuxBasicUpdate
=== CONT TestAccContainerGroup_linuxBasicUpdate
--- PASS: TestAccContainerGroup_linuxBasicUpdate (345.89s)
=== RUN TestAccContainerGroup_exposedPortUpdate
=== PAUSE TestAccContainerGroup_exposedPortUpdate
=== CONT TestAccContainerGroup_exposedPortUpdate
--- PASS: TestAccContainerGroup_exposedPortUpdate (343.57s)
=== RUN TestAccContainerGroup_linuxBasicTagsUpdate
=== PAUSE TestAccContainerGroup_linuxBasicTagsUpdate
=== CONT TestAccContainerGroup_linuxBasicTagsUpdate
--- PASS: TestAccContainerGroup_linuxBasicTagsUpdate (245.83s)
=== RUN TestAccContainerGroup_linuxComplete
=== PAUSE TestAccContainerGroup_linuxComplete
=== CONT TestAccContainerGroup_linuxComplete
--- PASS: TestAccContainerGroup_linuxComplete (1109.05s)
=== RUN TestAccContainerGroup_virtualNetwork
=== PAUSE TestAccContainerGroup_virtualNetwork
=== CONT TestAccContainerGroup_virtualNetwork
--- PASS: TestAccContainerGroup_virtualNetwork (601.34s)
=== RUN TestAccContainerGroup_virtualNetworkParallel
=== PAUSE TestAccContainerGroup_virtualNetworkParallel
=== CONT TestAccContainerGroup_virtualNetworkParallel

=== CONT TestAccContainerGroup_virtualNetworkParallel
testcase.go:110: Step 1/1 error: Error running apply: exit status 1

    Error: creating/updating Container Group: (Name "acctestcontainergroup-3-220401072256128039" / Resource Group "acctestRG-220401072256128039"): containerinstance.ContainerGroupsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: context deadline exceeded
    
      with azurerm_container_group.test[3],
      on terraform_plugin_test.tf line 49, in resource "azurerm_container_group" "test":
      49: resource "azurerm_container_group" "test" {
    
    
    Error: creating/updating Container Group: (Name "acctestcontainergroup-2-220401072256128039" / Resource Group "acctestRG-220401072256128039"): containerinstance.ContainerGroupsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: context deadline exceeded
    
      with azurerm_container_group.test[2],
      on terraform_plugin_test.tf line 49, in resource "azurerm_container_group" "test":
      49: resource "azurerm_container_group" "test" {
    
    
    Error: waiting for creation/update of Container Group: (Name "acctestcontainergroup-0-220401072256128039" / Resource Group "acctestRG-220401072256128039"): Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded
    
      with azurerm_container_group.test[0],
      on terraform_plugin_test.tf line 49, in resource "azurerm_container_group" "test":
      49: resource "azurerm_container_group" "test" {
    
testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
    
    Error: deleting Network Profile: (Name "testnetprofile" / Resource Group "acctestRG-220401072256128039"): network.ProfilesClient#Delete: Failure sending request: StatusCode=400 -- Original Error: Code="NetworkProfileAlreadyInUseWithContainerNics" Message="Network profile /subscriptions/#############/resourceGroups/acctestRG-220401072256128039/providers/Microsoft.Network/networkProfiles/testnetprofile is already in use with container nics 78c2a01f-abd3-45c4-89b7-a6cc87bfe452_testcnic; cannot update or delete" Details=[]

--- FAIL: TestAccContainerGroup_virtualNetworkParallel (1985.03s)

=== RUN TestAccContainerGroup_SystemAssignedIdentityVirtualNetwork
=== PAUSE TestAccContainerGroup_SystemAssignedIdentityVirtualNetwork
=== CONT TestAccContainerGroup_SystemAssignedIdentityVirtualNetwork
--- PASS: TestAccContainerGroup_SystemAssignedIdentityVirtualNetwork (557.03s)
=== RUN TestAccContainerGroup_windowsBasic
=== PAUSE TestAccContainerGroup_windowsBasic
=== CONT TestAccContainerGroup_windowsBasic
--- PASS: TestAccContainerGroup_windowsBasic (850.83s)
=== RUN TestAccContainerGroup_windowsComplete
=== PAUSE TestAccContainerGroup_windowsComplete
=== CONT TestAccContainerGroup_windowsComplete
--- PASS: TestAccContainerGroup_windowsComplete (1102.55s)
=== RUN TestAccContainerGroup_withPrivateEmpty
=== PAUSE TestAccContainerGroup_withPrivateEmpty

=== CONT TestAccContainerGroup_withPrivateEmpty
--- PASS: TestAccContainerGroup_withPrivateEmpty (237.46s)
=== RUN TestAccContainerGroup_gitRepoVolume
=== PAUSE TestAccContainerGroup_gitRepoVolume
=== CONT TestAccContainerGroup_gitRepoVolume
=== CONT TestAccContainerGroup_gitRepoVolume
testcase.go:110: Step 1/2 error: Error running apply: exit status 1

    Error: waiting for creation/update of Container Group: (Name "acctestcontainergroup-220401072256129704" / Resource Group "acctestRG-220401072256129704"): Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded
    
      with azurerm_container_group.test,
      on terraform_plugin_test.tf line 11, in resource "azurerm_container_group" "test":
      11: resource "azurerm_container_group" "test" {
    
testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
    
    Error: deleting Resource Group "acctestRG-220401072256129704": the Resource Group still contains Resources.
    
    Terraform is configured to check for Resources within the Resource Group when deleting the Resource Group - and
    raise an error if nested Resources still exist to avoid unintentionally deleting these Resources.
    
    Terraform has detected that the following Resources still exist within the Resource Group:
    
    * `/subscriptions/#############/resourceGroups/acctestRG-220401072256129704/providers/Microsoft.ContainerInstance/containerGroups/acctestcontainergroup-220401072256129704`
    
    This feature is intended to avoid the unintentional destruction of nested Resources provisioned through some
    other means (for example, an ARM Template Deployment) - as such you must either remove these Resources, or
    disable this behaviour using the feature flag `prevent_deletion_if_contains_resources` within the `features`
    block when configuring the Provider, for example:
    
    provider "azurerm" {
      features {
        resource_group {
          prevent_deletion_if_contains_resources = false
        }
      }
    }
    
    When that feature flag is set, Terraform will skip checking for any Resources within the Resource Group and
    delete this using the Azure API directly (which will clear up any nested resources).
    
    More information on the `features` block can be found in the documentation:
    https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#features

--- FAIL: TestAccContainerGroup_gitRepoVolume (1983.19s)

=== RUN TestAccContainerGroup_emptyDirVolume
=== PAUSE TestAccContainerGroup_emptyDirVolume
=== CONT TestAccContainerGroup_emptyDirVolume
--- PASS: TestAccContainerGroup_emptyDirVolume (250.14s)
=== RUN TestAccContainerGroup_emptyDirVolumeShared
=== PAUSE TestAccContainerGroup_emptyDirVolumeShared
=== CONT TestAccContainerGroup_emptyDirVolumeShared
--- PASS: TestAccContainerGroup_emptyDirVolumeShared (248.67s)
=== RUN TestAccContainerGroup_emptyDirVolumeSharedWithInitContainer
=== PAUSE TestAccContainerGroup_emptyDirVolumeSharedWithInitContainer
=== CONT TestAccContainerGroup_emptyDirVolumeSharedWithInitContainer
--- PASS: TestAccContainerGroup_emptyDirVolumeSharedWithInitContainer (251.73s)
=== RUN TestAccContainerGroup_withInitContainer
=== PAUSE TestAccContainerGroup_withInitContainer
=== CONT TestAccContainerGroup_withInitContainer
--- PASS: TestAccContainerGroup_withInitContainer (242.59s)
=== RUN TestAccContainerGroup_secretVolume
=== PAUSE TestAccContainerGroup_secretVolume
=== CONT TestAccContainerGroup_secretVolume
--- PASS: TestAccContainerGroup_secretVolume (248.69s)
FAIL

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @lonegunmanb - LGTM 🦀

@katbyte katbyte merged commit 701bb5c into hashicorp:main Apr 12, 2022
@github-actions github-actions bot added this to the v3.2.0 milestone Apr 12, 2022
katbyte added a commit that referenced this pull request Apr 12, 2022
@github-actions
Copy link

This functionality has been released in v3.2.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
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators May 15, 2022
@lonegunmanb lonegunmanb deleted the e-8085 branch May 16, 2022 00:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants