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

fixed group detection bug for LDAP prune #6323

Merged

Conversation

stevekuznetsov
Copy link
Contributor

@@ -26,6 +26,10 @@ func (l *GroupBasedDetector) Exists(ldapGroupUID string) (bool, error) {
return false, err
}

if group == nil {
return false, nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liggitt amazingly it is possible that when doing a specific search for a specific DN in LDAP we can get nothing back and not NoSuchObject

Copy link
Contributor

Choose a reason for hiding this comment

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

what does the LDAP query look like for the DN lookup?

Copy link
Contributor

Choose a reason for hiding this comment

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

what does the LDAP query look like for the DN lookup?

@stevekuznetsov answer this to make sure that it looks sane before merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We haven't set the scope to base object only, that makes sense. We should be, however. I'll look into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there may be larger problems. In either case, QueryForUniqueEntry, when it retrieves nothing, it should throw an ErrorEntryNotFound. Which the detector should recognize as meaning the thing it was looking for doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, never mind all of that. I can't read. The search request is:

&{cn=group1,ou=groups,ou=adextended,dc=example,dc=com 0 0 0 0 false (objectClass=*) [cn dn] []}

which translates to

&SearchRequest{
    BaseDN:       "cn=group1,ou=groups,ou=adextended,dc=example,dc=com",
    Scope:        ScopeBaseObject,
    DerefAliases: NeverDerefAliases,
    SizeLimit:    None,
    TimeLimit:    None,
    TypesOnly:    false,
    Filter:       "(objectClass=*)",
    Attributes:   ["cn", "dn"],
    Controls:     none,
}

I think everything is working as expected now.

@stevekuznetsov
Copy link
Contributor Author

@deads2k comments addressed
as we are not doing cleanup and instead stomping on other temp files on startup I realized there is no extra work to be done.

[test][extended:ldap_groups]

@deads2k
Copy link
Contributor

deads2k commented Dec 15, 2015

lgtm pending tests.

@stevekuznetsov update bugzilla with a reference to this pull.

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 3446dce

@stevekuznetsov
Copy link
Contributor Author

@deads2k Bugzilla has the update already

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/7842/) (Extended Tests: ldap_groups)

for _, locator := range l.locators {
opinion, err := locator.Exists(ldapGrouUID)
if err != nil {
return false, err
}
conclusion = conclusion || opinion
conclusion = conclusion && opinion
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we return false early if one returns false?

Copy link
Contributor

Choose a reason for hiding this comment

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

can't we return false early if one returns false?

Doc on the type guarantees an error in one errors. I'm ok with forcing all successful inquiries to be sure about the decision

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I recall correctly @deads2k and I decided we want all of the locators to run to ensure that no errors are encountered.

Copy link
Contributor

Choose a reason for hiding this comment

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

If I recall correctly @deads2k and I decided we want all of the locators to run to ensure that no errors are encountered.

You wanted, I had no strong opinion.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@stevekuznetsov
Copy link
Contributor Author

@deads2k all green

@deads2k
Copy link
Contributor

deads2k commented Dec 15, 2015

[merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/4357/) (Image: devenv-rhel7_2962)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 3446dce

openshift-bot pushed a commit that referenced this pull request Dec 16, 2015
@openshift-bot openshift-bot merged commit f7e2d9d into openshift:master Dec 16, 2015
@stevekuznetsov stevekuznetsov deleted the skuznets/prune-groups-bug branch January 8, 2016 15:21
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.

4 participants