Skip to content

Commit

Permalink
Add config field to the ControllerOption
Browse files Browse the repository at this point in the history
Signed-off-by: liuyuanchun <[email protected]>
  • Loading branch information
liuyuanchun11 committed Jul 24, 2024
1 parent d679a7b commit f021326
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/controller-manager/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func startControllers(config *rest.Config, opt *options.ServerOption) func(ctx c
controllerOpt.InheritOwnerAnnotations = opt.InheritOwnerAnnotations
controllerOpt.WorkerThreadsForPG = opt.WorkerThreadsForPG
controllerOpt.WorkerThreadsForGC = opt.WorkerThreadsForGC
controllerOpt.Config = config

return func(ctx context.Context) {
framework.ForeachController(func(c framework.Controller) {
Expand Down
5 changes: 5 additions & 0 deletions pkg/controllers/framework/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package framework
import (
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"

vcclientset "volcano.sh/apis/pkg/client/clientset/versioned"
vcinformer "volcano.sh/apis/pkg/client/informers/externalversions"
Expand All @@ -37,6 +38,10 @@ type ControllerOption struct {
InheritOwnerAnnotations bool
WorkerThreadsForPG uint32
WorkerThreadsForGC uint32

// Config holds the common attributes that can be passed to a Kubernetes client
// and controllers registered by the users can use it.
Config *rest.Config
}

// Controller is the interface of all controllers.
Expand Down

0 comments on commit f021326

Please sign in to comment.