-
Notifications
You must be signed in to change notification settings - Fork 54
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
xCluster*: Added support for distinguished cluster name #258
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #258 +/- ##
===================================
Coverage 100% 100%
===================================
Files 8 9 +1
Lines 611 630 +19
===================================
+ Hits 611 630 +19
|
I need to have time to look into this change. I will try to get to it as soon as possible, but having a lot on my plate at the moment. |
If you can add unit tests to the changes in the PR so they changes is being tested. That would help as I need that to merge the code. |
@IlleNilsson Could you please have a look at the failed Unit tests? |
I do not know where to start. But it would be a great opportunity for you to familiarize with the DSC community.
…________________________________
From: dennisl68-castra ***@***.***>
Sent: Thursday, September 23, 2021 3:50:03 PM
To: dsccommunity/xFailOverCluster ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [dsccommunity/xFailOverCluster] xCluster*: Added support for distinguished cluster name (#258)
@IlleNilsson<https://github.com/IlleNilsson> Could you please have a look at the failed Unit tests?
They don't seem very hard to fix...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#258 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4BH54SWIVJX73CNRIDUDMWAXANCNFSM43EHIDZA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@IlleNilsson Perhaps you could review the failed Unit Tests in this Pull Request (look at the Details of each failed stage of Review requested) and remedy the failures of your request and then push your code again for a new review? |
I already communicated with the community and stated that I can fix the actual problem but I’m not skilled enough to fix tests.
…________________________________
From: dennisl68-castra ***@***.***>
Sent: Thursday, September 23, 2021 4:12:07 PM
To: dsccommunity/xFailOverCluster ***@***.***>
Cc: Ilian Nilsson ***@***.***>; Mention ***@***.***>
Subject: Re: [dsccommunity/xFailOverCluster] xCluster*: Added support for distinguished cluster name (#258)
@IlleNilsson<https://github.com/IlleNilsson> Perhaps you could review the failed Unit Tests in this Pull Request (look at the Details of each failed stage of Review requested) and remedy the failures of your request and then push your code again for a new review?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#258 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AID6F4ECB7KGL3W4IX5R7VLUDMYTPANCNFSM43EHIDZA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@johlju The build isn't available anymore so I can't review the failed tests... |
7ec86bd
to
2bd55e8
Compare
Ok, so what's missing now is additional unit tests for the added functionality? |
As we will drop the use of xCluster, I will not pursue this Pull Request. |
9fc6c16
to
eac0ffd
Compare
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.
I have added a unit test for this change that can be extended, see other comment.
Reviewed 1 of 12 files at r1, 10 of 14 files at r3, all commit messages.
Reviewable status: 11 of 15 files reviewed, 3 unresolved discussions (waiting on @IlleNilsson and @johlju)
a discussion (no related file):
This code do have two disadvantage
- it is possible to create two clusters with the same name in the same configuration, e.g. by passing
'CLUSTER'
and'CN=CLUSTER'
- it is possible to manually move the cluster to another location at it will not be moved back to the desired location since the location (DN) is not enforced with this change.
The first one we might have to live with, but can we resolve the second, and if so, is this the correct resource to enforce location?
a discussion (no related file):
Since we do not have integration tests, has anyone run the changed resources so it do work?
source/Modules/FailoverClusterDsc.Common/FailoverClusterDsc.Common.psm1
line 14 at r3 (raw file):
Distinguished Name to be converted to a Simple Name #> function Convert-DistinguishedNameToSimpleName
Suggest changing the function to this. But on top of that this function must also handle any special characters that are all allowed in a distinguished name and make tests that validates those, see more information: https://ldap.com/ldap-dns-and-rdns/
It should probably also fail if a DN was passed but did not start with CN=
.
Suggestion:
function Convert-DistinguishedNameToSimpleName
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'returnValue')]
[CmdletBinding()]
[OutputType([System.String])]
param
(
[Parameter(Mandatory = $true)]
[System.String]
$DistinguishedName
)
$returnValue = $DistinguishedName
if ($DistinguishedName -match '^([c|C][n|N])=(.*?(?=,))')
{
$returnValue = $matches[2]
}
return $returnValue
}
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.
Reviewable status: 11 of 15 files reviewed, 3 unresolved discussions (waiting on @IlleNilsson and @johlju)
a discussion (no related file):
Previously, johlju (Johan Ljunggren) wrote…
This code do have two disadvantage
- it is possible to create two clusters with the same name in the same configuration, e.g. by passing
'CLUSTER'
and'CN=CLUSTER'
- it is possible to manually move the cluster to another location at it will not be moved back to the desired location since the location (DN) is not enforced with this change.
The first one we might have to live with, but can we resolve the second, and if so, is this the correct resource to enforce location?
What if we have DN in a separate property called OrganizationUnitDistinguishedName
that holds the path to the OU? Then we resolve first item above, by combining the property Name
and OrganizationUnitDistinguishedName
we get the full DN, and then we correctly can only have one instance of one cluster name.
We will also be able to enforce the location if the property OrganizationUnitDistinguishedName
is passes. If not passed then location is not enforced.
This PR is ready for someone to continue running with it. Let me know when it needs another review. 🙂 |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
Pull Request (PR) description
Adds support for distinguished cluster name so one can place the cluster node in specific OU
This Pull Request (PR) fixes the following issues
Issue #256
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
and comment-based help.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)