func getAppServices(kubeClient *kubernetes.Clientset) (*v1.ServiceList, error) { serviceClient := kubeClient.Services(api.NamespaceAll) services, err := serviceClient.List(listOptions) if err != nil { return nil, err } return services, nil }
// getBuilderService will return the service named "deis-builder" from the same namespace as // the router, but will return nil (without error) if no such service exists. func getBuilderService(kubeClient *kubernetes.Clientset) (*v1.Service, error) { serviceClient := kubeClient.Services(namespace) service, err := serviceClient.Get("deis-builder") if err != nil { statusErr, ok := err.(*errors.StatusError) // If the issue is just that no deis-builder was found, that's ok. if ok && statusErr.Status().Code == 404 { // We'll just return nil instead of a found *api.Service. return nil, nil } return nil, err } return service, nil }