From ff4349fcb9976f91755dcd6ab8bdd66e72e6825e Mon Sep 17 00:00:00 2001 From: Klaus Ma Date: Mon, 21 Jan 2019 10:09:59 +0800 Subject: [PATCH] Correct typos. Signed-off-by: Klaus Ma --- cmd/cli/{vnctl.go => vkctl.go} | 4 +++- pkg/cli/job/list.go | 2 +- pkg/cli/job/run.go | 4 ++-- pkg/cli/job/util.go | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) rename cmd/cli/{vnctl.go => vkctl.go} (95%) diff --git a/cmd/cli/vnctl.go b/cmd/cli/vkctl.go similarity index 95% rename from cmd/cli/vnctl.go rename to cmd/cli/vkctl.go index f54f9e6178..f364b63d72 100644 --- a/cmd/cli/vnctl.go +++ b/cmd/cli/vkctl.go @@ -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) { diff --git a/pkg/cli/job/list.go b/pkg/cli/job/list.go index 3c33264b8d..5f564f007d 100644 --- a/pkg/cli/job/list.go +++ b/pkg/cli/job/list.go @@ -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 } diff --git a/pkg/cli/job/run.go b/pkg/cli/job/run.go index f32ee61c4d..c0b4c3b684 100644 --- a/pkg/cli/job/run.go +++ b/pkg/cli/job/run.go @@ -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) @@ -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 } diff --git a/pkg/cli/job/util.go b/pkg/cli/job/util.go index 66c81a7623..7c0bc26741 100644 --- a/pkg/cli/job/util.go +++ b/pkg/cli/job/util.go @@ -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 =", resourceStatement) + return nil, fmt.Errorf("invalid argument syntax %v, expected =", resourceStatement) } resourceName := v1.ResourceName(parts[0]) resourceQuantity, err := resource.ParseQuantity(parts[1])