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

tags update for azurerm_container_group #10210

Merged

Conversation

AliAllomani
Copy link
Contributor

Fixes #9612

$ make acctests SERVICE='containers' TESTARGS='-run=TestAccAzureRMContainerGroup_linuxBasicTagsUpdate'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./azurerm/internal/services/containers/tests/ -run=TestAccAzureRMContainerGroup_linuxBasicTagsUpdate -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccAzureRMContainerGroup_linuxBasicTagsUpdate
=== PAUSE TestAccAzureRMContainerGroup_linuxBasicTagsUpdate
=== CONT  TestAccAzureRMContainerGroup_linuxBasicTagsUpdate
--- PASS: TestAccAzureRMContainerGroup_linuxBasicTagsUpdate (216.53s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers/tests    219.088s

@ghost ghost added the size/M label Jan 16, 2021
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @AliAllomani

Thanks for this PR :)

I've taken a look through and left some comments inline but this is off to a good start, if we can fix up the comments (and the tests pass) then we should be able to get this merged 👍

Thanks!

return fmt.Errorf("Cannot read container group %s (resource group %s) ID", name, resGroup)
}

d.SetId(*read.ID)
Copy link
Member

Choose a reason for hiding this comment

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

since we're performing an update here, we can remove this ID update (and Get retrieval) here, since the ID won't change during an update

defer cancel()

resGroup := d.Get("resource_group_name").(string)
name := d.Get("name").(string)
Copy link
Member

Choose a reason for hiding this comment

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

where this is an update, can we parse the ID rather than retrieving these from the state:

id, err := azure.ParseAzureResourceID(d.Id())
	if err != nil {
		return err
	}
	resGroup := id.ResourceGroup
	name := id.Path["containerGroups"]

@ghost ghost added size/XL documentation and removed size/M labels Jan 18, 2021
@AliAllomani
Copy link
Contributor Author

Thanks @tombuildsstuff, updated and tested the code as per your recommendations.

Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for pushing those changes @AliAllomani

@tombuildsstuff tombuildsstuff added this to the v2.44.0 milestone Jan 18, 2021
@tombuildsstuff
Copy link
Member

Tests pass:

Screenshot 2021-01-19 at 11 49 55

@tombuildsstuff tombuildsstuff merged commit fee7731 into hashicorp:master Jan 19, 2021
tombuildsstuff added a commit that referenced this pull request Jan 19, 2021
@ghost
Copy link

ghost commented Jan 21, 2021

This has been released in version 2.44.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.44.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Feb 18, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 18, 2021
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.

Updating tags on azurerm_container_group forces a recreate
2 participants