feat: add Account, User, and Association types for v0042-v0045#3
Open
giuliocalzo wants to merge 2 commits into
Open
feat: add Account, User, and Association types for v0042-v0045#3giuliocalzo wants to merge 2 commits into
giuliocalzo wants to merge 2 commits into
Conversation
Add typed objects (Account, User, Assoc) and their list variants for the v0042, v0043, v0044, and v0045 accounting APIs, implementing the object.Object interface. Wire CRUD client methods into the version-specific clients, register them in each ClientInterface, and integrate with the high-level client, informer cache, and fake client. Include unit tests for the typed objects, client methods, and fake-client round trips. Signed-off-by: Giulio Calzolari <gcalzolari@nvidia.com>
…-side Address MAGI review findings on the accounting association handling: - CreateAssoc now returns the composite key derived from the request so the high-level Create refresh resolves the just-created association by identity instead of the (possibly empty) input object, eliminating a spurious NotFound after a successful POST. - Add UpdateAssoc, which pins the cluster/account/user/partition identity from the target key before upserting, so an update always targets the intended association regardless of the request's identity fields (mirrors UpdateAccount). - Add GetAssoc, which decomposes the composite key into server-side filter params and selects the exact match, replacing the previous full ListAssoc + client-side linear scan on every association lookup. - DeleteAssoc omits the user filter when the user is empty rather than sending user="", matching the nil-when-unset convention of the other filter fields. Add unit coverage for the new and changed methods across v0042-v0045. Signed-off-by: Giulio Calzolari <gcalzolari@nvidia.com>
5 tasks
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.
Summary
Account,User, andAssoc(plus their list variants) for thev0042,v0043,v0044, andv0045accounting APIs, implementing theobject.Object/object.ObjectListinterfaces.account.go,user.go,association.go) and registerAccountInterface,UserInterface, andAssocInterfacein eachClientInterface.pkg/client/client.go) Create/Get/List/Update/Delete switches, the informer cache, and the fake client.Assocuses a composite key (cluster/account/user/partition); since there is no direct get-by-key endpoint,Getis implemented viaList+ client-side filtering.Test plan
go test ./pkg/types/... ./pkg/client/api/... ./pkg/client/fake/...pre-commit run --all-files(go-fmt, go-vet, go-build, golangci-lint, legal notices)pkg/clientintegration suite (requires a live Slurm REST API; not run here)