diff --git a/cmd/apiserver-boot/boot/build/build_executables.go b/cmd/apiserver-boot/boot/build/build_executables.go index 52b2281bae..9cd3b577e0 100644 --- a/cmd/apiserver-boot/boot/build/build_executables.go +++ b/cmd/apiserver-boot/boot/build/build_executables.go @@ -108,6 +108,9 @@ func BazelBuild(cmd *cobra.Command, args []string) { log.Fatal(err) } + os.RemoveAll(filepath.Join("bin", "apiserver")) + os.RemoveAll(filepath.Join("bin", "controller-manager")) + c = exec.Command("cp", filepath.Join("bazel-bin", "cmd", "apiserver", "apiserver"), filepath.Join("bin", "apiserver")) @@ -137,6 +140,9 @@ func GoBuild(cmd *cobra.Command, args []string) { RunGenerate(cmd, args) } + os.RemoveAll(filepath.Join("bin", "apiserver")) + os.RemoveAll(filepath.Join("bin", "controller-manager")) + // Build the apiserver path := filepath.Join("cmd", "apiserver", "main.go") c := exec.Command("go", "build", "-o", filepath.Join(outputdir, "apiserver"), path) diff --git a/cmd/apiserver-boot/boot/create/create.go b/cmd/apiserver-boot/boot/create/create.go index bf5f56ca64..a3d780cfb8 100644 --- a/cmd/apiserver-boot/boot/create/create.go +++ b/cmd/apiserver-boot/boot/create/create.go @@ -43,7 +43,9 @@ func AddCreate(cmd *cobra.Command) { cmd.AddCommand(createCmd) cmd.Flags().StringVar(©right, "copyright", "boilerplate.go.txt", "Location of copyright boilerplate file.") AddCreateGroup(createCmd) + AddCreateResource(createCmd) AddCreateSubresource(createCmd) + AddCreateVersion(createCmd) } func RunCreate(cmd *cobra.Command, args []string) { diff --git a/cmd/apiserver-boot/boot/create/group.go b/cmd/apiserver-boot/boot/create/group.go index dbae00642c..7e5539bf7f 100644 --- a/cmd/apiserver-boot/boot/create/group.go +++ b/cmd/apiserver-boot/boot/create/group.go @@ -40,7 +40,7 @@ func AddCreateGroup(cmd *cobra.Command) { createGroupCmd.Flags().StringVar(&groupName, "group", "", "name of the API group to create") cmd.AddCommand(createGroupCmd) - AddCreateVersion(createGroupCmd) + createGroupCmd.AddCommand(createVersionCmd) } func RunCreateGroup(cmd *cobra.Command, args []string) { diff --git a/cmd/apiserver-boot/boot/create/version.go b/cmd/apiserver-boot/boot/create/version.go index ef666f81e9..1c8a9cc210 100644 --- a/cmd/apiserver-boot/boot/create/version.go +++ b/cmd/apiserver-boot/boot/create/version.go @@ -40,9 +40,9 @@ var createVersionCmd = &cobra.Command{ func AddCreateVersion(cmd *cobra.Command) { createVersionCmd.Flags().StringVar(&groupName, "group", "", "name of the API group to create") createVersionCmd.Flags().StringVar(&versionName, "version", "", "name of the API version to create") - cmd.AddCommand(createVersionCmd) - AddCreateResource(createVersionCmd) + cmd.AddCommand(createVersionCmd) + createVersionCmd.AddCommand(createResourceCmd) } func RunCreateVersion(cmd *cobra.Command, args []string) {