docker/swarmkit

View on GitHub
manager/scheduler/volumes.go

Summary

Maintainability
A
1 hr
Test Coverage

Method volumeSet.checkVolume has 6 return statements (exceeds 4 allowed).
Open

func (vs *volumeSet) checkVolume(id string, info *NodeInfo, readOnly bool) bool {
    vi := vs.volumes[id]
    // first, check if the volume's availability is even Active. If not. no
    // reason to bother with anything further.
    if vi.volume != nil && vi.volume.Spec.Availability != api.VolumeAvailabilityActive {
Severity: Major
Found in manager/scheduler/volumes.go - About 40 mins to fix

    Method volumeSet.freeVolumes has 5 return statements (exceeds 4 allowed).
    Open

    func (vs *volumeSet) freeVolumes(batch *store.Batch) error {
        for volumeID, info := range vs.volumes {
            if err := batch.Update(func(tx store.Tx) error {
                v := store.GetVolume(tx, volumeID)
                if v == nil {
    Severity: Major
    Found in manager/scheduler/volumes.go - About 35 mins to fix

      Method volumeSet.isVolumeAvailableOnNode has 5 return statements (exceeds 4 allowed).
      Open

      func (vs *volumeSet) isVolumeAvailableOnNode(mount *api.Mount, node *NodeInfo) string {
          source := mount.Source
          // first, discern whether we're looking for a group or a volume
          // try trimming off the "group:" prefix. if the resulting string is
          // different from the input string (meaning something has been trimmed),
      Severity: Major
      Found in manager/scheduler/volumes.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status