Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Add PodControlInterface and PodControllerRefManager #73

Merged
merged 7 commits into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pkg/controller.v1/common/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/tools/cache"
"k8s.io/kubernetes/pkg/controller"

apiv1 "github.com/kubeflow/common/pkg/apis/common/v1"
commonutil "github.com/kubeflow/common/pkg/util"
Expand Down Expand Up @@ -73,7 +72,7 @@ func (jc *JobController) AddPod(obj interface{}) {
return
}

jobKey, err := controller.KeyFunc(job)
jobKey, err := KeyFunc(job)
if err != nil {
logger.Infof("Failed to get the jobkey: %v", err)
return
Expand Down Expand Up @@ -116,7 +115,7 @@ func (jc *JobController) UpdatePod(old, cur interface{}) {
// The ControllerRef was changed. Sync the old controller, if any.
if job := jc.resolveControllerRef(oldPod.Namespace, oldControllerRef); job != nil {
logger.Infof("pod ControllerRef updated: %v, %v", curPod, oldPod)
jobKey, err := controller.KeyFunc(job)
jobKey, err := KeyFunc(job)
if err != nil {
return
}
Expand All @@ -132,7 +131,7 @@ func (jc *JobController) UpdatePod(old, cur interface{}) {
return
}
logger.Debugf("pod has a ControllerRef: %v, %v", curPod, oldPod)
jobKey, err := controller.KeyFunc(job)
jobKey, err := KeyFunc(job)
if err != nil {
return
}
Expand Down Expand Up @@ -175,7 +174,7 @@ func (jc *JobController) DeletePod(obj interface{}) {
if job == nil {
return
}
jobKey, err := controller.KeyFunc(job)
jobKey, err := KeyFunc(job)
if err != nil {
return
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller.v1/common/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/kubernetes/pkg/controller"
)

// When a service is created, enqueue the controller that manages it and update its expectations.
Expand All @@ -49,7 +48,7 @@ func (jc *JobController) AddService(obj interface{}) {
return
}

jobKey, err := controller.KeyFunc(job)
jobKey, err := KeyFunc(job)
if err != nil {
return
}
Expand Down
Loading