MCPcopy Create free account
hub / github.com/helm/helm / passphraseFileFetcher

Method passphraseFileFetcher

pkg/cmd/plugin_package.go:181–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179}
180
181func (o *pluginPackageOptions) passphraseFileFetcher() (provenance.PassphraseFetcher, error) {
182 file, err := openPassphraseFile(o.passphraseFile, os.Stdin)
183 if err != nil {
184 return nil, err
185 }
186 defer file.Close()
187
188 // Read the entire passphrase
189 passphrase, err := io.ReadAll(file)
190 if err != nil {
191 return nil, err
192 }
193
194 // Trim any trailing newline characters (both \n and \r\n)
195 passphrase = bytes.TrimRight(passphrase, "\r\n")
196
197 return func(_ string) ([]byte, error) {
198 return passphrase, nil
199 }, nil
200}
201
202// copied from action.openPassphraseFile
203// TODO: should we move this to pkg/action so we can reuse the func from there?

Callers 1

runMethod · 0.95

Calls 2

CloseMethod · 0.80
openPassphraseFileFunction · 0.70

Tested by

no test coverage detected