manirajv06 commented on code in PR #1060:
URL: https://github.com/apache/yunikorn-k8shim/pull/1060#discussion_r3781839664
##########
pkg/client/apifactory.go:
##########
@@ -89,9 +90,12 @@ type APIFactory struct {
lock *locking.RWMutex
}
-func NewAPIFactory(scheduler api.SchedulerAPI, informerFactory
informers.SharedInformerFactory, configs *conf.SchedulerConf, testMode bool)
(*APIFactory, error) {
+// NewAPIFactory creates the clients shared by the shim. The clientset backing
informerFactory
+// is passed in so that the namespaced factory created here shares it: both
only run informers
+// so they need the same unlimited client and the same attribution.
+func NewAPIFactory(scheduler api.SchedulerAPI, informerClientSet
kubernetes.Interface, informerFactory informers.SharedInformerFactory, configs
*conf.SchedulerConf, testMode bool) (*APIFactory, error) {
kubeClient := NewKubeClient(configs.KubeConfig)
Review Comment:
I am trying to introduce a new concern "configmaps" or something similar to
handle the config map GET calls.
With this, we could have 4 concerns 1. writes 2. informers 3. events 4.
configmaps or reads. This new client could be separated out from "writes"
client operations which should be meant only to handle create, update, delete
of pods/pvcs. New client meant for "configmaps" concern should handle these
places 1. Two GET calls during bootstrap 2. Two GET calls during registration.
That way, all reads are routed through this new client and could be configured
different than the writes. Currently, we might have these 4 GET calls but new
cases for reads in future also could use this new client.
BTW, I think interfaces#GetConfigs(), interfaces#Get() can be removed as I
don't see any usage in production code. If required in mocks only, then methods
could be called directly without these wrappers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]