Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GenerateCmd = &cobra.Command{ Use: "generate", Short: "Generate CRD install files for the resource definition", Long: `Generate CRD install files for the resource definition. - if param domain is specified, it will take given root-path as working directory, and take current path if root-path not specified; note that api path "pkg/apis" must exist under the root-path. - if param domain is not specified, then it will search parent directories of root path for PROJECT file, take its path as working directory, and fetch domain info from the file. `, Example: "crd generate --domain k8s.io", Run: func(cmd *cobra.Command, args []string) { fmt.Println("Writing CRD files...") if err := g.ValidateAndInitFields(); err != nil { log.Fatal(err) } if err := g.Do(); err != nil { log.Fatal(err) } fmt.Printf("CRD files generated, files can be found under path %s.\n", g.OutputDir) }, }
GenerateCmd represents the generate command
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GeneratorForFlags ¶
func GeneratorForFlags(f *flag.FlagSet) *crdgenerator.Generator
GeneratorForFlags registers flags for Generator fields and returns the Generator.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.