func (cs *crdSource) Endpoints() ([]*endpoint.Endpoint, error) {
	endpoints := []*endpoint.Endpoint{}

	result, err := cs.List(&metav1.ListOptions{})
	if err != nil {
		return nil, err
	}

	for _, dnsEndpoint := range result.Items {
		endpoints = append(endpoints, dnsEndpoint.Spec.Endpoints...)

		if dnsEndpoint.Status.ObservedGeneration == dnsEndpoint.Generation {
			continue
		}

		dnsEndpoint.Status.ObservedGeneration = dnsEndpoint.Generation
		// Update the ObservedGeneration
		_, err = cs.UpdateStatus(&dnsEndpoint)
		if err != nil {
			log.Warnf("Could not update ObservedGeneration of the CRD: %v", err)
		}
	}

	return endpoints, nil
}
func (cs *crdSource) Endpoints() ([]*endpoint.Endpoint, error) {
	endpoints := []*endpoint.Endpoint{}

	result, err := cs.List(&metav1.ListOptions{})
	if err != nil {
		return nil, err
	}

	for _, dnsEndpoint := range result.Items {
		endpoints = append(endpoints, dnsEndpoint.Spec.Endpoints...)

		if dnsEndpoint.Status.ObservedGeneration == dnsEndpoint.Generation {
			continue
		}

		dnsEndpoint.Status.ObservedGeneration = dnsEndpoint.Generation
		// Update the ObservedGeneration
		_, err = cs.UpdateStatus(&dnsEndpoint)
		if err != nil {
			log.Warnf("Could not update ObservedGeneration of the CRD: %v", err)
		}
	}

	return endpoints, nil
}
// Endpoints returns endpoint objects.