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

azurerm_netapp_* - support for tags & add ID parsing functions #5995

Merged
merged 4 commits into from Mar 6, 2020
Merged

azurerm_netapp_* - support for tags & add ID parsing functions #5995

merged 4 commits into from Mar 6, 2020

Conversation

aqche
Copy link
Contributor

@aqche aqche commented Mar 5, 2020

Fixes: #5532

Adds the tags option for NetApp resources.

I wrote the code, but I didn't realize you need to request access to NetApp before you can create resources, so I an unable to run the tests atm. I'll put in a request, but if someone has time to run the tests that would be helpful as well!

ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

id, err := azure.ParseAzureResourceID(d.Id())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i realize the team is creating parsers for resource ids, would you like me to go ahead and create parsers for each of the netapp resoures or let that be addressed in another PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be preferred to do it now but either or is fine 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good, i'll get parsers added in

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 for the PR @aqche, overall this looks good and aside from some minor comments about style the only thing i'm concerned about is capitals in the tags so we can confirm the api handles case correctly.

Comment on lines 185 to 186
_, err = client.Update(ctx, parameters, resourceGroup, accountName, poolName, volumeName, name)
if err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

these two lines can be merged

Comment on lines 194 to 197
if resp.ID == nil || *resp.ID == "" {
return fmt.Errorf("Cannot read NetApp Snapshot %q (Resource Group %q) ID", name, resourceGroup)
}
d.SetId(*resp.ID)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should only be setting ID on create

ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

id, err := azure.ParseAzureResourceID(d.Id())
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be preferred to do it now but either or is fine 🙂

@ghost ghost added size/XL and removed size/M labels Mar 6, 2020
@aqche aqche changed the title azurerm_netapp_* - support for tags azurerm_netapp_* - support for tags & add ID parsing functions Mar 6, 2020
@aqche
Copy link
Contributor Author

aqche commented Mar 6, 2020

@katbyte thanks for the review! made the updates you suggested and added the parse functions. I still don't have access to NetApp but here are the parse function test results:

go test .
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/netapp/parse        0.006s

@ghost ghost removed the waiting-response label Mar 6, 2020
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 for going above and beyond in adding those functions @aqche, LGTM 👍

@katbyte katbyte merged commit 16d09db into hashicorp:master Mar 6, 2020
katbyte added a commit that referenced this pull request Mar 6, 2020
@aqche aqche deleted the netapp_tags branch March 6, 2020 23:19
@ghost
Copy link

ghost commented Mar 11, 2020

This has been released in version 2.1.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.1.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Apr 5, 2020

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!

@hashicorp hashicorp locked and limited conversation to collaborators Apr 5, 2020
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.

Support for Tags on Netapp Resources
2 participants