-
Notifications
You must be signed in to change notification settings - Fork 162
K8SPSMDB-1413 skip setting controller owner on secrets owned by Certificates created by cert-manager #2135
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
…ficates created by cert-manager
egegunes
left a comment
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 please add description to the PR
pkg/psmdb/tls/certmanager.go
Outdated
| // cert-manager sets the Certificate as the controller owner. | ||
| // In that case, the operator should not set a new controller reference. | ||
| if metav1.GetControllerOf(secret) != nil { | ||
| continue | ||
| } |
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.
We can just check if the error below (when calling SetControllerReference) returns a controllerutil.AlreadyOwnedError{} type using 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.
good point, we can switch to that.
) * fix backup/smart-upgrde deadlock Signed-off-by: Mayank Shah <[email protected]> * add comments Signed-off-by: Mayank Shah <[email protected]> * fix unit test Signed-off-by: Mayank Shah <[email protected]> * unit test Signed-off-by: Mayank Shah <[email protected]> * unit tests for conditions Signed-off-by: Mayank Shah <[email protected]> * linting Signed-off-by: Mayank Shah <[email protected]> * remove debug statements Signed-off-by: Mayank Shah <[email protected]> * linting Signed-off-by: Mayank Shah <[email protected]> * Update pkg/controller/perconaservermongodb/status_test.go Co-authored-by: Copilot <[email protected]> * Update pkg/apis/psmdb/v1/psmdb_types.go Co-authored-by: Copilot <[email protected]> * fix test semantics Signed-off-by: Mayank Shah <[email protected]> * wrap error Signed-off-by: Mayank Shah <[email protected]> --------- Signed-off-by: Mayank Shah <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Ege Güneş <[email protected]>
* K8SPSMDB-1448: sync user secrets with vault https://perconadev.atlassian.net/browse/K8SPSMDB-1448 * use `github.com/pkg/errors` * add `serviceAccountTokenPath` * Update pkg/apis/psmdb/v1/psmdb_defaults.go Co-authored-by: Copilot <[email protected]> * `go mod tidy` * add `tlsSecret` field * use `errors.Wrap` * fix validation message * add unit-tests * fix users-vault test * improve validation * small fixes * small go mod change * add test cases * improve test * implement cached vault * fix tests * refactor * remove debug prints * small improvements * small fix * `make manifests` * fix unit-tests * address comments * return on logged error * fix cached vault * secret client per cluster + provider handler for future secret storages * mac fix * logging improvements * implement critical errors * fix wrapped errors * small fix * fix if condition * fix unit-tests * apply copilot suggestions * make `endpointURL` required * fix test * fix validation error * improve logs * continue reconcile on failed connection to the vault * small test fix * fix test * block reconcile when user secret doesn't exist * final fix for `users-vault` test --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Mayank Shah <[email protected]> Co-authored-by: Viacheslav Sarzhan <[email protected]>
* K8SPSMDB-1429: improve cluster status https://perconadev.atlassian.net/browse/K8SPSMDB-1429 * small fix --------- Co-authored-by: Mayank Shah <[email protected]> Co-authored-by: Viacheslav Sarzhan <[email protected]>
* Setting appProtocol for service objects * Setting appProtocol for service objects * update compare version * small improvement * fix unit-test * change `mongo` to `mongodb` * add appProtocol to mongos service and fix tests * fix unit-tests * fix unit-test * fix `TestReconcileReplsetServices` * switch back to `mongo` * fix init-deploy --------- Co-authored-by: Andrii Dema <[email protected]> Co-authored-by: Viacheslav Sarzhan <[email protected]>
| fakeBackup "github.com/percona/percona-server-mongodb-operator/pkg/psmdb/backup/fake" | ||
| faketls "github.com/percona/percona-server-mongodb-operator/pkg/psmdb/tls/fake" | ||
| "github.com/percona/percona-server-mongodb-operator/pkg/version" | ||
| "github.com/stretchr/testify/assert" |
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.
[goimports-reviser] reported by reviewdog 🐶
| "github.com/stretchr/testify/assert" |
commit: b9c4516 |
|
why do we have so many unrelated changes? |
CHANGE DESCRIPTION
Problem:
When secrets are owned by certmanager through
OwnerReference, the operator is still trying to set the owner, resulting to an error. With this PR we are handling the error so thatAlreadyOwnedErrorerrors are not blocking the flow.Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
compare/*-oc.yml)?Config/Logging/Testability