refactor(client/kubernetes): move into internal/client/kubernetes subpackage (#140)#622
Merged
Merged
Conversation
…package (#140) The 547-line internal/client/kubernetes_client.go now lives under internal/client/kubernetes/, split per CRD domain: client.go core type + constructor + scheme + validateCRDs mcpserver.go MCPServer CRUD + UpdateMCPServerStatus serviceclass.go ServiceClass CRUD + UpdateServiceClassStatus workflow.go Workflow CRUD + UpdateWorkflowStatus events.go CreateEvent / CreateEventForCRD / QueryEvents The MusterClient interface stays in the parent client package. The only caller of the old NewKubernetesClient was the dispatcher in muster_client.go itself, which now calls kubernetes.New(restConfig) directly. External consumers depend only on MusterClient and are unaffected. kubernetesClient -> kubernetes.Client NewKubernetesClient -> kubernetes.New(config *rest.Config) (*Client, error)
f7ef42e to
96ed89a
Compare
…sterClient assertion Replaces the 'muster' literal duplicated across CreateEvent, CreateEventForCRD, and QueryEvents with a single sourceComponent const. Adds var _ MusterClient = (*kubernetes.Client)(nil) at the dispatcher call site so interface drift fails at compile time.
Contributor
Author
|
Self-review wrap-up — ready for an external pair of eyes. Why this should merge: Pure file move. The 547-line
Per-CRD duplication is intentional in this PR. Each CRD file is the same template differing only by type and kind string — the symmetric situation to #621. #627 collapses both client adapters into shared CI green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of #140.
Moves the 547-line
internal/client/kubernetes_client.gointo a newinternal/client/kubernetes/subpackage, split per CRD domain (client.go,mcpserver.go,serviceclass.go,workflow.go,events.go). The core file keeps the type, constructor, scheme, lifecycle methods, and discovery-based CRD validation.Pure refactor: the
MusterClientinterface stays in the parentclientpackage and the only direct caller ofNewKubernetesClientwas the in-package dispatcher, which now callskubernetes.New(restConfig)directly. External consumers depend only onMusterClientand are unaffected.Renames:
kubernetesClient→kubernetes.Client,NewKubernetesClient→kubernetes.New(config *rest.Config) (*Client, error).