mirror of
https://github.com/weaveworks/scope.git
synced 2026-02-15 18:39:53 +00:00
Propagate the local username
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -71,9 +72,15 @@ func deploy(c Client, args []string) {
|
||||
usage()
|
||||
return
|
||||
}
|
||||
user, err := user.Current()
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
deployment := Deployment{
|
||||
ImageName: parts[0],
|
||||
Version: parts[1],
|
||||
ImageName: parts[0],
|
||||
Version: parts[1],
|
||||
TriggeringUser: user.Username,
|
||||
}
|
||||
if err := c.Deploy(deployment); err != nil {
|
||||
fmt.Println(err.Error())
|
||||
|
||||
@@ -12,6 +12,8 @@ type Deployment struct {
|
||||
Version string `json:"version"`
|
||||
Priority int `json:"priority"`
|
||||
State string `json:"status"`
|
||||
|
||||
TriggeringUser string `json:"triggering_user"`
|
||||
}
|
||||
|
||||
// Config for the deployment system for a user.
|
||||
|
||||
Reference in New Issue
Block a user