{"modulePath":"github.com/2lambda123/openshift-origin","version":"v3.7.2+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmd\n\n## Constants\n\n```go\nconst (\n\tGeneratedByNamespace = \"openshift.io/generated-by\"\n\tGeneratedForJob      = \"openshift.io/generated-job\"\n\tGeneratedForJobFor   = \"openshift.io/generated-job.for\"\n\tGeneratedByNewApp    = \"OpenShiftNewApp\"\n\tGeneratedByNewBuild  = \"OpenShiftNewBuild\"\n)\n```\n\n## Variables\n\n```go\nvar ErrNoInputs = errors.New(\"no inputs provided\")\n```\nErrNoInputs is returned when no inputs are specified\n\n## Functions\n\n```go\nfunc AddComponentInputsToRefBuilder(b *app.ReferenceBuilder, r *Resolvers, c *ComponentInputs, g *GenerationInputs) error\n```\nAddComponentInputsToRefBuilder set up the components to be used by the reference builder.\n\n```go\nfunc AddDockerfileToSourceRepositories(b *app.ReferenceBuilder, dockerfile string) error\n```\nAddDockerfile adds a Dockerfile passed in the command line to the reference builder.\n\n```go\nfunc AddImageSourceRepository(sourceRepos app.SourceRepositories, r app.Resolver, g *GenerationInputs) (app.ComponentReference, app.SourceRepositories, error)\n```\n\n```go\nfunc AddMissingComponentsToRefBuilder(\n\tb *app.ReferenceBuilder, repositories app.SourceRepositories, dockerfileResolver, sourceResolver, pipelineResolver app.Resolver,\n\tg *GenerationInputs,\n) (app.ComponentReferences, error)\n```\nComponentsForSourceRepositories creates components for repositories that have not been previously associated by a builder. These components have already gone through source code detection and have a SourceRepositoryInfo attached to them.\n\n```go\nfunc AddSourceRepositoriesToRefBuilder(b *app.ReferenceBuilder, repos []string, g *GenerationInputs) (app.SourceRepositories, error)\n```\nAddSourceRepositoriesToRefBuilder adds the provided repositories to the reference builder, identifies which should be built using Docker, and then returns the full list of source repositories.\n\n```go\nfunc DescribeGeneratedTemplate(out io.Writer, input string, result *templateapi.Template, baseNamespace string)\n```\nDescribeGeneratedTemplate writes a description of the provided template to out.\n\n```go\nfunc DetectSource(repositories []*app.SourceRepository, d app.Detector, g *GenerationInputs) error\n```\nDetectSource runs a code detector on the passed in repositories to obtain a SourceRepositoryInfo\n\n```go\nfunc EnsureHasSource(components app.ComponentReferences, repositories app.SourceRepositories, g *GenerationInputs) error\n```\nEnsureHasSource ensure every builder component has source code associated with it. It takes a list of component references that are builders and have not been associated with source, and a set of source repositories that have not been associated with a builder\n\n```go\nfunc InferBuildTypes(components app.ComponentReferences, g *GenerationInputs) (app.ComponentReferences, error)\n```\nInferBuildTypes infers build status and mismatches between source and docker builders\n\n```go\nfunc TransformTemplate(tpl *templateapi.Template, templateProcessor templateinternalclient.TemplateProcessorInterface, namespace string, parameters map[string]string, ignoreUnknownParameters bool) (*templateapi.Template, error)\n```\nTransformTemplate processes a template with the provided parameters, returning an error if transformation fails.\n\n## Types\n\n```go\ntype AppConfig struct {\n\tComponentInputs\n\tGenerationInputs\n\n\tResolvedComponents *ResolvedComponents\n\n\tSkipGeneration bool\n\n\tAllowSecretUse              bool\n\tSourceSecret                string\n\tAllowNonNumericExposedPorts bool\n\tSecretAccessor              app.SecretAccessor\n\n\tAsSearch bool\n\tAsList   bool\n\tDryRun   bool\n\n\tIn     io.Reader\n\tOut    io.Writer\n\tErrOut io.Writer\n\n\tKubeClient     kclientset.Interface\n\tImageClient    imageclient.ImageInterface\n\tRouteClient    routeclient.RouteInterface\n\tTemplateClient templateclient.TemplateInterface\n\n\tResolvers\n\n\tTyper            runtime.ObjectTyper\n\tMapper           meta.RESTMapper\n\tCategoryExpander resource.CategoryExpander\n\tClientMapper     resource.ClientMapper\n\n\tOriginNamespace string\n\n\tArgumentClassificationErrors []ArgumentClassificationError\n}\n```\nAppConfig contains all the necessary configuration for an application\n\n```go\nfunc NewAppConfig() *AppConfig\n```\nNewAppConfig returns a new AppConfig, but you must set your typer, mapper, and clientMapper after the command has been run and flags have been parsed.\n\n```go\nfunc (c *AppConfig) AddArguments(args []string) []string\n```\nAddArguments converts command line arguments into the appropriate bucket based on what they look like\n\n```go\nfunc (c *AppConfig) DockerRegistrySearcher() app.Searcher\n```\n\n```go\nfunc (c *AppConfig) HasArguments() bool\n```\n\n```go\nfunc (c *AppConfig) Querying() bool\n```\n\n```go\nfunc (c *AppConfig) Run() (*AppResult, error)\n```\nRun executes the provided config to generate objects.\n\n```go\nfunc (c *AppConfig) RunQuery() (*QueryResult, error)\n```\nRunQuery executes the provided config and returns the result of the resolution.\n\n```go\nfunc (c *AppConfig) SetOpenShiftClient(imageClient imageclient.ImageInterface, templateClient templateclient.TemplateInterface, routeClient routeclient.RouteInterface, OriginNamespace string, dockerclient *docker.Client)\n```\nSetOpenShiftClient sets the passed OpenShift client in the application configuration\n\n```go\ntype AppResult struct {\n\tList *kapi.List\n\n\tName      string\n\tHasSource bool\n\tNamespace string\n\n\tGeneratedJobs bool\n}\n```\nAppResult contains the results of an application\n\n```go\ntype ArgumentClassificationError struct {\n\tKey   string\n\tValue error\n}\n```\n\n```go\ntype ComponentInputs struct {\n\tSourceRepositories []string\n\n\tComponents    []string\n\tImageStreams  []string\n\tDockerImages  []string\n\tTemplates     []string\n\tTemplateFiles []string\n\n\tGroups []string\n}\n```\nComponentInputs are transformed into ResolvedComponents\n\n```go\ntype ErrRequiresExplicitAccess struct {\n\tMatch app.ComponentMatch\n\tInput app.GeneratorInput\n}\n```\n\n```go\nfunc (e ErrRequiresExplicitAccess) Error() string\n```\n\n```go\ntype GenerationInputs struct {\n\tTemplateParameters []string\n\tEnvironment        []string\n\tBuildEnvironment   []string\n\tBuildArgs          []string\n\tLabels             map[string]string\n\n\tTemplateParameterFiles []string\n\tEnvironmentFiles       []string\n\tBuildEnvironmentFiles  []string\n\n\tIgnoreUnknownParameters bool\n\tInsecureRegistry        bool\n\n\tStrategy generate.Strategy\n\n\tName     string\n\tTo       string\n\tNoOutput bool\n\n\tOutputDocker  bool\n\tDockerfile    string\n\tExpectToBuild bool\n\tBinaryBuild   bool\n\tContextDir    string\n\n\tSourceImage     string\n\tSourceImagePath string\n\n\tSecrets []string\n\n\tAllowMissingImageStreamTags bool\n\n\tDeploy           bool\n\tAsTestDeployment bool\n\n\tAllowGenerationErrors bool\n}\n```\nGenerationInputs control how new-app creates output TODO: split these into finer grained structs\n\n```go\ntype QueryResult struct {\n\tMatches app.ComponentMatches\n\tList    *kapi.List\n}\n```\nQueryResult contains the results of a query (search or list)\n\n```go\ntype ResolvedComponents struct {\n\tComponents   app.ComponentReferences\n\tRepositories app.SourceRepositories\n}\n```\nResolvedComponents is the input to generation\n\n```go\nfunc Resolve(appConfig *AppConfig) (*ResolvedComponents, error)\n```\nResolve transforms unstructured inputs (component names, templates, images) into a set of resolved components, or returns an error.\n\n```go\ntype Resolvers struct {\n\tDockerSearcher                  app.Searcher\n\tImageStreamSearcher             app.Searcher\n\tImageStreamByAnnotationSearcher app.Searcher\n\tTemplateSearcher                app.Searcher\n\tTemplateFileSearcher            app.Searcher\n\n\tAllowMissingImages bool\n\n\tDetector app.Detector\n}\n```\nResolvers are used to identify source repositories, images, or templates in different contexts\n\n```go\nfunc (r *Resolvers) DockerfileResolver() app.Resolver\n```\n\n```go\nfunc (r *Resolvers) ImageSourceResolver() app.Resolver\n```\n\n```go\nfunc (r *Resolvers) PipelineResolver() app.Resolver\n```\n\n```go\nfunc (r *Resolvers) SourceResolver() app.Resolver\n```\nTODO: why does this differ from ImageSourceResolver?\n\n","path":"github.com/2lambda123/openshift-origin/pkg/generate/app/cmd","name":"cmd","synopsis":"","isRedistributable":true}
