github.com/wikiq/kubernetes@v3.0.0-beta.3+incompatible/cmd/helm/get.go (about)

     1  /*
     2  Copyright The Helm Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package main
    18  
    19  import (
    20  	"io"
    21  
    22  	"github.com/spf13/cobra"
    23  
    24  	"helm.sh/helm/cmd/helm/require"
    25  	"helm.sh/helm/pkg/action"
    26  )
    27  
    28  var getHelp = `
    29  This command shows the details of a named release.
    30  
    31  It can be used to get extended information about the release, including:
    32  
    33    - The values used to generate the release
    34    - The chart used to generate the release
    35    - The generated manifest file
    36  
    37  By default, this prints a human readable collection of information about the
    38  chart, the supplied values, and the generated manifest file.
    39  `
    40  
    41  func newGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
    42  	client := action.NewGet(cfg)
    43  
    44  	cmd := &cobra.Command{
    45  		Use:   "get RELEASE_NAME",
    46  		Short: "download a named release",
    47  		Long:  getHelp,
    48  		Args:  require.ExactArgs(1),
    49  		RunE: func(cmd *cobra.Command, args []string) error {
    50  			res, err := client.Run(args[0])
    51  			if err != nil {
    52  				return err
    53  			}
    54  			return printRelease(out, res)
    55  		},
    56  	}
    57  
    58  	cmd.Flags().IntVar(&client.Version, "revision", 0, "get the named release with revision")
    59  
    60  	cmd.AddCommand(newGetValuesCmd(cfg, out))
    61  	cmd.AddCommand(newGetManifestCmd(cfg, out))
    62  	cmd.AddCommand(newGetHooksCmd(cfg, out))
    63  
    64  	return cmd
    65  }