Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Issue Fixes in vkctl #180

Merged
merged 1 commit into from
May 17, 2019
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
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