dotcloud/docker

View on GitHub

Showing 1,468 of 1,914 total issues

Function RepoTagReference has 6 return statements (exceeds 4 allowed).
Open

func RepoTagReference(repo, tag string) (reference.NamedTagged, error) {
    if repo == "" {
        return nil, nil
    }

Severity: Major
Found in api/server/httputils/form.go - About 40 mins to fix

    Method containerRouter.postCommit has 6 return statements (exceeds 4 allowed).
    Open

    func (c *containerRouter) postCommit(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
        if err := httputils.ParseForm(r); err != nil {
            return err
        }
    
    
    Severity: Major
    Found in api/server/router/container/container_routes.go - About 40 mins to fix

      Function FromError has 6 return statements (exceeds 4 allowed).
      Open

      func FromError(err error) int {
          if err == nil {
              log.G(context.TODO()).WithError(err).Error("unexpected HTTP error handling")
              return http.StatusInternalServerError
          }
      Severity: Major
      Found in api/server/httpstatus/status.go - About 40 mins to fix

        Method executor.Controller has 6 return statements (exceeds 4 allowed).
        Open

        func (e *executor) Controller(t *api.Task) (exec.Controller, error) {
            dependencyGetter := template.NewTemplatedDependencyGetter(agent.Restrict(e.dependencies, t), t, nil)
        
            // Get the node description from the executor field
            e.mutex.Lock()
        Severity: Major
        Found in daemon/cluster/executor/container/executor.go - About 40 mins to fix

          Method containerAdapter.pullImage has 6 return statements (exceeds 4 allowed).
          Open

          func (c *containerAdapter) pullImage(ctx context.Context) error {
              spec := c.container.spec()
          
              // Skip pulling if the image is referenced by image ID.
              if _, err := digest.Parse(spec.Image); err == nil {
          Severity: Major
          Found in daemon/cluster/executor/container/adapter.go - About 40 mins to fix

            Function validateMounts has 6 return statements (exceeds 4 allowed).
            Open

            func validateMounts(mounts []api.Mount) error {
                for _, mount := range mounts {
                    // Target must always be absolute
                    // except if target is Windows named pipe
                    if !filepath.IsAbs(mount.Target) && mount.Type != api.MountTypeNamedPipe {
            Severity: Major
            Found in daemon/cluster/executor/container/validate.go - About 40 mins to fix

              Method Cluster.GetServices has 6 return statements (exceeds 4 allowed).
              Open

              func (c *Cluster) GetServices(options types.ServiceListOptions) ([]swarm.Service, error) {
                  c.mu.RLock()
                  defer c.mu.RUnlock()
              
                  state := c.currentNodeState()
              Severity: Major
              Found in daemon/cluster/services.go - About 40 mins to fix

                Method Controller.Prepare has 6 return statements (exceeds 4 allowed).
                Open

                func (p *Controller) Prepare(ctx context.Context) (err error) {
                    p.logger.Debug("Prepare")
                
                    remote, err := reference.ParseNormalizedNamed(p.spec.Remote)
                    if err != nil {
                Severity: Major
                Found in daemon/cluster/controllers/plugin/controller.go - About 40 mins to fix

                  Method ImageService.walkReachableImageManifests has 6 return statements (exceeds 4 allowed).
                  Open

                  func (i *ImageService) walkReachableImageManifests(ctx context.Context, img containerdimages.Image, handler func(img *ImageManifest) error) error {
                      desc := img.Target
                  
                      handleManifest := func(ctx context.Context, d ocispec.Descriptor) error {
                          platformImg, err := i.NewImageManifest(ctx, img, d)
                  Severity: Major
                  Found in daemon/containerd/image_manifest.go - About 40 mins to fix

                    Function writeContentsForImage has 6 return statements (exceeds 4 allowed).
                    Open

                    func writeContentsForImage(ctx context.Context, snName string, cs content.Store,
                        newConfig imagespec.DockerOCIImage, layers []ocispec.Descriptor,
                        containerConfig container.Config,
                    ) (
                        manifestDesc ocispec.Descriptor,
                    Severity: Major
                    Found in daemon/containerd/image_builder.go - About 40 mins to fix

                      Method ImageService.imageDeleteHelper has 6 return statements (exceeds 4 allowed).
                      Open

                      func (i *ImageService) imageDeleteHelper(ctx context.Context, img images.Image, all []images.Image, records *[]imagetypes.DeleteResponse, extra conflictType) error {
                          // First, determine if this image has any conflicts. Ignore soft conflicts
                          // if force is true.
                          c := conflictHard | extra
                      
                      
                      Severity: Major
                      Found in daemon/containerd/image_delete.go - About 40 mins to fix

                        Method ImageService.checkImageDeleteConflict has 6 return statements (exceeds 4 allowed).
                        Open

                        func (i *ImageService) checkImageDeleteConflict(ctx context.Context, imgID image.ID, all []images.Image, mask conflictType) error {
                            if mask&conflictRunningContainer != 0 {
                                running := func(c *container.Container) bool {
                                    return c.ImageID == imgID && c.IsRunning()
                                }
                        Severity: Major
                        Found in daemon/containerd/image_delete.go - About 40 mins to fix

                          Method ImageService.unleaseSnapshotsFromDeletedConfigs has 6 return statements (exceeds 4 allowed).
                          Open

                          func (i *ImageService) unleaseSnapshotsFromDeletedConfigs(ctx context.Context, possiblyDeletedConfigs map[digest.Digest]struct{}) error {
                              all, err := i.images.List(ctx)
                              if err != nil {
                                  return errors.Wrap(err, "failed to list images during snapshot lease removal")
                              }
                          Severity: Major
                          Found in daemon/containerd/image_prune.go - About 40 mins to fix

                            Method ImageService.applyDiffLayer has 6 return statements (exceeds 4 allowed).
                            Open

                            func (i *ImageService) applyDiffLayer(ctx context.Context, name string, containerID string, sn snapshots.Snapshotter, differ diff.Applier, diffDesc ocispec.Descriptor) (retErr error) {
                                // Let containerd know that this snapshot is only for diff-applying.
                                key := snapshots.UnpackKeyPrefix + "-" + uniquePart() + "-" + name
                            
                                info, err := sn.Stat(ctx, containerID)
                            Severity: Major
                            Found in daemon/containerd/image_commit.go - About 40 mins to fix

                              Method ImageService.createImageOCI has 6 return statements (exceeds 4 allowed).
                              Open

                              func (i *ImageService) createImageOCI(ctx context.Context, imgToCreate imagespec.DockerOCIImage,
                                  parentDigest digest.Digest, layers []ocispec.Descriptor,
                                  containerConfig container.Config,
                              ) (dimage.ID, error) {
                                  // Necessary to prevent the contents from being GC'd
                              Severity: Major
                              Found in daemon/containerd/image_builder.go - About 40 mins to fix

                                Method ImageService.walkImageManifests has 6 return statements (exceeds 4 allowed).
                                Open

                                func (i *ImageService) walkImageManifests(ctx context.Context, img containerdimages.Image, handler func(img *ImageManifest) error) error {
                                    desc := img.Target
                                
                                    handleManifest := func(ctx context.Context, d ocispec.Descriptor) error {
                                        platformImg, err := i.NewImageManifest(ctx, img, d)
                                Severity: Major
                                Found in daemon/containerd/image_manifest.go - About 40 mins to fix

                                  Method containerAdapter.create has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (c *containerAdapter) create(ctx context.Context) error {
                                      hostConfig := c.container.hostConfig(c.dependencies.Volumes())
                                      netConfig := c.container.createNetworkingConfig(c.backend)
                                  
                                      // We need to make sure no empty string or "default" NetworkMode is
                                  Severity: Major
                                  Found in daemon/cluster/executor/container/adapter.go - About 40 mins to fix

                                    Method Cluster.resolveAdvertiseAddr has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func (c *Cluster) resolveAdvertiseAddr(advertiseAddr, listenAddrPort string) (string, string, error) {
                                        // Approach:
                                        // - If an advertise address is specified, use that. Resolve the
                                        //   interface's address if an interface was specified in
                                        //   advertiseAddr. Fill in the port from listenAddrPort if necessary.
                                    Severity: Major
                                    Found in daemon/cluster/listen_addr.go - About 40 mins to fix

                                      Function newAWSLogsClient has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func newAWSLogsClient(info logger.Info, configOpts ...func(*config.LoadOptions) error) (*cloudwatchlogs.Client, error) {
                                          ctx := context.TODO()
                                          var region, endpoint *string
                                          if os.Getenv(regionEnvKey) != "" {
                                              region = aws.String(os.Getenv(regionEnvKey))
                                      Severity: Major
                                      Found in daemon/logger/awslogs/cloudwatchlogs.go - About 40 mins to fix

                                        Method Daemon.getExecConfig has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func (daemon *Daemon) getExecConfig(name string) (*container.ExecConfig, error) {
                                            ec := daemon.execCommands.Get(name)
                                            if ec == nil {
                                                return nil, errExecNotFound(name)
                                            }
                                        Severity: Major
                                        Found in daemon/exec.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language