Skip to content

Generated client object is too heavy and causes significant slowdown to IDE #399

Closed
@macsux

Description

@macsux

Autorest generated Kubernetes, IKubernetes, and KubernetesExtensions classes / interfaces put so many operations on to one object that using the current k8s client library causes a significant slowdown of any project where it is added, significantly degrading "full" IDEs like Visual Studio and Rider. Many of the generated methods can be completely eliminated by replacing them with a generics version such as the following: https://github.com/kubernetes-client/csharp/blob/fb8ef4f685215ad4bd5dbe5b91b68d41d3ab0213/src/KubernetesClient/IKubernetes.Generic.cs

Some proposals worth considering
a) eliminate synchronous methods generates in the extensions class (as with modern C# you should not be transitioning from async to sync as a matter of best practice - users can do it themselves if they need to)
b) replace all "standard" resource APIs with generic version (for core objects those that follow CRD conventions - this can include legacy non-group specific objects such as Pod)
c) consider splitting the interface into low level (one where methods return what is now WithHttpMessagesAsync) and high level (return actual deserialized objects).

Obviously this would be a breaking change, but the usability of the library has real effect on developer productivity ATM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions