Add local volume support to container filters

This commit is contained in:
Jonathan Wong
2019-11-21 12:16:09 -08:00
parent ff60138efd
commit a7cff1c75b
3 changed files with 43 additions and 58 deletions

View File

@@ -1,58 +0,0 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
//
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
func GetDocsRunner() *DocsRunner {
r := &DocsRunner{}
c := &cobra.Command{
Use: "docs [API_TYPE]",
Short: "Print out documentation for API resource",
Long: `Print out documentation for API resource
The Docs command reads a JSON schema from the Kustomize API and outputs a pretiffied version of the documentation.
TODO:
<INSERT MORE DOCUMENTATION HERE>
For information on merge rules, run:
kyaml help docs
`,
Example: `kyaml docs kustomization`,
PreRunE: r.preRunE,
RunE: r.runE,
}
r.Command = c
r.Command.Flags().StringVar(&r.apiType, "api-type", "",
"API type to print out")
return r
}
// DocsCommand ...
func DocsCommand() *cobra.Command {
return GetDocsRunner().Command
}
// DocsRunner contains the run function
type DocsRunner struct {
Command *cobra.Command
apiType string
}
func (r *DocsRunner) preRunE(c *cobra.Command, args []string) error {
fmt.Println("Docs pre run. :)")
return nil
}
func (r *DocsRunner) runE(c *cobra.Command, args []string) error {
fmt.Println("Docs actual run. :-)")
fmt.Println(args[0])
return nil
}