MCPcopy
hub / github.com/helm/helm / newInstallerForSource

Method newInstallerForSource

pkg/cmd/plugin_install.go:104–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102}
103
104func (o *pluginInstallOptions) newInstallerForSource() (installer.Installer, error) {
105 // Check if source is an OCI registry reference
106 if strings.HasPrefix(o.source, registry.OCIScheme+"://") {
107 // Build getter options for OCI
108 options := []getter.Option{
109 getter.WithTLSClientConfig(o.certFile, o.keyFile, o.caFile),
110 getter.WithInsecureSkipVerifyTLS(o.insecureSkipTLSVerify),
111 getter.WithPlainHTTP(o.plainHTTP),
112 getter.WithBasicAuth(o.username, o.password),
113 }
114
115 return installer.NewOCIInstaller(o.source, options...)
116 }
117
118 // For non-OCI sources, use the original logic
119 return installer.NewForSource(o.source, o.version)
120}
121
122func (o *pluginInstallOptions) run(out io.Writer) error {
123 i, err := o.newInstallerForSource()

Callers 1

runMethod · 0.95

Calls 6

WithTLSClientConfigFunction · 0.92
WithPlainHTTPFunction · 0.92
WithBasicAuthFunction · 0.92
NewOCIInstallerFunction · 0.92
NewForSourceFunction · 0.92

Tested by

no test coverage detected