Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
lminzhw committed Jun 28, 2019
1 parent 4d6d27d commit 3e3c27f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/admission/admit_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func TestValidateExecution(t *testing.T) {
},
},
reviewResponse: v1beta1.AdmissionResponse{Allowed: false},
ret: "'minAvailable' cannot be less than zero.",
ret: "'minAvailable' must be greater than zero.",
ExpectErr: true,
},
// maxretry less than zero
Expand Down
10 changes: 6 additions & 4 deletions pkg/controllers/job/job_controller_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
kubebatchclient "github.com/kubernetes-sigs/kube-batch/pkg/client/clientset/versioned"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
kubeclientset "k8s.io/client-go/kubernetes"
vkbatchv1 "volcano.sh/volcano/pkg/apis/batch/v1alpha1"
vkv1 "volcano.sh/volcano/pkg/apis/batch/v1alpha1"
Expand Down Expand Up @@ -67,10 +68,11 @@ func newController() *Controller {
func buildPod(namespace, name string, p v1.PodPhase, labels map[string]string) *v1.Pod {
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
UID: types.UID(fmt.Sprintf("%v-%v", namespace, name)),
Name: name,
Namespace: namespace,
Labels: labels,
UID: types.UID(fmt.Sprintf("%v-%v", namespace, name)),
Name: name,
Namespace: namespace,
Labels: labels,
ResourceVersion: string(uuid.NewUUID()),
},
Status: v1.PodStatus{
Phase: p,
Expand Down

0 comments on commit 3e3c27f

Please sign in to comment.