-
Notifications
You must be signed in to change notification settings - Fork 161
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 3 commits
227c0fe
9e06e57
b2abb7c
94eb55b
b17da06
ceff547
2b339fd
91e8479
97f61a0
75e87c6
43474c3
4eb33c1
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) { | ||
|
||
| case *controllerutil.AlreadyOwnedError: | ||
| fmt.Sprintf("%s", err) | ||
|
||
| 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?