Skip to content

Instantly share code, notes, and snippets.

@jsnouffer
Last active August 9, 2020 20:09
Show Gist options
  • Save jsnouffer/a77ba829afbe7731fd66015d6d49a234 to your computer and use it in GitHub Desktop.
Save jsnouffer/a77ba829afbe7731fd66015d6d49a234 to your computer and use it in GitHub Desktop.
package services
import (
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
// ListServices returns a list of K8 services
func ListServices(namespace string, client kubernetes.Interface) (*apiv1.ServiceList, error) {
return client.CoreV1().Services(namespace).List(metav1.ListOptions{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment