|
|
|
@ -33,8 +33,6 @@ This will store the chart in the local registry cache to be used later.
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
func newChartPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
|
|
|
var insecureOpt, plainHTTPOpt bool
|
|
|
|
|
var caFile, certFile, keyFile string
|
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
|
Use: "pull [ref]",
|
|
|
|
|
Short: "pull a chart from remote",
|
|
|
|
@ -43,30 +41,12 @@ func newChartPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|
|
|
|
Hidden: !FeatureGateOCI.IsEnabled(),
|
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
|
ref := args[0]
|
|
|
|
|
registryClient, err := registry.NewClient(
|
|
|
|
|
registry.ClientOptDebug(settings.Debug),
|
|
|
|
|
registry.ClientOptWriter(out),
|
|
|
|
|
registry.ClientOptCredentialsFile(settings.RegistryConfig),
|
|
|
|
|
registry.ClientOptPlainHTTP(plainHTTPOpt),
|
|
|
|
|
registry.ClientOptInsecureSkipVerifyTLS(insecureOpt),
|
|
|
|
|
registry.ClientOptCAFile(caFile),
|
|
|
|
|
registry.ClientOptCertKeyFiles(certFile, keyFile),
|
|
|
|
|
)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cfg.RegistryClient = registryClient
|
|
|
|
|
return action.NewChartPull(cfg).Run(out, ref)
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
f := cmd.Flags()
|
|
|
|
|
f.BoolVarP(&insecureOpt, "insecure-skip-tls-verify", "", false, "skip registry tls certificate checks")
|
|
|
|
|
f.BoolVarP(&plainHTTPOpt, "plain-http", "", false, "use plain http to connect to the registry instead of https")
|
|
|
|
|
f.StringVar(&certFile, "cert-file", "", "identify HTTPS client using this SSL certificate file")
|
|
|
|
|
f.StringVar(&keyFile, "key-file", "", "identify HTTPS client using this SSL key file")
|
|
|
|
|
f.StringVar(&caFile, "ca-file", "", "verify certificates of HTTPS-enabled registry using this CA bundle")
|
|
|
|
|
registry.AddRegistryCmdFlags(f)
|
|
|
|
|
|
|
|
|
|
return cmd
|
|
|
|
|
}
|
|
|
|
|