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

138 new resource security certificate #311

Open
wants to merge 19 commits into
base: integration/main
Choose a base branch
from

Conversation

csahu9
Copy link
Contributor

@csahu9 csahu9 commented Oct 4, 2024

@csahu9 csahu9 linked an issue Oct 4, 2024 that may be closed by this pull request
Copy link
Contributor

@carchi8py carchi8py left a comment

Choose a reason for hiding this comment

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

@csahu9 is name returned back in the output for 9.6 and 9.7

If not this code won't work for those system as name is required but would be null.

@csahu9
Copy link
Contributor Author

csahu9 commented Oct 8, 2024

@csahu9 is name returned back in the output for 9.6 and 9.7

If not this code won't work for those system as name is required but would be null.

@carchi8py Resource Read has version constraints before adding name to query fields, so it won't be returned for Ontap 9.6/9/7
I've updated the error reporting for scenario where one tries to use name in Ontap 9.6/9.7
I've now tested the resource in Ontap 9.6 as well and it is working as expected.

@chuyich
Copy link
Contributor

chuyich commented Oct 10, 2024

There is one case with minimum setup and the creation has issues:

resource "netapp-ontap_security_certificate" "create_certificate" {
  cx_profile_name = "cluster5"
  common_name     = "tfsvm_ca_cert_test"
  type            = "root_ca"
}

But creating a certificate without svm info is allowed.

csahu-vsim34::security certificate> create -common-name "ttt" -type root-ca -size 2048

The certificate's generated name for reference: ttt_17FCEF1EB6BDE792_ttt

csahu-vsim34::security certificate> show -cert-name ttt_17FCEF1EB6BDE792_ttt
Vserver    Serial Number   Certificate Name                       Type
---------- --------------- -------------------------------------- ------------
csahu-vsim34 
           17FCEF1EB6BDE792 
                           ttt_17FCEF1EB6BDE792_ttt               root-ca
    Certificate Authority: ttt
          Expiration Date: Thu Oct 09 20:14:32 2025

So svm_name is optional and computed in the schema definition.

Please take a look and adjust the code for taking care of this case.

@csahu9
Copy link
Contributor Author

csahu9 commented Oct 10, 2024

There is one case with minimum setup and the creation has issues:

resource "netapp-ontap_security_certificate" "create_certificate" {
  cx_profile_name = "cluster5"
  common_name     = "tfsvm_ca_cert_test"
  type            = "root_ca"
}

But creating a certificate without svm info is allowed.

csahu-vsim34::security certificate> create -common-name "ttt" -type root-ca -size 2048

The certificate's generated name for reference: ttt_17FCEF1EB6BDE792_ttt

csahu-vsim34::security certificate> show -cert-name ttt_17FCEF1EB6BDE792_ttt
Vserver    Serial Number   Certificate Name                       Type
---------- --------------- -------------------------------------- ------------
csahu-vsim34 
           17FCEF1EB6BDE792 
                           ttt_17FCEF1EB6BDE792_ttt               root-ca
    Certificate Authority: ttt
          Expiration Date: Thu Oct 09 20:14:32 2025

So svm_name is optional and computed in the schema definition.

Please take a look and adjust the code for taking care of this case.

@chuyich thanks for pointing this out; I've updated the resource accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Resource]: /security/certificates
4 participants