client-go
client-go copied to clipboard
potential bug, get endpoints method
endpoints, err := c.kubeClient.CoreV1().Endpoints(service.ObjectMeta.Namespace).Get(context.Background(), service.Name, metav1.GetOptions{}) if err != nil { log.Errorf("Error getting endpoints for service %s: %v\n", service.Name, err) }
if the service.ObjectMeta.Namespace is empty string i.e. "" it will return endpoint object instead of error returned object: