-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
New resource: azurerm_container_registry_cache_rule
#26034
New resource: azurerm_container_registry_cache_rule
#26034
Conversation
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
445ef91
to
3e8e427
Compare
azurerm_container_registry_cache_rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for adding this as a typed resource @npk-amperon. I made a first pass through and there are a couple of things missing for this to be complete. Once you've addressed the suggestions and comments we can take another look through!
internal/services/containers/container_registry_cache_rule_data_source.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource_test.go
Show resolved
Hide resolved
internal/services/containers/validate/container_registry_cache_rule_name.go
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
Ok @stephybun -- I've made updates according to your feedback and rerun the tests locally. Let me know if anything else needs updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @npk-amperon. There are some more minor improvements that can be made, once those are addressed I'll run the tests and then this should be good to go!
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/parse/container_registry_cache_rule_test.go
Outdated
Show resolved
Hide resolved
internal/services/containers/validate/container_registry_cache_rule_id.go
Outdated
Show resolved
Hide resolved
internal/services/containers/validate/container_registry_cache_rule_id_test.go
Outdated
Show resolved
Hide resolved
Alrighty @stephybun , addressed the latest round of comments--thanks again for taking the time to review. One thing I did notice is that we're seeing some golangci-lint failures that look like so:
Since the context is being passed into these functions as an argument, do we need to reinitialize it within the function? |
Thanks @npk-amperon. We don't need to initialise the context in the CRUD methods, you can remove all instances that the linter is complaining about. Also would you mind rebasing your PR on top of main? That will fix the vendor dependencies check and will allow us to run the tests. |
baa9fdb
to
827c7d3
Compare
Okay @stephybun , rebased and fixed the lint issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @npk-amperon. We can also remove the call to cancel in the methods since this is done implicitly. Once those are removed this should be good to go!
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
internal/services/containers/container_registry_cache_rule_resource.go
Outdated
Show resolved
Hide resolved
…ource.go Co-authored-by: stephybun <[email protected]>
…ource.go Co-authored-by: stephybun <[email protected]>
…ource.go Co-authored-by: stephybun <[email protected]>
…ource.go Co-authored-by: stephybun <[email protected]>
Ah I see, okay @stephybun your suggestions are committed so we should be good to go. Thanks again for the feedback! |
Ah, looks like I missed an unused import after your recommended changes--fixed. |
@npk-amperon can you also run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic @npk-amperon! LGTM 🎉
Works like a charm. Big THANKS |
@npk-amperon, is there already a PR for adding the missing resource
|
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. |
Community Note
Description
Continues the stalled work over in #24040 to add support for caching in ACR by adding both an associated resource and data source.
Note that adding the Credential Set resource (see here) is beyond the scope of this PR. That said, this PR includes support for passing them in by ID into the resource, though the acceptance tests don't include them. I think this is acceptable, as I plan to open a PR soon to add support for Credential Sets as well.
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_resource
- support for thething1
property [GH-00000]This is a (please select all that apply):
Related Issue(s)
Closes #21258
Note
If this PR changes meaningfully during the course of review please update the title and description as required.