Skip to content

Commit

Permalink
Merge pull request #213 from thandayuthapani/ut
Browse files Browse the repository at this point in the history
Added UT cases for Job Package -  job_controller_plugins
  • Loading branch information
volcano-sh-bot authored Jun 6, 2019
2 parents a20f3be + 1272d46 commit 629664b
Show file tree
Hide file tree
Showing 173 changed files with 13,215 additions and 10 deletions.
36 changes: 35 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/apis/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ControlledBy(obj interface{}, gvk schema.GroupVersionKind) bool {
return false
}

func CreateConfigMapIfNotExist(job *vkv1.Job, kubeClients *kubernetes.Clientset, data map[string]string, cmName string) error {
func CreateConfigMapIfNotExist(job *vkv1.Job, kubeClients kubernetes.Interface, data map[string]string, cmName string) error {
// If ConfigMap does not exist, create one for Job.
cmOld, err := kubeClients.CoreV1().ConfigMaps(job.Namespace).Get(cmName, metav1.GetOptions{})
if err != nil {
Expand Down Expand Up @@ -102,7 +102,7 @@ func CreateConfigMapIfNotExist(job *vkv1.Job, kubeClients *kubernetes.Clientset,
return nil
}

func DeleteConfigmap(job *vkv1.Job, kubeClients *kubernetes.Clientset, cmName string) error {
func DeleteConfigmap(job *vkv1.Job, kubeClients kubernetes.Interface, cmName string) error {
if _, err := kubeClients.CoreV1().ConfigMaps(job.Namespace).Get(cmName, metav1.GetOptions{}); err != nil {
if !apierrors.IsNotFound(err) {
glog.V(3).Infof("Failed to get Configmap for Job <%s/%s>: %v",
Expand Down
12 changes: 6 additions & 6 deletions pkg/controllers/job/job_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ import (

// Controller the Job Controller type
type Controller struct {
kubeClients *kubernetes.Clientset
vkClients *vkver.Clientset
kbClients *kbver.Clientset
kubeClients kubernetes.Interface
vkClients vkver.Interface
kbClients kbver.Interface

jobInformer vkbatchinfo.JobInformer
podInformer coreinformers.PodInformer
Expand Down Expand Up @@ -101,9 +101,9 @@ type Controller struct {

// NewJobController create new Job Controller
func NewJobController(
kubeClient *kubernetes.Clientset,
kbClient *kbver.Clientset,
vkClient *vkver.Clientset,
kubeClient kubernetes.Interface,
kbClient kbver.Interface,
vkClient vkver.Interface,
) *Controller {

//Initialize event client
Expand Down
Loading

0 comments on commit 629664b

Please sign in to comment.