hashicorp / hashicorp/nomad

Bring Go client to functional parity of cli

Open
#17,447 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stage/accepted theme/api type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

Proposal

As per documentation pages the method to stream a specific file from allocation has multiple options, such as path, follow, offset and origin. Same options are available via both REST API and nomad operator api .... However Go client Client.AllocFs().Stream() accepts all of those except follow, it currently uses follow=true which there is no way to override.

Use-cases
  • Retrieving single file that is not being written to
  • Retrieving "point-in-time" of single file that is being actively written
Attempted Solutions
  • Looked at using .Raw() but it requires way more coding around than I would like to.
  • There is a .Cat() method, that does actually work as follow=false, but this is different from the Logs functionality where the same method is used for both using boolean argument as a switch.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in api/fs.go around the AllocFs().Stream() method and compare its arguments with the stream-file API documentation and the equivalent nomad operator api behavior. Confirm how follow is represented in the Go client, then verify that callers can retrieve both a complete file and a point-in-time snapshot without using Raw().

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.