Skip to content

Commit 1b6ebd5

Browse files
authored
Merge pull request #437 from NetApp/367-bug-advertised_kdc_encryptions-tf-provider-unexpectedly-returned-no-resource-state-after-having-no-errors-in-the-resource-creation
367 bug advertised kdc encryptions tf provider unexpectedly returned no resource state after having no errors in the resource creation
2 parents 26b7939 + 9b4ff07 commit 1b6ebd5

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ BUG FIXES:
77
- **netapp-ontap_security_account**: fixed inconsistency plan changes when re-run with terraform apply ([#465](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/465))
88
- Corrected Resource and Data Source documentation Names ([#441](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/441))
99
- **netapp-ontap_svm_qos_policy_activation**: Renamed documentation from `svm_qos_policy_activation_resource` to `svm_qos_policy_activation` ([#430](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/430))
10+
- **netapp-ontap_cifs_service**: Fixed no resource state after creation by modifying the "kdc_encrytion" version check and also idempotency issue with CIFS server name([#367](https://github.com/NetApp/terraform-provider-netapp-ontap/issues/367))
1011

1112
# 2.1.1 (2025-02-26)
1213

internal/interfaces/protocols_cifs_service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func GetCifsServiceByName(errorHandler *utils.ErrorHandler, r restclient.RestCli
9696
return nil, errorHandler.MakeAndReportError(fmt.Sprintf("failed to decode response from GET %s", api),
9797
fmt.Sprintf("error: %s, statusCode %d, response %#v", err, statusCode, response))
9898
}
99+
dataONTAP.Name = name
99100
tflog.Debug(errorHandler.Ctx, fmt.Sprintf("Read protocols_cifs_service data source: %#v", dataONTAP))
100101
return &dataONTAP, nil
101102
}

internal/provider/protocols/protocols_cifs_service_resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func (r *CifsServiceResource) Read(ctx context.Context, req resource.ReadRequest
417417
errorHandler.MakeAndReportError("No CIFS service found", fmt.Sprintf("CIFS service %s not found.", data.Name.ValueString()))
418418
return
419419
}
420-
data.Name = types.StringValue(strings.ToLower(restInfo.Name))
420+
data.Name = types.StringValue(restInfo.Name)
421421
data.SVMName = types.StringValue(restInfo.SVM.Name)
422422
if len(restInfo.Comment) != 0 {
423423
data.Comment = types.StringValue(restInfo.Comment)
@@ -581,7 +581,7 @@ func (r *CifsServiceResource) Create(ctx context.Context, req resource.CreateReq
581581
body.Security.SmbSigning = security.SmbSigning.ValueBool()
582582
body.Security.SmbEncryption = security.SmbEncryption.ValueBool()
583583
// kdc_encryption is only supported in 9.12 and earlier
584-
if !security.KdcEncryption.IsNull() {
584+
if !security.KdcEncryption.IsNull() && security.KdcEncryption.ValueBool() {
585585
if cluster.Version.Generation == 9 && cluster.Version.Major < 12 {
586586
body.Security.KdcEncryption = security.KdcEncryption.ValueBool()
587587
} else {

0 commit comments

Comments
 (0)