Skip to content

feat: add Account, User, and Association types for v0042-v0045#3

Open
giuliocalzo wants to merge 2 commits into
SlinkyProject:mainfrom
giuliocalzo:feat/account-user-crds
Open

feat: add Account, User, and Association types for v0042-v0045#3
giuliocalzo wants to merge 2 commits into
SlinkyProject:mainfrom
giuliocalzo:feat/account-user-crds

Conversation

@giuliocalzo

Copy link
Copy Markdown

Summary

  • Add typed objects Account, User, and Assoc (plus their list variants) for the v0042, v0043, v0044, and v0045 accounting APIs, implementing the object.Object / object.ObjectList interfaces.
  • Implement version-specific CRUD client methods (account.go, user.go, association.go) and register AccountInterface, UserInterface, and AssocInterface in each ClientInterface.
  • Wire the new types into the high-level client (pkg/client/client.go) Create/Get/List/Update/Delete switches, the informer cache, and the fake client.
  • Assoc uses a composite key (cluster/account/user/partition); since there is no direct get-by-key endpoint, Get is implemented via List + 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)
  • Docker-based pkg/client integration suite (requires a live Slurm REST API; not run here)

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants