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_mssql_managed_database - support for tags #27857

Merged
merged 6 commits into from
Nov 7, 2024

Conversation

katbyte
Copy link
Collaborator

@katbyte katbyte commented Nov 1, 2024

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

azurerm_mssql_managed_database - support for tags [GH-00000]

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #27809

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@katbyte katbyte requested a review from a team as a code owner November 1, 2024 19:37
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of things we could do differently

@@ -157,15 +161,15 @@ func (r MsSqlManagedDatabaseResource) Create() sdk.ResourceFunc {
parameters := manageddatabases.ManagedDatabase{
Location: managedInstance.Model.Location,
Properties: &manageddatabases.ManagedDatabaseProperties{},
Tags: &model.Tags,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Tags: &model.Tags,
Tags: pointer.To(model.Tags),

@@ -233,6 +238,17 @@ func (r MsSqlManagedDatabaseResource) Update() sdk.ResourceFunc {

d := metadata.ResourceData

if d.HasChange("tags") {
parameters := manageddatabases.ManagedDatabase{
Tags: &model.Tags,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Tags: &model.Tags,
Tags: pointer.To(model.Tags),

@@ -319,6 +335,10 @@ func (r MsSqlManagedDatabaseResource) Read() sdk.ResourceFunc {
model.PointInTimeRestore = flattenManagedDatabasePointInTimeRestore(v)
}

if model.Tags != nil {
state.Tags = model.Tags
Copy link
Member

Choose a reason for hiding this comment

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

You could get rid of this block and just do state.Tags = pointer.From(model.Tags)

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM when we add docs!

@katbyte katbyte merged commit 0f5a661 into main Nov 7, 2024
31 of 32 checks passed
@katbyte katbyte deleted the kt/mssql-managed-db-tags branch November 7, 2024 17:41
@github-actions github-actions bot added this to the v4.9.0 milestone Nov 7, 2024
katbyte added a commit that referenced this pull request Nov 7, 2024
Copy link

github-actions bot commented Dec 8, 2024

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 Dec 8, 2024
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 attribute on azurerm_mssql_managed_database
3 participants