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