Skip to content

Commit 4d906da

Browse files
storage_mover_smb_file_share_endpoint: description clearable, pointer.From in Read, backticks in error
Made-with: Cursor
1 parent 0cacf8e commit 4d906da

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

internal/services/storagemover/storage_mover_smb_file_share_endpoint_resource.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (r StorageMoverSmbFileShareEndpointResource) Arguments() map[string]*plugin
8080
"description": {
8181
Type: pluginsdk.TypeString,
8282
Optional: true,
83-
ValidateFunc: validation.StringIsNotEmpty,
83+
ValidateFunc: validation.StringLenBetween(0, 1024),
8484
},
8585
}
8686
}
@@ -161,7 +161,7 @@ func (r StorageMoverSmbFileShareEndpointResource) Update() sdk.ResourceFunc {
161161

162162
properties := resp.Model
163163
if properties == nil {
164-
return fmt.Errorf("retrieving %s: model was nil", *id)
164+
return fmt.Errorf("retrieving %s: `model` was nil", *id)
165165
}
166166

167167
if metadata.ResourceData.HasChange("description") {
@@ -209,12 +209,7 @@ func (r StorageMoverSmbFileShareEndpointResource) Read() sdk.ResourceFunc {
209209
if v, ok := model.Properties.(endpoints.AzureStorageSmbFileShareEndpointProperties); ok {
210210
state.FileShareName = v.FileShareName
211211
state.StorageAccountId = v.StorageAccountResourceId
212-
213-
des := ""
214-
if v.Description != nil {
215-
des = *v.Description
216-
}
217-
state.Description = des
212+
state.Description = pointer.From(v.Description)
218213
}
219214
}
220215

0 commit comments

Comments
 (0)