diff --git a/command/alloc_status.go b/command/alloc_status.go index 8ba7bcb95..1bea22610 100644 --- a/command/alloc_status.go +++ b/command/alloc_status.go @@ -145,7 +145,7 @@ func (c *AllocStatusCommand) Run(args []string) int { return 1 } - allocID = sanatizeUUIDPrefix(allocID) + allocID = sanitizeUUIDPrefix(allocID) allocs, _, err := client.Allocations().PrefixList(allocID) if err != nil { c.Ui.Error(fmt.Sprintf("Error querying allocation: %v", err)) diff --git a/command/eval_status.go b/command/eval_status.go index 448b74776..0b7dcd0d3 100644 --- a/command/eval_status.go +++ b/command/eval_status.go @@ -139,7 +139,7 @@ func (c *EvalStatusCommand) Run(args []string) int { return 1 } - evalID = sanatizeUUIDPrefix(evalID) + evalID = sanitizeUUIDPrefix(evalID) evals, _, err := client.Evaluations().PrefixList(evalID) if err != nil { c.Ui.Error(fmt.Sprintf("Error querying evaluation: %v", err)) diff --git a/command/fs.go b/command/fs.go index 97b18a0b4..e875c6483 100644 --- a/command/fs.go +++ b/command/fs.go @@ -174,7 +174,7 @@ func (f *FSCommand) Run(args []string) int { return 1 } - allocID = sanatizeUUIDPrefix(allocID) + allocID = sanitizeUUIDPrefix(allocID) allocs, _, err := client.Allocations().PrefixList(allocID) if err != nil { f.Ui.Error(fmt.Sprintf("Error querying allocation: %v", err)) diff --git a/command/helpers.go b/command/helpers.go index f26e5c7ca..68f0f15bc 100644 --- a/command/helpers.go +++ b/command/helpers.go @@ -447,10 +447,10 @@ func mergeAutocompleteFlags(flags ...complete.Flags) complete.Flags { return merged } -// sanatizeUUIDPrefix is used to sanatize a UUID prefix. The returned result +// sanitizeUUIDPrefix is used to sanitize a UUID prefix. The returned result // will be a truncated version of the prefix if the prefix would not be // queryable. -func sanatizeUUIDPrefix(prefix string) string { +func sanitizeUUIDPrefix(prefix string) string { hyphens := strings.Count(prefix, "-") length := len(prefix) - hyphens remainder := length % 2 diff --git a/command/logs.go b/command/logs.go index 68e2b3f57..e0d53c65c 100644 --- a/command/logs.go +++ b/command/logs.go @@ -149,7 +149,7 @@ func (l *LogsCommand) Run(args []string) int { return 1 } - allocID = sanatizeUUIDPrefix(allocID) + allocID = sanitizeUUIDPrefix(allocID) allocs, _, err := client.Allocations().PrefixList(allocID) if err != nil { l.Ui.Error(fmt.Sprintf("Error querying allocation: %v", err)) diff --git a/command/monitor.go b/command/monitor.go index fa3832882..da66e23ea 100644 --- a/command/monitor.go +++ b/command/monitor.go @@ -190,7 +190,7 @@ func (m *monitor) monitor(evalID string, allowPrefix bool) int { return 1 } - evalID = sanatizeUUIDPrefix(evalID) + evalID = sanitizeUUIDPrefix(evalID) evals, _, err := m.client.Evaluations().PrefixList(evalID) if err != nil { m.ui.Error(fmt.Sprintf("Error reading evaluation: %s", err)) diff --git a/command/node_drain.go b/command/node_drain.go index b64b13ad5..b40757b7c 100644 --- a/command/node_drain.go +++ b/command/node_drain.go @@ -122,7 +122,7 @@ func (c *NodeDrainCommand) Run(args []string) int { return 1 } - nodeID = sanatizeUUIDPrefix(nodeID) + nodeID = sanitizeUUIDPrefix(nodeID) nodes, _, err := client.Nodes().PrefixList(nodeID) if err != nil { c.Ui.Error(fmt.Sprintf("Error toggling drain mode: %s", err)) diff --git a/command/node_status.go b/command/node_status.go index 52dd7d15d..804e63d34 100644 --- a/command/node_status.go +++ b/command/node_status.go @@ -234,7 +234,7 @@ func (c *NodeStatusCommand) Run(args []string) int { return 1 } - nodeID = sanatizeUUIDPrefix(nodeID) + nodeID = sanitizeUUIDPrefix(nodeID) nodes, _, err := client.Nodes().PrefixList(nodeID) if err != nil { c.Ui.Error(fmt.Sprintf("Error querying node info: %s", err)) diff --git a/nomad/fsm.go b/nomad/fsm.go index 5953aedc9..68cc9170b 100644 --- a/nomad/fsm.go +++ b/nomad/fsm.go @@ -339,7 +339,7 @@ func (n *nomadFSM) applyUpsertJob(buf []byte, index uint64) interface{} { /* Handle upgrade paths: * - Empty maps and slices should be treated as nil to avoid * un-intended destructive updates in scheduler since we use - * reflect.DeepEqual. Starting Nomad 0.4.1, job submission sanatizes + * reflect.DeepEqual. Starting Nomad 0.4.1, job submission sanitizes * the incoming job. * - Migrate from old style upgrade stanza that used only a stagger. */ @@ -943,7 +943,7 @@ func (n *nomadFSM) Restore(old io.ReadCloser) error { /* Handle upgrade paths: * - Empty maps and slices should be treated as nil to avoid * un-intended destructive updates in scheduler since we use - * reflect.DeepEqual. Starting Nomad 0.4.1, job submission sanatizes + * reflect.DeepEqual. Starting Nomad 0.4.1, job submission sanitizes * the incoming job. * - Migrate from old style upgrade stanza that used only a stagger. */