Skip to content

Confusing file and package naming in operator/controllers/reconcilers #6627

@jtayl222

Description

@jtayl222

Hello Seldon Core team,

I've identified a confusing code structure in the operator's reconcilers that could be clarified.

Specifically:

  1. There are two directories, seldon and server, that both contain Go files belonging to package server.
  2. Both directories contain a file named service_reconciler.go, and they are different implementations.
  • operator/controllers/reconcilers/seldon/service_reconciler.go (package server)
  • operator/controllers/reconcilers/server/service_reconciler.go (package server)

This is unconventional and makes the code harder to navigate. Go convention dictates that the package name should match the directory name. The current structure, with two different files having the same name in the same package (but different directories), is a source of confusion.

It appears the reconcilers in the seldon directory manage the Seldon control plane components, while the ones in the server directory manage the user's model server deployments.

To improve clarity and adhere to Go conventions, I suggest refactoring this. For example, the package in operator/controllers/reconcilers/seldon/ could be renamed to seldon to match its directory, which would resolve the ambiguity.

This would make the controller logic much easier to understand and maintain.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions