// ReconcileKind implements Interface.ReconcileKind.
ReconcileKind implements Interface.ReconcileKind.
// ReconcileKind implements Interface . ReconcileKind .
func (r *Reconciler) ReconcileKind(ctx context.Context, src *v1alpha1.DockerHubSource) pkgreconciler.Event {
	ctx = eventingv1.WithURIResolver(ctx, r.sinkResolver)
	ksvc, err := r.getOwnedService(ctx, src)
	if apierrors.IsNotFound(err) {
		ksvc = r.getExpectedService(ctx, src)
		ksvc, err = r.servingClientSet.ServingV1().Services(src.Namespace).Create(ctx, ksvc, metav1.CreateOptions{})
		if err != nil {
			return err
		}
		controller.GetEventRecorder(ctx).Eventf(src, corev1.EventTypeNormal, "ServiceCreated", "Created Service %q", ksvc.Name)
	} else if err != nil {
		src.Status.MarkNoEndpoint("ServiceUnavailable", "%v", err)
		return err
	} else if !metav1.IsControlledBy(ksvc, src) {
		src.Status.MarkNoEndpoint("ServiceNotOwned", "Service %q is not owned by DockerHubSource %q", ksvc.Name, src.Name)
		return fmt.Errorf("service %q is not owned by DockerHubSource %q", ksvc.Name, src.Name)
	} else if ksvc == nil {
		logging.FromContext(ctx).Fatalf("knative service is not set without error. src: %v", src)
		return fmt.Errorf("knative service is not set without error")
	} else if expected := r.getExpectedService(ctx, src); podSpecChanged(expected, ksvc) {
		err := pkgreconciler.RetryUpdateConflicts(func(int) error {
			ksvc, err := r.getOwnedService(ctx, src)
			if err != nil {
				return err
			}
			syncPodSpec(expected, ksvc)
			_, err = r.servingClientSet.ServingV1().Services(src.Namespace).Update(ctx, ksvc, metav1.UpdateOptions{})
			return err
		})
		if err != nil {
			src.Status.MarkNoEndpoint("ServiceUpdateFailed", "failed to update service: %v", err)
			return err
		}
		controller.GetEventRecorder(ctx).
			Eventf(src, corev1.EventTypeNormal,
				"ServiceUpdated", "Updated disableAutoCallback: %t", src.Spec.DisableAutoCallback)
	}
	src.Status.ReceiveAdapterServiceName = ksvc.Name
	src.Status.AutoCallbackDisabled = src.Spec.DisableAutoCallback
	if ksvc.IsReady() && ksvc.Status.URL != nil {
		src.Status.MarkEndpoint(ksvc.Status.URL)
	}
	return nil
}
func ( r * Reconciler ) ReconcileKind ( ctx context . Context , src * v1alpha1 . DockerHubSource ) pkgreconciler . Event { ctx = eventingv1 . WithURIResolver ( ctx , r . sinkResolver ) ksvc , err := r . getOwnedService ( ctx , src ) if apierrors . IsNotFound ( err ) { ksvc = r . getExpectedService ( ctx , src ) ksvc , err = r . servingClientSet . ServingV1 ( ) . Services ( src . Namespace ) . Create ( ctx , ksvc , metav1 . CreateOptions { } ) if err != nil { return err } controller . GetEventRecorder ( ctx ) . Eventf ( src , corev1 . EventTypeNormal , " " , " " , ksvc . Name ) } else if err != nil { src . Status . MarkNoEndpoint ( " " , " " , err ) return err } else if ! metav1 . IsControlledBy ( ksvc , src ) { src . Status . MarkNoEndpoint ( " " , " " , ksvc . Name , src . Name ) return fmt . Errorf ( " " , ksvc . Name , src . Name ) } else if ksvc == nil { logging . FromContext ( ctx ) . Fatalf ( " " , src ) return fmt . Errorf ( " " ) } else if expected := r . getExpectedService ( ctx , src ) ; podSpecChanged ( expected , ksvc ) { err := pkgreconciler . RetryUpdateConflicts ( func ( int ) error { ksvc , err := r . getOwnedService ( ctx , src ) if err != nil { return err } syncPodSpec ( expected , ksvc ) _ , err = r . servingClientSet . ServingV1 ( ) . Services ( src . Namespace ) . Update ( ctx , ksvc , metav1 . UpdateOptions { } ) return err } ) if err != nil { src . Status . MarkNoEndpoint ( " " , " " , err ) return err } controller . GetEventRecorder ( ctx ) . Eventf ( src , corev1 . EventTypeNormal , " " , " " , src . Spec . DisableAutoCallback ) } src . Status . ReceiveAdapterServiceName = ksvc . Name src . Status . AutoCallbackDisabled = src . Spec . DisableAutoCallback if ksvc . IsReady ( ) && ksvc . Status . URL != nil { src . Status . MarkEndpoint ( ksvc . Status . URL ) } return nil }
ReconcileKind implements Interface.ReconcileKind.
ReconcileKind implements Interface . ReconcileKind .
// status propagation