Surface kube config in scheduler framework handle

This commit is contained in:
Wei Huang
2021-03-29 12:27:27 -07:00
parent 3d48f0d1dd
commit e7f67b1a63
11 changed files with 55 additions and 14 deletions

View File

@@ -41,6 +41,7 @@ type Config struct {
SecureServing *apiserver.SecureServingInfo
Client clientset.Interface
KubeConfig *restclient.Config
InformerFactory informers.SharedInformerFactory
//lint:ignore SA1019 this deprecated field still needs to be used for now. It will be removed once the migration is done.

View File

@@ -289,6 +289,7 @@ func (o *Options) Config() (*schedulerappconfig.Config, error) {
}
c.Client = client
c.KubeConfig = kubeConfig
c.InformerFactory = scheduler.NewInformerFactory(client, 0)
c.LeaderElection = leaderElectionConfig

View File

@@ -323,6 +323,7 @@ func Setup(ctx context.Context, opts *options.Options, outOfTreeRegistryOptions
cc.InformerFactory,
recorderFactory,
ctx.Done(),
scheduler.WithKubeConfig(cc.KubeConfig),
scheduler.WithProfiles(cc.ComponentConfig.Profiles...),
scheduler.WithAlgorithmSource(cc.ComponentConfig.AlgorithmSource),
scheduler.WithPercentageOfNodesToScore(cc.ComponentConfig.PercentageOfNodesToScore),