MCPcopy
hub / github.com/helm/helm / newGetValuesCmd

Function newGetValuesCmd

pkg/cmd/get_values.go:40–81  ·  view source on GitHub ↗
(cfg *action.Configuration, out io.Writer)

Source from the content-addressed store, hash-verified

38}
39
40func newGetValuesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
41 var outfmt output.Format
42 client := action.NewGetValues(cfg)
43
44 cmd := &cobra.Command{
45 Use: "values RELEASE_NAME",
46 Short: "download the values file for a named release",
47 Long: getValuesHelp,
48 Args: require.ExactArgs(1),
49 ValidArgsFunction: func(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
50 if len(args) != 0 {
51 return noMoreArgsComp()
52 }
53 return compListReleases(toComplete, args, cfg)
54 },
55 RunE: func(_ *cobra.Command, args []string) error {
56 vals, err := client.Run(args[0])
57 if err != nil {
58 return err
59 }
60 return outfmt.Write(out, &valuesWriter{vals, client.AllValues})
61 },
62 }
63
64 f := cmd.Flags()
65 f.IntVar(&client.Version, "revision", 0, "get the named release with revision")
66 err := cmd.RegisterFlagCompletionFunc("revision", func(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
67 if len(args) == 1 {
68 return compListRevisions(toComplete, cfg, args[0])
69 }
70 return nil, cobra.ShellCompDirectiveNoFileComp
71 })
72
73 if err != nil {
74 log.Fatal(err)
75 }
76
77 f.BoolVarP(&client.AllValues, "all", "a", false, "dump all (computed) values")
78 bindOutputFlag(cmd, &outfmt)
79
80 return cmd
81}
82
83func (v valuesWriter) WriteTable(out io.Writer) error {
84 if v.allValues {

Callers 1

newGetCmdFunction · 0.85

Calls 9

RunMethod · 0.95
WriteMethod · 0.95
NewGetValuesFunction · 0.92
ExactArgsFunction · 0.92
noMoreArgsCompFunction · 0.85
compListReleasesFunction · 0.85
compListRevisionsFunction · 0.85
bindOutputFlagFunction · 0.85
FatalMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…