github.com/verrazzano/verrazzano@v1.7.0/tools/charts-manager/vcm/cmd/root/root.go (about)

     1  // Copyright (c) 2023, Oracle and/or its affiliates.
     2  // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  package root
     5  
     6  import (
     7  	"github.com/spf13/cobra"
     8  	"github.com/verrazzano/verrazzano/tools/charts-manager/vcm/cmd/diff"
     9  	"github.com/verrazzano/verrazzano/tools/charts-manager/vcm/cmd/patch"
    10  	"github.com/verrazzano/verrazzano/tools/charts-manager/vcm/cmd/pull"
    11  	"github.com/verrazzano/verrazzano/tools/charts-manager/vcm/pkg/fs"
    12  	"github.com/verrazzano/verrazzano/tools/charts-manager/vcm/pkg/helm"
    13  	cmdhelpers "github.com/verrazzano/verrazzano/tools/vz/cmd/helpers"
    14  	"github.com/verrazzano/verrazzano/tools/vz/pkg/helpers"
    15  )
    16  
    17  const (
    18  	CommandName = "vcm"
    19  	helpShort   = "The vcm tool is a command-line utility that enables developers to pull and customize helm charts."
    20  	helpLong    = "The vcm tool provides commands pull, diff and patch which can be used to pull a helm chart and ability to diff against an earlier version or update from a patch file."
    21  )
    22  
    23  // NewRootCmd - create the root cobra command
    24  func NewRootCmd(vzHelper helpers.VZHelper, hfs fs.ChartFileSystem, helmConfig helm.HelmConfig) *cobra.Command {
    25  	cmd := cmdhelpers.NewCommand(vzHelper, CommandName, helpShort, helpLong)
    26  	// Add commands
    27  	cmd.AddCommand(pull.NewCmdPull(vzHelper, hfs, helmConfig))
    28  	cmd.AddCommand(diff.NewCmdDiff(vzHelper, hfs))
    29  	cmd.AddCommand(patch.NewCmdPatch(vzHelper, hfs))
    30  	return cmd
    31  }