Skip to content
This repository was archived by the owner on Nov 22, 2020. It is now read-only.
This repository was archived by the owner on Nov 22, 2020. It is now read-only.

RedHatInsights/insights-ocp-controller: vendor/github.com/RedHatInsights/insights-goapi/container/mount.go; 25 LoC #836

Description

@githubvet

Found a possible issue in RedHatInsights/insights-ocp-controller at vendor/github.com/RedHatInsights/insights-goapi/container/mount.go

The below snippet of Go code triggered static analysis which searches for goroutines and/or defer statements
which capture loop variables.

Click here to see the code in its original context.

Click here to show the 26 line(s) of Go which triggered the analyzer.
	for name, auth := range imagePullAuths.Configs {
		parsedErrors := make(chan error, 100)
		defer func() { close(parsedErrors) }()

		go func() {
			reader, writer := io.Pipe()
			defer writer.Close()
			defer reader.Close()
			imagePullOption := docker.PullImageOptions{
				Repository:    i.opts.Image,
				OutputStream:  writer,
				RawJSONStream: true,
			}
			go decodeDockerResponse(parsedErrors, reader)

			if err = client.PullImage(imagePullOption, auth); err != nil {
				parsedErrors <- err
			}
		}()

		if parsedError := <-parsedErrors; parsedError != nil {
			log.Printf("Authentication with %s failed: %v", name, parsedError)
		} else {
			return nil
		}
	}

commit ID: 956e7a892c30bf6184e603f08701544be4b8541a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions