Showing 28 of 59 total issues
Method AdoptPDB.Apply
has 5 return statements (exceeds 4 allowed). Open
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)
}
Function do
has 5 return statements (exceeds 4 allowed). Open
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")
}
Method Executor.migrateObjects
has 5 return statements (exceeds 4 allowed). Open
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 {
Method Desirer.Desire
has 5 return statements (exceeds 4 allowed). Open
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
Method Getter.GetInstances
has 5 return statements (exceeds 4 allowed). Open
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
}
Method Updater.update
has 5 return statements (exceeds 4 allowed). Open
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 {
Method Executor.Migrate
has 5 return statements (exceeds 4 allowed). Open
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 {
Method InstanceIndexEnvInjector.Handle
has 5 return statements (exceeds 4 allowed). Open
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")