mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-20 08:04:52 +00:00
1
go.sum
1
go.sum
@@ -555,7 +555,6 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
|
||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
|
||||
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
|
||||
|
||||
@@ -26,11 +26,16 @@ import (
|
||||
type WorkloadAgentOptions struct {
|
||||
HubKubeconfigFile string
|
||||
SpokeClusterName string
|
||||
QPS float32
|
||||
Burst int
|
||||
}
|
||||
|
||||
// NewWorkloadAgentOptions returns the flags with default value set
|
||||
func NewWorkloadAgentOptions() *WorkloadAgentOptions {
|
||||
return &WorkloadAgentOptions{}
|
||||
return &WorkloadAgentOptions{
|
||||
QPS: 50,
|
||||
Burst: 100,
|
||||
}
|
||||
}
|
||||
|
||||
// AddFlags register and binds the default flags
|
||||
@@ -39,6 +44,8 @@ func (o *WorkloadAgentOptions) AddFlags(cmd *cobra.Command) {
|
||||
// This command only supports reading from config
|
||||
flags.StringVar(&o.HubKubeconfigFile, "hub-kubeconfig", o.HubKubeconfigFile, "Location of kubeconfig file to connect to hub cluster.")
|
||||
flags.StringVar(&o.SpokeClusterName, "spoke-cluster-name", o.SpokeClusterName, "Name of spoke cluster.")
|
||||
flags.Float32Var(&o.QPS, "spoke-kube-api-qps", o.QPS, "QPS to use while talking with apiserver on spoke cluster.")
|
||||
flags.IntVar(&o.Burst, "spoke-kube-api-burst", o.Burst, "Burst to use while talking with apiserver on spoke cluster.")
|
||||
}
|
||||
|
||||
// RunWorkloadAgent starts the controllers on agent to process work from hub.
|
||||
@@ -59,6 +66,8 @@ func (o *WorkloadAgentOptions) RunWorkloadAgent(ctx context.Context, controllerC
|
||||
|
||||
// Build dynamic client and informer for spoke cluster
|
||||
spokeRestConfig := controllerContext.KubeConfig
|
||||
spokeRestConfig.QPS = o.QPS
|
||||
spokeRestConfig.Burst = o.Burst
|
||||
spokeDynamicClient, err := dynamic.NewForConfig(spokeRestConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user