prow/cmd/build/main.go
func newBuildConfig(cfg rest.Config, stop chan struct{}) (*buildConfig, error) {
	bc, err := buildset.NewForConfig(&cfg)
	if err != nil {
		return nil, err
	}

	// Ensure the knative-build CRD is deployed
	// TODO(fejta): probably a better way to do this
	_, err = bc.BuildV1alpha1().Builds("").List(metav1.ListOptions{Limit: 1})
	if err != nil {
		return nil, err
	}
	// Assume watches receive updates, but resync every 30m in case something wonky happens
	bif := buildinfo.NewSharedInformerFactory(bc, 30*time.Minute)
	bif.Build().V1alpha1().Builds().Lister()
	go bif.Start(stop)
	return &buildConfig{
		client:   bc,
		informer: bif.Build().V1alpha1().Builds(),
	}, nil
}
func newBuildConfig(cfg rest.Config, stop chan struct{}) (*buildConfig, error) {
	bc, err := buildset.NewForConfig(&cfg)
	if err != nil {
		return nil, err
	}

	// Ensure the knative-build CRD is deployed
	// TODO(fejta): probably a better way to do this
	_, err = bc.BuildV1alpha1().Builds("").List(metav1.ListOptions{Limit: 1})
	if err != nil {
		return nil, err
	}
	// Assume watches receive updates, but resync every 30m in case something wonky happens
	bif := buildinfo.NewSharedInformerFactory(bc, 30*time.Minute)
	bif.Build().V1alpha1().Builds().Lister()
	go bif.Start(stop)
	return &buildConfig{
		client:   bc,
		informer: bif.Build().V1alpha1().Builds(),
	}, nil
}
func newBuildConfig ( cfg rest . Config , stop chan struct { } ) ( * buildConfig , error ) { bc , err := buildset . NewForConfig ( & cfg ) if err != nil { return nil , err } // Ensure the knative-build CRD is deployed // TODO(fejta): probably a better way to do this _ , err = bc . BuildV1alpha1 ( ) . Builds ( " " ) . List ( metav1 . ListOptions { Limit : 1 } ) if err != nil { return nil , err } // Assume watches receive updates, but resync every 30m in case something wonky happens bif := buildinfo . NewSharedInformerFactory ( bc , 30 * time . Minute ) bif . Build ( ) . V1alpha1 ( ) . Builds ( ) . Lister ( ) go bif . Start ( stop ) return & buildConfig { client : bc , informer : bif . Build ( ) . V1alpha1 ( ) . Builds ( ) , } , nil }
// newBuildConfig returns a client and informer capable of mutating and monitoring the specified config.
newBuildConfig returns a client and informer capable of mutating and monitoring the specified config .