@@ -41,7 +41,7 @@ If no lock file is found, 'helm dependency build' will mirror the behavior
41
41
of 'helm dependency update'.
42
42
`
43
43
44
- func newDependencyBuildCmd (cfg * action.Configuration , out io.Writer ) * cobra.Command {
44
+ func newDependencyBuildCmd (_ * action.Configuration , out io.Writer ) * cobra.Command {
45
45
client := action .NewDependency ()
46
46
47
47
cmd := & cobra.Command {
@@ -54,21 +54,27 @@ func newDependencyBuildCmd(cfg *action.Configuration, out io.Writer) *cobra.Comm
54
54
if len (args ) > 0 {
55
55
chartpath = filepath .Clean (args [0 ])
56
56
}
57
+ registryClient , err := newRegistryClient (client .CertFile , client .KeyFile , client .CAFile ,
58
+ client .InsecureSkipTLSverify , client .PlainHTTP , client .Username , client .Password )
59
+ if err != nil {
60
+ return fmt .Errorf ("missing registry client: %w" , err )
61
+ }
62
+
57
63
man := & downloader.Manager {
58
64
Out : out ,
59
65
ChartPath : chartpath ,
60
66
Keyring : client .Keyring ,
61
67
SkipUpdate : client .SkipRefresh ,
62
68
Getters : getter .All (settings ),
63
- RegistryClient : cfg . RegistryClient ,
69
+ RegistryClient : registryClient ,
64
70
RepositoryConfig : settings .RepositoryConfig ,
65
71
RepositoryCache : settings .RepositoryCache ,
66
72
Debug : settings .Debug ,
67
73
}
68
74
if client .Verify {
69
75
man .Verify = downloader .VerifyIfPossible
70
76
}
71
- err : = man .Build ()
77
+ err = man .Build ()
72
78
if e , ok := err .(downloader.ErrRepoNotFound ); ok {
73
79
return fmt .Errorf ("%s. Please add the missing repos via 'helm repo add'" , e .Error ())
74
80
}
@@ -77,9 +83,7 @@ func newDependencyBuildCmd(cfg *action.Configuration, out io.Writer) *cobra.Comm
77
83
}
78
84
79
85
f := cmd .Flags ()
80
- f .BoolVar (& client .Verify , "verify" , false , "verify the packages against signatures" )
81
- f .StringVar (& client .Keyring , "keyring" , defaultKeyring (), "keyring containing public keys" )
82
- f .BoolVar (& client .SkipRefresh , "skip-refresh" , false , "do not refresh the local repository cache" )
86
+ addDependencySubcommandFlags (f , client )
83
87
84
88
return cmd
85
89
}
0 commit comments