Skip to content

Commit

Permalink
Merge pull request volcano-sh#3615 from liuyuanchun11/controller_addc…
Browse files Browse the repository at this point in the history
…onfig

Add config field to the ControllerOption
  • Loading branch information
volcano-sh-bot authored Jul 27, 2024
2 parents dfc1140 + 9daf618 commit 5633ec4
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 5633ec4

Please sign in to comment.