client-go icon indicating copy to clipboard operation
client-go copied to clipboard

potential bug, get endpoints method

Open yashjaind11 opened this issue 6 months ago • 1 comments

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: Screenshot 2024-07-25 at 7 19 39 PM

yashjaind11 avatar Jul 25 '24 13:07 yashjaind11