-
Notifications
You must be signed in to change notification settings - Fork 151
Fix for certmanager owner ref #1850
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
base: main
Are you sure you want to change the base?
Conversation
e219161
to
227c0fe
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.
few comments.
also I wonder if we need to set this flag while deploying cert-manager in our tests
return "", errors.Wrap(err, "set controller reference") | ||
switch errors.Cause(err).(type) { | ||
case *controllerutil.AlreadyOwnedError: | ||
fmt.Sprintf("%s", err) |
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.
should we return error here?
return errors.Wrap(err, "set controller reference") | ||
switch errors.Cause(err).(type) { | ||
case *controllerutil.AlreadyOwnedError: | ||
fmt.Sprintf("%s", err) |
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.
should we return error here?
@@ -314,7 +320,12 @@ func (c *certManagerController) WaitForCerts(ctx context.Context, cr *api.Percon | |||
continue | |||
} | |||
if err = controllerutil.SetControllerReference(cr, secret, c.scheme); err != nil { | |||
return errors.Wrap(err, "set controller reference") | |||
switch errors.Cause(err).(type) { |
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.
@gkech wdyt of this errors.Cause
maybe we should check with errors.Is
?
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.
yes it is better @egegunes
@Demch1k let's use errors.Is
and also, let's drop switch since it is not needed, so the following for all cases.
if err = controllerutil.SetControllerReference(cr, secret, c.scheme); err != nil {
if errors.Is(err, &controllerutil.AlreadyOwnedError{}) {
return errors.Wrap(err, "set owner reference")
}
return errors.Wrap(err, "set controller reference")
}
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.
@Demch1k any updates on this one?
commit: 94eb55b |
CHANGE DESCRIPTION
Problem:
We have enabled --enable-certificate-owner-ref for certmanager and after that mongodb operator can not startup any mongodb clusters.
Cause:
Mongodb operator return error when can't update owner references for certificates recources. But with --enable-certificate-owner-ref certmanager do it by itselfs.
Solution:
Catch error connected with already exists owner ref and jus print it out
CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
compare/*-oc.yml
)?Config/Logging/Testability