-
Notifications
You must be signed in to change notification settings - Fork 156
K8SPSMDB-1387 certmanager --enable-certificate-owner-ref option causes no startup of any mongodb clusters #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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package tls | |
|
||
import ( | ||
"context" | ||
"fmt" | ||
"regexp" | ||
"time" | ||
|
||
|
@@ -118,7 +119,12 @@ func (c *certManagerController) DeleteDeprecatedIssuerIfExists(ctx context.Conte | |
|
||
func (c *certManagerController) createOrUpdate(ctx context.Context, cr *api.PerconaServerMongoDB, obj client.Object) (util.ApplyStatus, error) { | ||
if err := controllerutil.SetControllerReference(cr, obj, c.scheme); err != nil { | ||
return "", errors.Wrap(err, "set controller reference") | ||
switch errors.Cause(err).(type) { | ||
case *controllerutil.AlreadyOwnedError: | ||
fmt.Sprintf("%s", err) | ||
default: | ||
return "", errors.Wrap(err, "set controller reference") | ||
} | ||
} | ||
|
||
status, err := util.Apply(ctx, c.cl, obj) | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. @gkech wdyt of this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes it is better @egegunes @Demch1k let's use
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Demch1k any updates on this one? |
||
case *controllerutil.AlreadyOwnedError: | ||
fmt.Sprintf("%s", err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we return error here? |
||
default: | ||
return errors.Wrap(err, "set controller reference") | ||
} | ||
} | ||
if err = c.cl.Update(ctx, secret); err != nil { | ||
return errors.Wrap(err, "failed to update secret") | ||
|
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?