Search.Nodes decodes full node rows as *Node and refuses WithPartial/WithPartialPaths, since a partial row isn't a node. That forces callers who need a handful of fields to download every node in full. cinc-cli's node status (name, ohai_time, platform, platform_version, fqdn, ipaddress) and node ssh (one host attribute) both do this. knife status uses a partial search, which matters on large orgs.
A partial search reads node paths from the merged attributes, so a projected row can't simply be decoded into Node (where automatic/normal/... are separate). Some options:
- A
Search.PartialNodes(ctx, query, paths...) iterator yielding a small type (name plus a map[string]any of projected values) with LastCheckin/AttributeScalar-style accessors.
- Let
Search.Nodes take a projection and synthesize a Node whose Automatic holds the merged values. Simple for callers, but misleading about precedence.
Once this exists, cinc-cli's node status and node ssh should switch to it.
Search.Nodesdecodes full node rows as*Nodeand refusesWithPartial/WithPartialPaths, since a partial row isn't a node. That forces callers who need a handful of fields to download every node in full. cinc-cli'snode status(name,ohai_time, platform, platform_version, fqdn, ipaddress) andnode ssh(one host attribute) both do this. knife status uses a partial search, which matters on large orgs.A partial search reads node paths from the merged attributes, so a projected row can't simply be decoded into
Node(whereautomatic/normal/... are separate). Some options:Search.PartialNodes(ctx, query, paths...)iterator yielding a small type (name plus amap[string]anyof projected values) withLastCheckin/AttributeScalar-style accessors.Search.Nodestake a projection and synthesize aNodewhoseAutomaticholds the merged values. Simple for callers, but misleading about precedence.Once this exists, cinc-cli's
node statusandnode sshshould switch to it.