// NewController instantiates a Controller to manage release objects.
NewController instantiates a Controller to manage release objects.
// NewController instantiates a Controller to manage release objects .
func NewController(
	eventsClient kv1core.EventsGetter,
	artifactsHost string,
	releaseInfo releasecontroller.ReleaseInfo,
	graph *releasecontroller.UpgradeGraph,
	authenticationMessage string,
	architecture string,
	artSuffix string,
) *Controller {
	broadcaster := record.NewBroadcaster()
	broadcaster.StartLogging(klog.V(2).Infof)
	broadcaster.StartRecordingToSink(&kv1core.EventSinkImpl{Interface: eventsClient.Events("")})
	recorder := broadcaster.NewRecorder(imagescheme.Scheme, corev1.EventSource{Component: "release-controller-api"})
	parsedReleaseConfigCache, err := lru.New(50)
	if err != nil {
		panic(err)
	}
	c := &Controller{
		eventRecorder: recorder,
		releaseLister: &releasecontroller.MultiImageStreamLister{Listers: make(map[string]imagelisters.ImageStreamNamespaceLister)},
		artifactsHost: artifactsHost,
		releaseInfo: releaseInfo,
		graph: graph,
		parsedReleaseConfigCache: parsedReleaseConfigCache,
		authenticationMessage: authenticationMessage,
		architecture: architecture,
		artSuffix: artSuffix,
	}
	c.dashboards = []Dashboard{
		{"Index", "/"},
		{"Overview", "/dashboards/overview"},
		{"Compare", "/dashboards/compare"},
	}
	return c
}
func NewController ( eventsClient kv1core . EventsGetter , artifactsHost string , releaseInfo releasecontroller . ReleaseInfo , graph * releasecontroller . UpgradeGraph , authenticationMessage string , architecture string , artSuffix string , ) * Controller { broadcaster := record . NewBroadcaster ( ) broadcaster . StartLogging ( klog . V ( 2 ) . Infof ) broadcaster . StartRecordingToSink ( & kv1core . EventSinkImpl { Interface : eventsClient . Events ( " " ) } ) recorder := broadcaster . NewRecorder ( imagescheme . Scheme , corev1 . EventSource { Component : " " } ) parsedReleaseConfigCache , err := lru . New ( 50 ) if err != nil { panic ( err ) } c := & Controller { eventRecorder : recorder , releaseLister : & releasecontroller . MultiImageStreamLister { Listers : make ( map [ string ] imagelisters . ImageStreamNamespaceLister ) } , artifactsHost : artifactsHost , releaseInfo : releaseInfo , graph : graph , parsedReleaseConfigCache : parsedReleaseConfigCache , authenticationMessage : authenticationMessage , architecture : architecture , artSuffix : artSuffix , } c . dashboards = [ ] Dashboard { { " " , " " } , { " " , " " } , { " " , " " } , } return c }
NewController instantiates a Controller to manage release objects.
NewController instantiates a Controller to manage release objects .
// log events at v2 and send them to the server // we cache parsed release configs to avoid the deserialization cost