This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-k8shim.git
The following commit(s) were added to refs/heads/master by this push:
new 3db19ec9 [YUNIKORN-2640] Remove config from Clients (#852)
3db19ec9 is described below
commit 3db19ec9b6f94b076a073c0c2017f79f35f2bdf5
Author: 0lai0 <[email protected]>
AuthorDate: Fri Jul 5 00:46:30 2024 +0800
[YUNIKORN-2640] Remove config from Clients (#852)
Closes: #852
Signed-off-by: Chia-Ping Tsai <[email protected]>
---
pkg/cache/context.go | 2 +-
pkg/client/apifactory.go | 1 -
pkg/client/apifactory_mock.go | 15 ---------------
pkg/client/clients.go | 8 --------
4 files changed, 1 insertion(+), 25 deletions(-)
diff --git a/pkg/cache/context.go b/pkg/cache/context.go
index 1575d5f8..f2870519 100644
--- a/pkg/cache/context.go
+++ b/pkg/cache/context.go
@@ -93,7 +93,7 @@ func NewContextWithBootstrapConfigMaps(apis
client.APIProvider, bootstrapConfigM
ctx := &Context{
applications: make(map[string]*Application),
apiProvider: apis,
- namespace: apis.GetAPIs().GetConf().Namespace,
+ namespace: schedulerconf.GetSchedulerConf().Namespace,
configMaps: bootstrapConfigMaps,
lock: &locking.RWMutex{},
klogger: klog.NewKlogr(),
diff --git a/pkg/client/apifactory.go b/pkg/client/apifactory.go
index beedfbd9..050b380d 100644
--- a/pkg/client/apifactory.go
+++ b/pkg/client/apifactory.go
@@ -115,7 +115,6 @@ func NewAPIFactory(scheduler api.SchedulerAPI,
informerFactory informers.SharedI
return &APIFactory{
clients: &Clients{
- conf: configs,
KubeClient: kubeClient,
SchedulerAPI: scheduler,
InformerFactory: informerFactory,
diff --git a/pkg/client/apifactory_mock.go b/pkg/client/apifactory_mock.go
index fee2d257..2740f03d 100644
--- a/pkg/client/apifactory_mock.go
+++ b/pkg/client/apifactory_mock.go
@@ -33,7 +33,6 @@ import (
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
"github.com/apache/yunikorn-k8shim/pkg/common/test"
- "github.com/apache/yunikorn-k8shim/pkg/conf"
"github.com/apache/yunikorn-k8shim/pkg/locking"
"github.com/apache/yunikorn-k8shim/pkg/log"
"github.com/apache/yunikorn-scheduler-interface/lib/go/si"
@@ -67,20 +66,6 @@ const (
func NewMockedAPIProvider(showError bool) *MockedAPIProvider {
return &MockedAPIProvider{
clients: &Clients{
- conf: &conf.SchedulerConf{
- ClusterID: "yk-test-cluster",
- ClusterVersion: "0.1",
- PolicyGroup: "queues",
- Interval: 0,
- KubeConfig: "",
- VolumeBindTimeout: 0,
- TestMode: true,
- EventChannelCapacity: 0,
- DispatchTimeout: 0,
- KubeQPS: 0,
- KubeBurst: 0,
- Namespace: "yunikorn",
- },
KubeClient: NewKubeClientMock(showError),
SchedulerAPI: test.NewSchedulerAPIMock(),
PodInformer: test.NewMockedPodInformer(),
diff --git a/pkg/client/clients.go b/pkg/client/clients.go
index 479b6e2b..09f02df9 100644
--- a/pkg/client/clients.go
+++ b/pkg/client/clients.go
@@ -29,7 +29,6 @@ import (
storageInformerV1 "k8s.io/client-go/informers/storage/v1"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
- "github.com/apache/yunikorn-k8shim/pkg/conf"
"github.com/apache/yunikorn-k8shim/pkg/log"
"github.com/apache/yunikorn-scheduler-interface/lib/go/api"
)
@@ -38,9 +37,6 @@ import (
// that can be shared by callers when talking to K8s api-server,
// or the scheduler core.
type Clients struct {
- // configs
- conf *conf.SchedulerConf
-
// client apis
KubeClient KubeClient
SchedulerAPI api.SchedulerAPI
@@ -63,10 +59,6 @@ type Clients struct {
VolumeBinder volumebinding.SchedulerVolumeBinder
}
-func (c *Clients) GetConf() *conf.SchedulerConf {
- return c.conf
-}
-
func (c *Clients) WaitForSync() {
syncStartTime := time.Now()
counter := 0
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]