Skip to content

Conversation

@alexeyklyukin
Copy link
Contributor

To address #241

@erthalion
Copy link
Contributor

👍

Remove only when Patroni is running with Kubernetes support.
@Jan-M
Copy link
Member

Jan-M commented Feb 21, 2018

👍

@alexeyklyukin
Copy link
Contributor Author

👍

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 {
Copy link
Contributor

@erthalion erthalion Feb 21, 2018

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.

Copy link
Contributor Author

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).

@alexeyklyukin
Copy link
Contributor Author

👍

Avoid code duplication between functions for deleting Endpoints
and ConfigMaps
@erthalion
Copy link
Contributor

👍

1 similar comment
@alexeyklyukin
Copy link
Contributor Author

👍

@alexeyklyukin alexeyklyukin merged commit c4aab50 into master Feb 23, 2018
@alexeyklyukin alexeyklyukin deleted the remove_patroni_endpoints branch February 23, 2018 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants