kubernetes / client-go

Go client for Kubernetes.
Apache License 2.0
9.12k stars 2.95k forks source link

potential bug, get endpoints method #1368

Open yashjaind11 opened 4 months ago

yashjaind11 commented 4 months ago

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
k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 4 days ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten