dotcloud/docker

View on GitHub

Showing 1,904 of 1,904 total issues

Method Endpoint.addServiceInfoToCluster has 8 return statements (exceeds 4 allowed).
Open

func (ep *Endpoint) addServiceInfoToCluster(sb *Sandbox) error {
    if len(ep.dnsNames) == 0 || ep.Iface() == nil || ep.Iface().Address() == nil {
        return nil
    }

Severity: Major
Found in libnetwork/agent.go - About 50 mins to fix

    Method NetworkDB.handleNodeEvent has 8 return statements (exceeds 4 allowed).
    Open

    func (nDB *NetworkDB) handleNodeEvent(nEvent *NodeEvent) bool {
        // Update our local clock if the received messages has newer
        // time.
        nDB.networkClock.Witness(nEvent.LTime)
    
    
    Severity: Major
    Found in libnetwork/networkdb/delegate.go - About 50 mins to fix

      Method driver.CreateEndpoint has 8 return statements (exceeds 4 allowed).
      Open

      func (d *driver) CreateEndpoint(_ context.Context, nid, eid string, ifInfo driverapi.InterfaceInfo, epOptions map[string]interface{}) (retErr error) {
          if ifInfo == nil {
              return errors.New("must not be called with nil InterfaceInfo")
          }
      
      
      Severity: Major
      Found in libnetwork/drivers/remote/driver.go - About 50 mins to fix

        Method driver.Join has 8 return statements (exceeds 4 allowed).
        Open

        func (d *driver) Join(ctx context.Context, nid, eid string, sboxKey string, jinfo driverapi.JoinInfo, options map[string]interface{}) error {
            ctx, span := otel.Tracer("").Start(ctx, "libnetwork.drivers.bridge.Join", trace.WithAttributes(
                attribute.String("nid", nid),
                attribute.String("eid", eid),
                attribute.String("sboxKey", sboxKey)))
        Severity: Major
        Found in libnetwork/drivers/bridge/bridge_linux.go - About 50 mins to fix

          Function cmpPortBinding has 8 return statements (exceeds 4 allowed).
          Open

          func cmpPortBinding(a, b types.PortBinding) int {
              // Exact host port < host port range.
              aIsRange := a.HostPort == 0 || a.HostPort != a.HostPortEnd
              bIsRange := b.HostPort == 0 || b.HostPort != b.HostPortEnd
              if aIsRange != bIsRange {
          Severity: Major
          Found in libnetwork/drivers/bridge/port_mapping_linux.go - About 50 mins to fix

            Method driver.CreateNetwork has 8 return statements (exceeds 4 allowed).
            Open

            func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
                if len(ipV4Data) == 0 || ipV4Data[0].Pool.String() == "0.0.0.0/0" {
                    return types.InvalidParameterErrorf("ipv4 pool is empty")
                }
                // Sanity checks
            Severity: Major
            Found in libnetwork/drivers/bridge/bridge_linux.go - About 50 mins to fix

              Method driver.ProgramExternalConnectivity has 8 return statements (exceeds 4 allowed).
              Open

              func (d *driver) ProgramExternalConnectivity(ctx context.Context, nid, eid string, options map[string]interface{}) error {
                  ctx, span := otel.Tracer("").Start(ctx, "libnetwork.drivers.bridge.ProgramExternalConnectivity", trace.WithAttributes(
                      attribute.String("nid", nid),
                      attribute.String("eid", eid)))
                  defer span.End()
              Severity: Major
              Found in libnetwork/drivers/bridge/bridge_linux.go - About 50 mins to fix

                Method driver.CreateNetwork has 8 return statements (exceeds 4 allowed).
                Open

                func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
                    var (
                        networkName   string
                        interfaceName string
                        staleNetworks []string
                Severity: Major
                Found in libnetwork/drivers/windows/overlay/ov_network_windows.go - About 50 mins to fix

                  Method cnmNetworkAllocator.allocateVIP has 8 return statements (exceeds 4 allowed).
                  Open

                  func (na *cnmNetworkAllocator) allocateVIP(vip *api.Endpoint_VirtualIP) error {
                      var opts map[string]string
                      localNet := na.getNetwork(vip.NetworkID)
                      if localNet == nil {
                          return errors.New("networkallocator: could not find local network state")
                  Severity: Major
                  Found in libnetwork/cnmallocator/networkallocator.go - About 50 mins to fix

                    Method driver.EventNotify has 8 return statements (exceeds 4 allowed).
                    Open

                    func (d *driver) EventNotify(etype driverapi.EventType, nid, tableName, key string, value []byte) {
                        if tableName != ovPeerTable {
                            log.G(context.TODO()).Errorf("Unexpected table notification for table %s received", tableName)
                            return
                        }
                    Severity: Major
                    Found in libnetwork/drivers/windows/overlay/joinleave_windows.go - About 50 mins to fix

                      Method Client.doRequest has 8 return statements (exceeds 4 allowed).
                      Open

                      func (cli *Client) doRequest(req *http.Request) (serverResponse, error) {
                          serverResp := serverResponse{statusCode: -1, reqURL: req.URL}
                      
                          resp, err := cli.client.Do(req)
                          if err != nil {
                      Severity: Major
                      Found in client/request.go - About 50 mins to fix

                        Method cnmNetworkAllocator.IsAttachmentAllocated has 8 return statements (exceeds 4 allowed).
                        Open

                        func (na *cnmNetworkAllocator) IsAttachmentAllocated(node *api.Node, networkAttachment *api.NetworkAttachment) bool {
                            if node == nil {
                                return false
                            }
                        
                        
                        Severity: Major
                        Found in libnetwork/cnmallocator/networkallocator.go - About 50 mins to fix

                          Method Client.imageBuildOptionsToQuery has 8 return statements (exceeds 4 allowed).
                          Open

                          func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.ImageBuildOptions) (url.Values, error) {
                              query := url.Values{
                                  "t":           options.Tags,
                                  "securityopt": options.SecurityOpt,
                                  "extrahosts":  options.ExtraHosts,
                          Severity: Major
                          Found in client/image_build.go - About 50 mins to fix

                            Method Root.validateOpts has 8 return statements (exceeds 4 allowed).
                            Open

                            func (r *Root) validateOpts(opts map[string]string) error {
                                if len(opts) == 0 {
                                    return nil
                                }
                                for opt := range opts {
                            Severity: Major
                            Found in volume/local/local_unix.go - About 50 mins to fix

                              Method Builder.performCopy has 8 return statements (exceeds 4 allowed).
                              Open

                              func (b *Builder) performCopy(ctx context.Context, req dispatchRequest, inst copyInstruction) error {
                                  state := req.state
                                  srcHash := getSourceHashFromInfos(inst.infos)
                              
                                  var chownComment string
                              Severity: Major
                              Found in builder/dockerfile/internals.go - About 50 mins to fix

                                Function handleMACAddressBC has 8 return statements (exceeds 4 allowed).
                                Open

                                func handleMACAddressBC(config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, version string) (string, error) {
                                    deprecatedMacAddress := config.MacAddress //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.44.
                                
                                    // For older versions of the API, migrate the container-wide MAC address to EndpointsConfig.
                                    if versions.LessThan(version, "1.44") {
                                Severity: Major
                                Found in api/server/router/container/container_routes.go - About 50 mins to fix

                                  Method Config.CopyStreams has 8 return statements (exceeds 4 allowed).
                                  Open

                                  func (c *Config) CopyStreams(ctx context.Context, cfg *AttachConfig) <-chan error {
                                      var group errgroup.Group
                                  
                                      // Connect stdin of container to the attach stdin stream.
                                      if cfg.Stdin != nil {
                                  Severity: Major
                                  Found in container/stream/attach.go - About 50 mins to fix

                                    Method Builder.dispatchDockerfileWithCancellation has 8 return statements (exceeds 4 allowed).
                                    Open

                                    func (b *Builder) dispatchDockerfileWithCancellation(ctx context.Context, parseResult []instructions.Stage, metaArgs []instructions.ArgCommand, escapeToken rune, source builder.Source) (*dispatchState, error) {
                                        dispatchRequest := dispatchRequest{}
                                        buildArgs := NewBuildArgs(b.options.BuildArgs)
                                        totalCommands := len(metaArgs) + len(parseResult)
                                        currentCommandIndex := 1
                                    Severity: Major
                                    Found in builder/dockerfile/builder.go - About 50 mins to fix

                                      Function ReplaceContainer has 8 return statements (exceeds 4 allowed).
                                      Open

                                      func ReplaceContainer(ctx context.Context, client types.Client, id string, spec *specs.Spec, shim string, runtimeOptions interface{}, opts ...containerd.NewContainerOpts) (types.Container, error) {
                                          newContainer := func() (types.Container, error) {
                                              return client.NewContainer(ctx, id, spec, shim, runtimeOptions, opts...)
                                          }
                                          ctr, err := newContainer()
                                      Severity: Major
                                      Found in libcontainerd/replace.go - About 50 mins to fix

                                        Method ImageService.ImportImage has 8 return statements (exceeds 4 allowed).
                                        Open

                                        func (i *ImageService) ImportImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error) {
                                            refString := ""
                                            if ref != nil {
                                                refString = ref.String()
                                            }
                                        Severity: Major
                                        Found in daemon/containerd/image_import.go - About 50 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language