You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: apply request editor pattern to all Fleet resources
Following Tobio's enrollment tokens example, refactor all Fleet client
functions to use spaceAwarePathRequestEditor instead of duplicate *InSpace
functions with manual HTTP handling.
Changes:
- Deleted 17 duplicate *InSpace functions (~581 lines of manual HTTP code)
- Updated base functions to accept spaceID parameter and use request editor
- Simplified all CRUD operations to single function calls
- Updated test files for new signatures
Benefits:
- Single code path using generated client (vs manual HTTP)
- Consistent pattern across all Fleet resources
- Eliminates 50% code duplication for Fleet operations
- Easier to maintain and test
All Fleet resources now use:
GetResource(ctx, client, id, spaceID)
CreateResource(ctx, client, spaceID, body)
UpdateResource(ctx, client, id, spaceID, body)
DeleteResource(ctx, client, id, spaceID)
The spaceAwarePathRequestEditor handles path modification automatically.
0 commit comments