MCPcopy
hub / github.com/helm/helm / newDependencyBuildCmd

Function newDependencyBuildCmd

pkg/cmd/dependency_build.go:45–92  ·  view source on GitHub ↗
(out io.Writer)

Source from the content-addressed store, hash-verified

43`
44
45func newDependencyBuildCmd(out io.Writer) *cobra.Command {
46 client := action.NewDependency()
47
48 cmd := &cobra.Command{
49 Use: "build CHART",
50 Short: "rebuild the charts/ directory based on the Chart.lock file",
51 Long: dependencyBuildDesc,
52 Args: require.MaximumNArgs(1),
53 RunE: func(_ *cobra.Command, args []string) error {
54 chartpath := "."
55 if len(args) > 0 {
56 chartpath = filepath.Clean(args[0])
57 }
58 registryClient, err := newRegistryClient(out, client.CertFile, client.KeyFile, client.CaFile,
59 client.InsecureSkipTLSVerify, client.PlainHTTP, client.Username, client.Password)
60 if err != nil {
61 return fmt.Errorf("missing registry client: %w", err)
62 }
63
64 man := &downloader.Manager{
65 Out: out,
66 ChartPath: chartpath,
67 Keyring: client.Keyring,
68 SkipUpdate: client.SkipRefresh,
69 Getters: getter.All(settings),
70 RegistryClient: registryClient,
71 RepositoryConfig: settings.RepositoryConfig,
72 RepositoryCache: settings.RepositoryCache,
73 ContentCache: settings.ContentCache,
74 Debug: settings.Debug,
75 }
76 if client.Verify {
77 man.Verify = downloader.VerifyIfPossible
78 }
79 err = man.Build()
80 var e downloader.ErrRepoNotFound
81 if errors.As(err, &e) {
82 return fmt.Errorf("%s. Please add the missing repos via 'helm repo add'", e.Error())
83 }
84 return err
85 },
86 }
87
88 f := cmd.Flags()
89 addDependencySubcommandFlags(f, client)
90
91 return cmd
92}
93
94// defaultKeyring returns the expanded path to the default keyring.
95func defaultKeyring() string {

Callers 1

newDependencyCmdFunction · 0.85

Calls 7

BuildMethod · 0.95
ErrorMethod · 0.95
NewDependencyFunction · 0.92
MaximumNArgsFunction · 0.92
AllFunction · 0.92
newRegistryClientFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…