cmd

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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(_ *cobra.Command, _ []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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL