|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|
|
|
package main
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
@ -32,6 +33,7 @@ This command downloads a values file for a given release.
|
|
|
|
|
|
|
|
|
|
|
|
type valuesWriter struct {
|
|
|
|
type valuesWriter struct {
|
|
|
|
vals map[string]interface{}
|
|
|
|
vals map[string]interface{}
|
|
|
|
|
|
|
|
allValues bool
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func newGetValuesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
|
|
func newGetValuesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
|
@ -48,17 +50,7 @@ func newGetValuesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return outfmt.Write(out, &valuesWriter{vals, client.AllValues})
|
|
|
|
if outfmt == output.Table && client.AllValues {
|
|
|
|
|
|
|
|
_, err = out.Write([]byte("COMPUTED VALUES:\n"))
|
|
|
|
|
|
|
|
} else if outfmt == output.Table {
|
|
|
|
|
|
|
|
_, err = out.Write([]byte("USER-SUPPLIED VALUES:\n"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return outfmt.Write(out, &valuesWriter{vals})
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -71,6 +63,11 @@ func newGetValuesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (v valuesWriter) WriteTable(out io.Writer) error {
|
|
|
|
func (v valuesWriter) WriteTable(out io.Writer) error {
|
|
|
|
|
|
|
|
if v.allValues {
|
|
|
|
|
|
|
|
fmt.Fprintln(out, "COMPUTED VALUES:")
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fmt.Fprintln(out, "USER-SUPPLIED VALUES:")
|
|
|
|
|
|
|
|
}
|
|
|
|
return output.EncodeYAML(out, v.vals)
|
|
|
|
return output.EncodeYAML(out, v.vals)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|