cloudfoundry-incubator/eirini

View on GitHub

Showing 28 of 59 total issues

Method AdoptPDB.Apply has 5 return statements (exceeds 4 allowed).
Open

func (m AdoptPDB) Apply(ctx context.Context, obj runtime.Object) error {
    stSet, ok := obj.(*appsv1.StatefulSet)
    if !ok {
        return fmt.Errorf("expected *v1.StatefulSet, got: %T", obj)
    }
Severity: Major
Found in migrations/adopt_pdb.go - About 35 mins to fix

    Function do has 5 return statements (exceeds 4 allowed).
    Open

    func do(ctx context.Context, client *http.Client, method string, uri string, body interface{}) error {
        bodyJSON, err := json.Marshal(body)
        if err != nil {
            return errors.Wrap(err, "cannot marshal body")
        }
    Severity: Major
    Found in k8s/utils/http.go - About 35 mins to fix

      Method Executor.migrateObjects has 5 return statements (exceeds 4 allowed).
      Open

      func (e *Executor) migrateObjects(ctx context.Context, logger lager.Logger, objects []runtime.Object, objectType ObjectType, setAnnotationFn func(context.Context, runtime.Object, int) error) error {
          logger.Info("start")
          defer logger.Info("end")
      
          for i := range objects {
      Severity: Major
      Found in migrations/executor.go - About 35 mins to fix

        Method Desirer.Desire has 5 return statements (exceeds 4 allowed).
        Open

        func (d *Desirer) Desire(ctx context.Context, namespace string, task *api.Task, opts ...shared.Option) error {
            logger := d.logger.Session("desire-task", lager.Data{"guid": task.GUID, "name": task.Name, "namespace": namespace})
        
            var (
                err                   error
        Severity: Major
        Found in k8s/jobs/desire.go - About 35 mins to fix

          Method Getter.GetInstances has 5 return statements (exceeds 4 allowed).
          Open

          func (g *Getter) GetInstances(ctx context.Context, identifier api.LRPIdentifier) ([]*api.Instance, error) {
              logger := g.logger.Session("get-instance", lager.Data{"guid": identifier.GUID, "version": identifier.Version})
              if _, err := g.getLRP(ctx, logger, identifier); errors.Is(err, eirini.ErrNotFound) {
                  return nil, err
              }
          Severity: Major
          Found in k8s/stset/get.go - About 35 mins to fix

            Method Updater.update has 5 return statements (exceeds 4 allowed).
            Open

            func (u *Updater) update(ctx context.Context, lrp *api.LRP) error {
                logger := u.logger.Session("update", lager.Data{"guid": lrp.GUID, "version": lrp.Version})
            
                statefulSet, err := u.getStatefulSet(ctx, api.LRPIdentifier{GUID: lrp.GUID, Version: lrp.Version})
                if err != nil {
            Severity: Major
            Found in k8s/stset/update.go - About 35 mins to fix

              Method Executor.Migrate has 5 return statements (exceeds 4 allowed).
              Open

              func (e *Executor) Migrate(ctx context.Context, logger lager.Logger) error {
                  logger.Info("migration-start")
                  defer logger.Info("migration-end")
              
                  if err := e.verifySequenceIDs(); err != nil {
              Severity: Major
              Found in migrations/executor.go - About 35 mins to fix

                Method InstanceIndexEnvInjector.Handle has 5 return statements (exceeds 4 allowed).
                Open

                func (i *InstanceIndexEnvInjector) Handle(ctx context.Context, req admission.Request) admission.Response {
                    logger := i.logger.Session("handle-webhook-request")
                
                    if req.Operation != admissionv1.Create {
                        return admission.Allowed("pod was already created")
                Severity: Major
                Found in k8s/webhook/instance_index_injector.go - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language