Merge pull request #31395 from wyrapeseed/main

chore: fix some comment format
pull/31412/head
Matt Farina 11 months ago committed by GitHub
commit b0247ce8bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -85,10 +85,10 @@ func NewExtractor(source string) (Extractor, error) {
// //
// - The character `:` is considered illegal because it is a separator on UNIX and a // - The character `:` is considered illegal because it is a separator on UNIX and a
// drive designator on Windows. // drive designator on Windows.
// - The path component `..` is considered suspicions, and therefore illegal // - The path component `..` is considered suspicious, and therefore illegal
// - The character \ (backslash) is treated as a path separator and is converted to /. // - The character \ (backslash) is treated as a path separator and is converted to /.
// - Beginning a path with a path separator is illegal // - Beginning a path with a path separator is illegal
// - Rudimentary symlink protects are offered by SecureJoin. // - Rudimentary symlink protections are offered by SecureJoin.
func cleanJoin(root, dest string) (string, error) { func cleanJoin(root, dest string) (string, error) {
// On Windows, this is a drive separator. On UNIX-like, this is the path list separator. // On Windows, this is a drive separator. On UNIX-like, this is the path list separator.

@ -71,7 +71,7 @@ func TestSubprocessPluginRuntime(t *testing.T) {
output, err := p.Invoke(t.Context(), &Input{ output, err := p.Invoke(t.Context(), &Input{
Message: schema.InputMessageCLIV1{ Message: schema.InputMessageCLIV1{
ExtraArgs: []string{"arg1", "arg2"}, ExtraArgs: []string{"arg1", "arg2"},
//Env: []string{"FOO=bar"}, // Env: []string{"FOO=bar"},
}, },
}) })

@ -70,7 +70,7 @@ func symwalk(path string, info os.FileInfo, walkFn filepath.WalkFunc) error {
if err != nil { if err != nil {
return fmt.Errorf("error evaluating symlink %s: %w", path, err) return fmt.Errorf("error evaluating symlink %s: %w", path, err)
} }
//This log message is to highlight a symlink that is being used within a chart, symlinks can be used for nefarious reasons. // This log message is to highlight a symlink that is being used within a chart, symlinks can be used for nefarious reasons.
slog.Info("found symbolic link in path. Contents of linked file included and used", "path", path, "resolved", resolved) slog.Info("found symbolic link in path. Contents of linked file included and used", "path", path, "resolved", resolved)
if info, err = os.Lstat(resolved); err != nil { if info, err = os.Lstat(resolved); err != nil {
return err return err

@ -287,7 +287,7 @@ func compListChartsOfRepo(repoName string, prefix string) []string {
if isNotExist(err) { if isNotExist(err) {
// If there is no cached charts file, fallback to the full index file. // If there is no cached charts file, fallback to the full index file.
// This is much slower but can happen after the caching feature is first // This is much slower but can happen after the caching feature is first
// installed but before the user does a 'helm repo update' to generate the // installed but before the user does a 'helm repo update' to generate the
// first cached charts file. // first cached charts file.
path = filepath.Join(settings.RepositoryCache, helmpath.CacheIndexFile(repoName)) path = filepath.Join(settings.RepositoryCache, helmpath.CacheIndexFile(repoName))
if indexFile, err := repo.LoadIndexFile(path); err == nil { if indexFile, err := repo.LoadIndexFile(path); err == nil {

@ -64,7 +64,7 @@ func (f files) Get(name string) string {
} }
// Glob takes a glob pattern and returns another files object only containing // Glob takes a glob pattern and returns another files object only containing
// matched files. // matched files.
// //
// This is designed to be called from a template. // This is designed to be called from a template.
// //

@ -520,11 +520,11 @@ func TestHTTPGetterTarDownload(t *testing.T) {
b := make([]byte, 512) b := make([]byte, 512)
f.Read(b) f.Read(b)
//Get the file size // Get the file size
FileStat, _ := f.Stat() FileStat, _ := f.Stat()
FileSize := strconv.FormatInt(FileStat.Size(), 10) FileSize := strconv.FormatInt(FileStat.Size(), 10)
//Simulating improper header values from bitbucket // Simulating improper header values from bitbucket
w.Header().Set("Content-Type", "application/x-tar") w.Header().Set("Content-Type", "application/x-tar")
w.Header().Set("Content-Encoding", "gzip") w.Header().Set("Content-Encoding", "gzip")
w.Header().Set("Content-Length", FileSize) w.Header().Set("Content-Length", FileSize)

@ -109,7 +109,7 @@ func (g *getterPlugin) Get(href string, options ...Option) (*bytes.Buffer, error
Protocol: u.Scheme, Protocol: u.Scheme,
}, },
// TODO should we pass Stdin, Stdout, and Stderr through Input here to getter plugins? // TODO should we pass Stdin, Stdout, and Stderr through Input here to getter plugins?
//Stdout: os.Stdout, // Stdout: os.Stdout,
} }
output, err := g.plg.Invoke(context.Background(), input) output, err := g.plg.Invoke(context.Background(), input)
if err != nil { if err != nil {

@ -237,7 +237,7 @@ func (t *parser) key(data map[string]interface{}, nestedNameLevel int) (reterr e
_, err = t.emptyVal() _, err = t.emptyVal()
return err return err
} }
//End of key. Consume =, Get value. // End of key. Consume =, Get value.
// FIXME: Get value list first // FIXME: Get value list first
vl, e := t.valList() vl, e := t.valList()
switch e { switch e {

Loading…
Cancel
Save