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_container_registry_task - Fix missing authentication when updating #17002

Merged
merged 3 commits into from
Jun 1, 2022

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented May 30, 2022

Fix #16959

The source_trigger.authentication is not returned in the GET response. When there is an update to other attributes other than source_trigger, as we conditionally expand source_trigger (only when it HasChanged), the content of source_trigger was from the GET response, therefore missing the source_trigger.authentication. API then complains.

This PR adds a special patch to the source_trigger.authentication in this case, right after the conditional expansion.

Test

❯ TF_ACC=1 go test -timeout=60m -v -run='TestAccContainerRegistryTask_dockerStepSourceTrigger' ./internal/services/containers
=== RUN   TestAccContainerRegistryTask_dockerStepSourceTrigger                                                                                                                              === PAUSE TestAccContainerRegistryTask_dockerStepSourceTrigger
=== CONT  TestAccContainerRegistryTask_dockerStepSourceTrigger
--- PASS: TestAccContainerRegistryTask_dockerStepSourceTrigger (236.26s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/containers    236.271s

Copy link
Contributor

@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.

One comment about readability but this otherwise LGTM 👍

@magodo
Copy link
Collaborator Author

magodo commented May 31, 2022

@tombuildsstuff Thank you for the comment! I've refine it and please take another look!

Copy link
Contributor

@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.

If we de-reference this prior to passing this in, we remove doing that from within the method, which removes some of the complexity/potential bugs fwiw - but this otherwise LGTM 👍

@tombuildsstuff tombuildsstuff added this to the v3.9.0 milestone Jun 1, 2022
@tombuildsstuff tombuildsstuff merged commit 40838d9 into hashicorp:main Jun 1, 2022
tombuildsstuff added a commit that referenced this pull request Jun 1, 2022
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

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

github-actions bot commented Jul 4, 2022

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 Jul 4, 2022
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.

azurerm_container_registry_task unable to update after a successful creation.
2 participants