Drop kubevault.dev/apimachinery/client dependency#228
Merged
Conversation
Switch CLI helpers from the apimachinery-generated typed clientsets to sigs.k8s.io/controller-runtime/pkg/client.Client. initClients now returns a single client.Client (plus kubeClient); generateSecretObjects and NewGenerator take it as a single dependency. The Update path uses kmodules.xyz/client-go/client.PatchStatus instead of engineutil's typed-clientset Update helper. go mod tidy + vendor refresh remove the apimachinery/client subtree. Signed-off-by: Tamal Saha <tamal@appscode.com>
Make every import of kubevault.dev/apimachinery/apis/* uniform across the repo: kubevault/v1alpha1 -> vaultv1a1 kubevault/v1alpha2 -> vaultv1a2 engine/v1alpha1 -> engineapi policy/v1alpha1 -> policyapi ops/v1alpha1 -> opsapi catalog/v1alpha1 -> catalogapi config/v1alpha1 -> configapi Pure rename: no behavior change. Signed-off-by: Tamal Saha <tamal@appscode.com>
Member
Author
|
Updated with commit
Build + vet + gofmt clean. |
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.
Pairs with kubevault/operator#183 — both repos drop their dependency on apimachinery's generated typed clientsets / informers / listers. apimachinery itself is unchanged; its `client/` tree becomes unreferenced from both production consumers and is a candidate for deletion in a follow-up.
Summary
The CLI now uses `sigs.k8s.io/controller-runtime/pkg/client.Client` for every CRUD against KubeVault custom resources (VaultServer, VaultPolicy, SecretAccessRequest, SecretRoleBinding, AWSRole/GCPRole/AzureRole/MongoDBRole/MySQLRole/MariaDBRole/PostgresRole/RedisRole/ElasticsearchRole/PKIRole, SecretEngine, VaultPolicyBinding).
Changes (12 files)
Vendor cleanup
`go mod tidy && go mod vendor` removed `vendor/kubevault.dev/apimachinery/client/` entirely (40 files gone) plus other api-group subtrees only reachable through the aggregated scheme builder. Diff stat: 86 files changed, 344 insertions(+), 108,337 deletions(-).
Test plan
Pre-existing oddity flagged (not fixed in this PR)
`pkg/generate/database/postgres/postgres.go::NewPostgresGenerator` fetches a MongoDBRole (not PostgresRole) to read its `SecretEngineRef`. The constructor still does that; only `Generate()` uses the correct `PostgresRole`. Behavior preserved verbatim — fixing would be a behavioral change outside the refactor's scope.
🤖 Generated with Claude Code