Skip to content

Search.Nodes can't use a partial search, so callers download whole nodes #105

Description

@tas50

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions