mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
cli: query all namespaces for alloc subcommands
This commit is contained in:
@@ -183,7 +183,8 @@ func (l *AllocExecCommand) Run(args []string) int {
|
||||
return 1
|
||||
}
|
||||
// Prefix lookup matched a single allocation
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, nil)
|
||||
q := &api.QueryOptions{Namespace: allocs[0].Namespace}
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, q)
|
||||
if err != nil {
|
||||
l.Ui.Error(fmt.Sprintf("Error querying allocation: %s", err))
|
||||
return 1
|
||||
|
||||
@@ -196,7 +196,8 @@ func (f *AllocFSCommand) Run(args []string) int {
|
||||
return 1
|
||||
}
|
||||
// Prefix lookup matched a single allocation
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, nil)
|
||||
q := &api.QueryOptions{Namespace: allocs[0].Namespace}
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, q)
|
||||
if err != nil {
|
||||
f.Ui.Error(fmt.Sprintf("Error querying allocation: %s", err))
|
||||
return 1
|
||||
|
||||
@@ -171,7 +171,8 @@ func (l *AllocLogsCommand) Run(args []string) int {
|
||||
return 1
|
||||
}
|
||||
// Prefix lookup matched a single allocation
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, nil)
|
||||
q := &api.QueryOptions{Namespace: allocs[0].Namespace}
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, q)
|
||||
if err != nil {
|
||||
l.Ui.Error(fmt.Sprintf("Error querying allocation: %s", err))
|
||||
return 1
|
||||
|
||||
@@ -96,7 +96,8 @@ func (c *AllocRestartCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
// Prefix lookup matched a single allocation
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, nil)
|
||||
q := &api.QueryOptions{Namespace: allocs[0].Namespace}
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, q)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error querying allocation: %s", err))
|
||||
return 1
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/nomad/api"
|
||||
"github.com/hashicorp/nomad/api/contexts"
|
||||
"github.com/posener/complete"
|
||||
)
|
||||
@@ -100,7 +101,8 @@ func (c *AllocSignalCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
// Prefix lookup matched a single allocation
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, nil)
|
||||
q := &api.QueryOptions{Namespace: allocs[0].Namespace}
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, q)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error querying allocation: %s", err))
|
||||
return 1
|
||||
|
||||
@@ -166,7 +166,8 @@ func (c *AllocStatusCommand) Run(args []string) int {
|
||||
return 0
|
||||
}
|
||||
// Prefix lookup matched a single allocation
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, nil)
|
||||
q := &api.QueryOptions{Namespace: allocs[0].Namespace}
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, q)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error querying allocation: %s", err))
|
||||
return 1
|
||||
|
||||
@@ -3,6 +3,8 @@ package command
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/nomad/api"
|
||||
)
|
||||
|
||||
type AllocStopCommand struct {
|
||||
@@ -102,7 +104,8 @@ func (c *AllocStopCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
// Prefix lookup matched a single allocation
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, nil)
|
||||
q := &api.QueryOptions{Namespace: allocs[0].Namespace}
|
||||
alloc, _, err := client.Allocations().Info(allocs[0].ID, q)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error querying allocation: %s", err))
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user