Documentation
¶
Overview ¶
Package cli wires the armada command tree: the client that talks to the control plane. Commands that run on a machine as root are in package daemon (the armadad binary).
Index ¶
- Constants
- func ExampleProblems(newRoot func() *cobra.Command) []string
- func Execute(ctx context.Context, args []string, stdout, stderr io.Writer) int
- func IsTerminal(w io.Writer) bool
- func LatestLine(ctx context.Context, current string) []string
- func NewRootCommand() *cobra.Command
- func NewVersionCommand(more ...func(context.Context) []string) *cobra.Command
- func RPCError(err error) error
- func ReadSecretValue(cmd *cobra.Command, fromFile string) ([]byte, error)
- func Run(ctx context.Context, cmd *cobra.Command, args []string, stdin io.Reader, ...) int
- func SetPollIntervals(wait, node time.Duration) (restore func())
Constants ¶
const InstallURL = "https://raw.githubusercontent.com/ryanbekhen/armada/main/install.sh"
InstallURL is where the installer is published.
Variables ¶
This section is empty.
Functions ¶
func ExampleProblems ¶
ExampleProblems checks the command tree newRoot builds (ADR 0052): every runnable command has two to four examples, and every example line that runs the tree's program names a command, flags, and arguments that exist on a fresh tree. Lines that only run other programs (systemctl) and comment lines are allowed. Tests of both binaries call it.
func Execute ¶
Execute runs the command tree with args and returns the process exit code. On a terminal it says, at most once a day, that a newer release exists.
func LatestLine ¶
LatestLine says how current compares with the latest release, or nothing when looking is turned off.
func NewRootCommand ¶
NewRootCommand builds the full command tree. Output goes to the writers configured on the returned command so tests can capture it.
func NewVersionCommand ¶
NewVersionCommand prints build information; both binaries have it. As text it adds what each of more returns (the client: the servers' versions) and the latest release.
func RPCError ¶
RPCError strips the gRPC wrapping from server errors for display. The message may carry text from a node or an app (a file name in a volume), so control characters are replaced: it cannot move the cursor or send terminal sequences. Line breaks stay, since the server lists several problems (a spec's) one per line; text it relays from agents has none.
func ReadSecretValue ¶
ReadSecretValue reads at most secrets.MaxSize bytes from a file, a hidden terminal prompt, or piped stdin.
func Run ¶
func Run(ctx context.Context, cmd *cobra.Command, args []string, stdin io.Reader, stdout, stderr io.Writer) int
Run runs a command tree with args and returns the process exit code; a nil stdin means os.Stdin. armadad runs its own tree through it.
func SetPollIntervals ¶
SetPollIntervals sets how often commands that wait poll the control plane (app deploy --wait, job start --wait, node delete) and returns a function that restores them. armadad's tests drive these commands against a server they run in process.
Types ¶
This section is empty.