craigcondit commented on a change in pull request #313:
URL: 
https://github.com/apache/incubator-yunikorn-k8shim/pull/313#discussion_r732924998



##########
File path: pkg/cache/context.go
##########
@@ -686,7 +716,7 @@ func (ctx *Context) updatePodCondition(task *Task, 
podCondition *v1.PodCondition
                        if podutil.UpdatePodCondition(&task.pod.Status, 
podCondition) {
                                if !ctx.apiProvider.IsTestingMode() {
                                        _, err := 
ctx.apiProvider.GetAPIs().KubeClient.GetClientSet().CoreV1().
-                                               
Pods(task.pod.Namespace).UpdateStatus(task.pod)
+                                               
Pods(task.pod.Namespace).UpdateStatus(context.TODO(), task.pod, 
metav1.UpdateOptions{})

Review comment:
       Fixed in an updated patch.

##########
File path: pkg/cache/context.go
##########
@@ -839,7 +869,7 @@ func (ctx *Context) SaveConfigmap(request 
*si.UpdateConfigurationRequest) *si.Up
        newConf := ykconf.DeepCopy()
        oldConfData := ykconf.Data["queues.yaml"]
        newConf.Data = newConfData
-       _, err = 
ctx.apiProvider.GetAPIs().KubeClient.GetClientSet().CoreV1().ConfigMaps(ykconf.Namespace).Update(newConf)
+       _, err = 
ctx.apiProvider.GetAPIs().KubeClient.GetClientSet().CoreV1().ConfigMaps(ykconf.Namespace).Update(context.TODO(),
 newConf, metav1.UpdateOptions{})

Review comment:
       Fixed in an updated patch.

##########
File path: pkg/cache/context_recovery.go
##########
@@ -87,7 +88,7 @@ func (ctx *Context) recover(mgr []interfaces.Recoverable, due 
time.Duration) err
                var podList *corev1.PodList
                podList, err = 
ctx.apiProvider.GetAPIs().KubeClient.GetClientSet().
                        CoreV1().Pods("").
-                       List(metav1.ListOptions{})
+                       List(context.TODO(), metav1.ListOptions{})

Review comment:
       Fixed in an updated patch.

##########
File path: pkg/plugin/predicates/predicate_manager.go
##########
@@ -0,0 +1,392 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package predicates
+
+import (
+       "context"
+       "fmt"
+
+       "go.uber.org/zap"
+       v1 "k8s.io/api/core/v1"
+       "k8s.io/apimachinery/pkg/runtime"
+       "k8s.io/kube-scheduler/config/v1beta1"
+       "k8s.io/kubernetes/pkg/scheduler/algorithmprovider"
+       apiConfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
+       "k8s.io/kubernetes/pkg/scheduler/apis/config/scheme"
+       "k8s.io/kubernetes/pkg/scheduler/framework"
+       "k8s.io/kubernetes/pkg/scheduler/framework/plugins"
+       "k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
+       "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity"
+       "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename"
+       "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports"
+       "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable"
+       "k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
+       "k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
+       fwruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
+
+       "github.com/apache/incubator-yunikorn-core/pkg/log"
+       "github.com/apache/incubator-yunikorn-k8shim/pkg/common/events"
+)
+
+type PredicateManager interface {
+       Predicates(pod *v1.Pod, node *framework.NodeInfo, allocate bool) 
(plugin string, error error)
+}
+
+var _ PredicateManager = &predicateManagerImpl{}
+
+var configDecoder = scheme.Codecs.UniversalDecoder()
+
+type predicateManagerImpl struct {
+       reservationPreFilters *[]framework.PreFilterPlugin
+       allocationPreFilters  *[]framework.PreFilterPlugin
+       reservationFilters    *[]framework.FilterPlugin
+       allocationFilters     *[]framework.FilterPlugin
+}
+
+func (p *predicateManagerImpl) Predicates(pod *v1.Pod, node 
*framework.NodeInfo, allocate bool) (plugin string, error error) {
+       if allocate {
+               return p.predicatesAllocate(pod, node)
+       }
+       return p.predicatesReserve(pod, node)
+}
+
+func (p *predicateManagerImpl) predicatesReserve(pod *v1.Pod, node 
*framework.NodeInfo) (plugin string, error error) {
+       ctx := context.TODO()

Review comment:
       Fixed in an updated patch.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to