Skip to content

Commit

Permalink
Merge pull request #180 from SrinivasChilveri/SimpleIssueFixes
Browse files Browse the repository at this point in the history
Simple Issue Fixes in vkctl
  • Loading branch information
volcano-sh-bot authored May 17, 2019
2 parents 10c254c + 7578862 commit dc2b171
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cli/job/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type commonFlags struct {
}

func initFlags(cmd *cobra.Command, cf *commonFlags) {
cmd.Flags().StringVarP(&cf.SchedulerName, "scheduler", "S", "vn-scheduler", "the scheduler for this job")
cmd.Flags().StringVarP(&cf.SchedulerName, "scheduler", "S", "kube-batch", "the scheduler for this job")
cmd.Flags().StringVarP(&cf.Master, "master", "s", "", "the address of apiserver")

if home := homeDir(); home != "" {
Expand Down
5 changes: 5 additions & 0 deletions pkg/cli/job/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ func DeleteJob() error {
return err
}

if deleteJobFlags.JobName == "" {
err := fmt.Errorf("job name is mandaorty to delete a particular job")
return err
}

jobClient := versioned.NewForConfigOrDie(config)
err = jobClient.BatchV1alpha1().Jobs(deleteJobFlags.Namespace).Delete(deleteJobFlags.JobName, &metav1.DeleteOptions{})
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions pkg/cli/job/resume.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
package job

import (
"fmt"
"github.com/spf13/cobra"

"volcano.sh/volcano/pkg/apis/batch/v1alpha1"
Expand All @@ -42,6 +43,10 @@ func ResumeJob() error {
if err != nil {
return err
}
if resumeJobFlags.JobName == "" {
err := fmt.Errorf("job name is mandaorty to resume a particular job")
return err
}

return createJobCommand(config,
resumeJobFlags.Namespace, resumeJobFlags.JobName,
Expand Down
6 changes: 6 additions & 0 deletions pkg/cli/job/suspend.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
package job

import (
"fmt"
"github.com/spf13/cobra"

"volcano.sh/volcano/pkg/apis/batch/v1alpha1"
Expand Down Expand Up @@ -43,6 +44,11 @@ func SuspendJob() error {
return err
}

if suspendJobFlags.JobName == "" {
err := fmt.Errorf("job name is mandaorty to suspend a particular job")
return err
}

return createJobCommand(config,
suspendJobFlags.Namespace, suspendJobFlags.JobName,
v1alpha1.AbortJobAction)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/queue/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func GetQueue() error {
}

if getQueueFlags.Name == "" {
err := fmt.Errorf("name is mandaorty to get the partiular queue details")
err := fmt.Errorf("name is mandaorty to get the particular queue details")
return err
}

Expand Down

0 comments on commit dc2b171

Please sign in to comment.