-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement certificate rotation with internal and external CA #86
Implement certificate rotation with internal and external CA #86
Conversation
Introduced two new resources: "vcf_certificate" and "vcf_external_certificate" that facilitate the rotation of SDDC Resource certificates via internal and external CA. Common operations have been extracted into the certificate_operations.go file and the schema for the certificate details has been extracted into certificate_subresource.go. Since the creation of CSR, rotation of certificate are a one-off operations I've decided to form their id with the following formula: <operation>:<domain_id>:<resource_type>:<task_id> to uniquely identify the operation instance. Testing done: make build make lint make test Signed-off-by: Dimitar Proynov <[email protected]>
Validation did not take into account that the last octet can be something different from 0. Testing done: make build make lint make test Signed-off-by: Dimitar Proynov <[email protected]>
7704758
The GET method on a CSR returns 400 if the CSR has been used to replace a certificate, failing the post-creation refresh of the E2E tests. Thus, I've moved all the code from "read" to create, which does have UX implications, but at least will not crash Terraform. With a subsequent introduction of the "lifecycle" subresource the UX issue will be solved. Added nil pointer dereference guards in the certificate_subresource.go and removed some always nil properties from the schema. Increased timeout for certificate replacement as it is a slow operation. Testing done: make build make lint make test === RUN TestAccResourceVcfResourceCertificate === PAUSE TestAccResourceVcfResourceCertificate === CONT TestAccResourceVcfResourceCertificate --- PASS: TestAccResourceVcfResourceCertificate (1260.32s) PASS Signed-off-by: Dimitar Proynov <[email protected]>
API allows only cert chain or cert + CA cert combination. Testing done: make build make lint make test === RUN TestAccResourceVcfResourceExternalCertificate === PAUSE TestAccResourceVcfResourceExternalCertificate === CONT TestAccResourceVcfResourceExternalCertificate --- PASS: TestAccResourceVcfResourceExternalCertificate (1596.07s) PASS Signed-off-by: Dimitar Proynov <[email protected]>
Also rename "vcf_resource_csr" to "vcf_csr" Testing done: make build make lint make test Signed-off-by: Dimitar Proynov <[email protected]>
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.
LGTM!
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.
Looks good to me.
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 issues. 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. |
Introduced two new resources: "vcf_certificate" and "vcf_external_certificate" that facilitate the rotation of SDDC Resource certificates via internal and external CA.
Common operations have been extracted into the certificate_operations.go file and the schema for the certificate details has been extracted into certificate_subresource.go.
Since the creation of CSR, rotation of certificate are a one-off operations I've decided to form their id with the following formula: :<domain_id>:<resource_type>:<task_id> to uniquely identify the operation instance.
Summary of Pull Request
Type of Pull Request
Please describe:
Related to Existing Issues
Issue Number: N/A
Test and Documentation Coverage
For bug fixes or features:
Testing done:
make build
make lint
make test
=== RUN TestAccResourceVcfResourceExternalCertificate
=== PAUSE TestAccResourceVcfResourceExternalCertificate
=== CONT TestAccResourceVcfResourceExternalCertificate
--- PASS: TestAccResourceVcfResourceExternalCertificate (1596.07s)
PASS
=== RUN TestAccResourceVcfResourceCertificate
=== PAUSE TestAccResourceVcfResourceCertificate
=== CONT TestAccResourceVcfResourceCertificate
--- PASS: TestAccResourceVcfResourceCertificate (1260.32s)
PASS
Breaking Changes?