mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.7 KiB
66 lines
1.7 KiB
/*
|
|
Copyright The Helm Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package main
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"helm.sh/helm/cmd/helm/require"
|
|
"helm.sh/helm/pkg/action"
|
|
)
|
|
|
|
var getHelp = `
|
|
This command shows the details of a named release.
|
|
|
|
It can be used to get extended information about the release, including:
|
|
|
|
- The values used to generate the release
|
|
- The chart used to generate the release
|
|
- The generated manifest file
|
|
|
|
By default, this prints a human readable collection of information about the
|
|
chart, the supplied values, and the generated manifest file.
|
|
`
|
|
|
|
func newGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
client := action.NewGet(cfg)
|
|
|
|
cmd := &cobra.Command{
|
|
Use: "get RELEASE_NAME",
|
|
Short: "download a named release",
|
|
Long: getHelp,
|
|
Args: require.ExactArgs(1),
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
res, err := client.Run(args[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return printRelease(out, res)
|
|
},
|
|
}
|
|
|
|
cmd.Flags().IntVar(&client.Version, "revision", 0, "get the named release with revision")
|
|
|
|
cmd.AddCommand(newGetValuesCmd(cfg, out))
|
|
cmd.AddCommand(newGetManifestCmd(cfg, out))
|
|
cmd.AddCommand(newGetHooksCmd(cfg, out))
|
|
|
|
return cmd
|
|
}
|