Add-AzServiceFabricClusterCertificate: Add support for new certificate with same common name#11062
Closed
jcleavel wants to merge 10000 commits into
Closed
Add-AzServiceFabricClusterCertificate: Add support for new certificate with same common name#11062jcleavel wants to merge 10000 commits into
jcleavel wants to merge 10000 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, the
Add-AzServiceFabricClusterCertificatecmdlet fails to add a new certificate to the cluster if the supplied common name is the same as the one currently installed on the cluster. This does not align with how Service Fabric handles common name-based certificate rotation.Cmdlet argument example:
The cmdlet fails to run for the following reasons:
NullReferenceExceptionwould throw when the cmdlet is called on cluster without acertificateobject in its resource properties. This object isn't necessary in clusters secured with common name-referenced certificates. Fixed by adding appropriatenullhandling and correcting what criteria constitute a "Secure" cluster.certificateCommonNames.commonNames[]array contained multiple items with the same value in thecertificateCommonNameproperty. Fixed by de-duping and overwriting the duplicate value with the incoming value(s).The following problematic but non-fatal behavior was also corrected:
settings.certificate.commonNames[]array on the cluster VMSS's respective Service Fabric VMSS Extensions. This doesn't appear to cause a problem, but it's definitely confusing and messy. Fixed by case-insensitive de-duping.Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added