Showing 1,820 of 1,820 total issues
Method Scheduler.updateTask
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Scheduler) updateTask(ctx context.Context, t *api.Task) bool {
// Ignore all tasks that have not reached PENDING
// state.
if t.Status.State < api.TaskStatePending {
return false
Method Server.ListClusters
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) ListClusters(ctx context.Context, request *api.ListClustersRequest) (*api.ListClustersResponse, error) {
var (
clusters []*api.Cluster
err error
)
Function validateRestartPolicy
has 6 return statements (exceeds 4 allowed). Open
Open
func validateRestartPolicy(rp *api.RestartPolicy) error {
if rp == nil {
return nil
}
Method Server.validateNetworkSpec
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) validateNetworkSpec(spec *api.NetworkSpec) error {
if spec == nil {
return status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
}
Method Server.CreateNetwork
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) CreateNetwork(ctx context.Context, request *api.CreateNetworkRequest) (*api.CreateNetworkResponse, error) {
if err := s.validateNetworkSpec(request.Spec); err != nil {
return nil, err
}
Method Server.ListNetworks
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) ListNetworks(ctx context.Context, request *api.ListNetworksRequest) (*api.ListNetworksResponse, error) {
var (
networks []*api.Network
err error
)
Function validateUpdate
has 6 return statements (exceeds 4 allowed). Open
Open
func validateUpdate(uc *api.UpdateConfig) error {
if uc == nil {
return nil
}
Method assignmentSet.secret
has 6 return statements (exceeds 4 allowed). Open
Open
func (a *assignmentSet) secret(readTx store.ReadTx, task *api.Task, secretID string) (*api.Secret, bool, error) {
secret := store.GetSecret(readTx, secretID)
if secret == nil {
return nil, false, fmt.Errorf("secret not found")
}
Method Scheduler.applySchedulingDecisions
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Scheduler) applySchedulingDecisions(ctx context.Context, schedulingDecisions map[string]schedulingDecision) (successful, failed []schedulingDecision) {
// applySchedulingDecisions is the only place where we make store
// transactions in the scheduler. the scheduler is responsible for freeing
// volumes that are no longer in use. this means that volumes should be
// freed in this function. sometimes, there are no scheduling decisions to
Function validateGenericRuntimeSpec
has 6 return statements (exceeds 4 allowed). Open
Open
func validateGenericRuntimeSpec(taskSpec api.TaskSpec) error {
generic := taskSpec.GetGeneric()
if len(generic.Kind) < 3 {
return status.Errorf(codes.InvalidArgument, "Generic runtime: Invalid name %q", generic.Kind)
Method Server.RemoveNetwork
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) RemoveNetwork(ctx context.Context, request *api.RemoveNetworkRequest) (*api.RemoveNetworkResponse, error) {
if request.NetworkID == "" {
return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
}
Method Server.RemoveVolume
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) RemoveVolume(ctx context.Context, request *api.RemoveVolumeRequest) (*api.RemoveVolumeResponse, error) {
err := s.store.Update(func(tx store.Tx) error {
volume := store.GetVolume(tx, request.VolumeID)
if volume == nil {
return status.Errorf(codes.NotFound, "volume %s not found", request.VolumeID)
Method Server.RemoveConfig
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) RemoveConfig(ctx context.Context, request *api.RemoveConfigRequest) (*api.RemoveConfigResponse, error) {
if request.ConfigID == "" {
return nil, status.Errorf(codes.InvalidArgument, "config ID must be provided")
}
Method plugin.init
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *plugin) init(ctx context.Context) error {
probe, err := p.idClient.Probe(ctx, &csi.ProbeRequest{})
if err != nil {
return err
}
Method roleManager.reconcileRole
has 6 return statements (exceeds 4 allowed). Open
Open
func (rm *roleManager) reconcileRole(ctx context.Context, node *api.Node) {
if node.Role == node.Spec.DesiredRole {
// Nothing to do.
delete(rm.pendingReconciliation, node.ID)
return
Method volumeSet.checkVolume
has 6 return statements (exceeds 4 allowed). Open
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 {
Method Server.RemoveSecret
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) RemoveSecret(ctx context.Context, request *api.RemoveSecretRequest) (*api.RemoveSecretResponse, error) {
if request.SecretID == "" {
return nil, status.Errorf(codes.InvalidArgument, "secret ID must be provided")
}
Method Deallocator.Run
has 6 return statements (exceeds 4 allowed). Open
Open
func (deallocator *Deallocator) Run(ctx context.Context) error {
var (
allServices []*api.Service
allNetworks []*api.Network
)
Method Server.UpdateSecret
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) UpdateSecret(ctx context.Context, request *api.UpdateSecretRequest) (*api.UpdateSecretResponse, error) {
if request.SecretID == "" || request.SecretVersion == nil {
return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
}
var secret *api.Secret
Function validateSecretRefsSpec
has 6 return statements (exceeds 4 allowed). Open
Open
func validateSecretRefsSpec(spec api.TaskSpec) error {
container := spec.GetContainer()
if container == nil {
return nil
}