aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gce
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-06-17 14:34:02 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-06-17 15:02:58 +0200
commit97b58e7eae01ebe5df5d0bfdff4e6154e7ca869b (patch)
tree83eb9d534ef9193e0ad8bf7aeb778c85b0ea602e /vm/gce
parent260cdaa2b2dcdca9cc9d84c1bc08d00d451c68cd (diff)
syz-manager/mgrconfig: move sshkey from vm config to manager config
Sshkey is a property of image, which is in manager config. Move sshkey to the same location as image. The motivation for the move is as follows. Continuous build produces an image and the key, both need to be passed manager instance. Continuous build system should not distinguish different VM types and mess with their configs. NOTE FOR USERS: this breaks manager configs again. Hopefully the last time for now. Docs are updated.
Diffstat (limited to 'vm/gce')
-rw-r--r--vm/gce/gce.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/vm/gce/gce.go b/vm/gce/gce.go
index d0a181250..eeae077a5 100644
--- a/vm/gce/gce.go
+++ b/vm/gce/gce.go
@@ -34,7 +34,6 @@ type Config struct {
Count int // number of VMs to use
Machine_Type string // GCE machine type (e.g. "n1-highcpu-2")
GCS_Path string // GCS path to upload image
- Sshkey string // root ssh key for the image
}
type Pool struct {
@@ -68,7 +67,7 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) {
Count: 1,
}
if err := config.LoadData(env.Config, cfg); err != nil {
- return nil, err
+ return nil, fmt.Errorf("failed to parse gce vm config: %v", err)
}
if cfg.Count < 1 || cfg.Count > 1000 {
return nil, fmt.Errorf("invalid config param count: %v, want [1, 1000]", cfg.Count)
@@ -82,7 +81,6 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) {
if cfg.GCS_Path == "" {
return nil, fmt.Errorf("gcs_path parameter is empty")
}
- cfg.Sshkey = osutil.Abs(cfg.Sshkey)
GCE, err := gce.NewContext()
if err != nil {
@@ -150,7 +148,7 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) {
pool.GCE.DeleteInstance(name, true)
}
}()
- sshKey := pool.cfg.Sshkey
+ sshKey := pool.env.Sshkey
sshUser := "root"
if sshKey == "" {
// Assuming image supports GCE ssh fanciness.