-
Notifications
You must be signed in to change notification settings - Fork 1k
Remove Patroni leftover objects on cluster deletion. #244
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
Conversation
|
👍 |
Remove only when Patroni is running with Kubernetes support.
|
👍 |
|
👍 |
pkg/cluster/cluster.go
Outdated
| for _, suffix := range patroniObjectSuffixes { | ||
| configEndpointName := fmt.Sprintf("%s-%s", c.Name, suffix) | ||
|
|
||
| if ep, err := c.KubeClient.Endpoints(c.Namespace).Get(configEndpointName, metav1.GetOptions{}); err == nil { |
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.
Why not pass c.KubeClient.Endpoints(c.Namespace) as an argument to this function? In this way we can avoid this code duplication.
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.
I don't think it is that easy. Endpoint and ConfigMap implement 2 different interfaces and Get functions actually return different types (*v1.Endpoint and *v1.ConfigMap and respectively).
|
👍 |
Avoid code duplication between functions for deleting Endpoints and ConfigMaps
|
👍 |
1 similar comment
|
👍 |
To address #241