Skip to content

Commit

Permalink
Merge pull request volcano-sh#8 from k82cn/cli_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Ma committed Jan 21, 2019
2 parents 3746baa + ff4349f commit 2eb6c11
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion cmd/cli/vnctl.go → cmd/cli/vkctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func main() {

rootCmd.AddCommand(jobCmd)

rootCmd.Execute()
if err := rootCmd.Execute(); err != nil {
fmt.Printf("Failed to execute command: %v", err)
}
}

func checkError(cmd *cobra.Command, err error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/job/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func ListJobs() error {
}

jobClient := versioned.NewForConfigOrDie(config)
jobs, err := jobClient.Batch().Jobs(listJobFlags.Namespace).List(metav1.ListOptions{})
jobs, err := jobClient.BatchV1alpha1().Jobs(listJobFlags.Namespace).List(metav1.ListOptions{})
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/job/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func InitRunFlags(cmd *cobra.Command) {
cmd.Flags().StringVarP(&launchJobFlags.Requests, "requests", "", "cpu=1000m,memory=100Mi", "the resource request of the task")
}

var jobName = "job.volcanproj.org"
var jobName = "job.volcano.hpw.cloud"

func RunJob() error {
config, err := buildConfig(launchJobFlags.Master, launchJobFlags.Kubeconfig)
Expand Down Expand Up @@ -100,7 +100,7 @@ func RunJob() error {
}

jobClient := versioned.NewForConfigOrDie(config)
if _, err := jobClient.Batch().Jobs(launchJobFlags.Namespace).Create(job); err != nil {
if _, err := jobClient.BatchV1alpha1().Jobs(launchJobFlags.Namespace).Create(job); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/job/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func populateResourceListV1(spec string) (v1.ResourceList, error) {
for _, resourceStatement := range resourceStatements {
parts := strings.Split(resourceStatement, "=")
if len(parts) != 2 {
return nil, fmt.Errorf("Invalid argument syntax %v, expected <resource>=<value>", resourceStatement)
return nil, fmt.Errorf("invalid argument syntax %v, expected <resource>=<value>", resourceStatement)
}
resourceName := v1.ResourceName(parts[0])
resourceQuantity, err := resource.ParseQuantity(parts[1])
Expand Down

0 comments on commit 2eb6c11

Please sign in to comment.