diff options
| author | Alexander Potapenko <glider@google.com> | 2026-01-15 13:32:54 +0100 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2026-01-15 14:02:51 +0000 |
| commit | 1b51e9a3ba38bfe09679fe437cece6645a6105d5 (patch) | |
| tree | 697a078672059382381432df15bc1314fec1cdf5 /vm/gce/gce.go | |
| parent | b223fd77dc7379c8fd2f26596cf12502a9354ea3 (diff) | |
pkg/gce: vm/gce: allow specifying instance tags in manager config
GCE instance tags can be used for various purposes, such as applying
network firewall rules or filtering VMs for scheduling onto specific
hosts.
To support these use cases, syzkaller needs the ability to set
instance tags during VM creation.
This patch introduces a new tags field to the gce VM configuration that
allows users to specify a list of tags to be attached to GCE instances
created by syz-manager.
Diffstat (limited to 'vm/gce/gce.go')
| -rw-r--r-- | vm/gce/gce.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vm/gce/gce.go b/vm/gce/gce.go index a830a9889..90b12c89f 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -59,7 +59,8 @@ type Config struct { // Leave empty for non-OS Login GCP projects. // Otherwise generate one and upload it: // `gcloud compute os-login ssh-keys add --key-file some-key.pub`. - SerialPortKey string `json:"serial_port_key"` + SerialPortKey string `json:"serial_port_key"` + Tags []string `json:"tags"` // GCE instance tags } type Pool struct { @@ -195,7 +196,7 @@ func (pool *Pool) Create(_ context.Context, workdir string, index int) (vmimpl.I } log.Logf(0, "creating instance: %v", name) ip, err := pool.GCE.CreateInstance(name, pool.cfg.MachineType, pool.cfg.GCEImage, - string(gceKeyPub), pool.cfg.Preemptible, pool.cfg.DisplayDevice) + string(gceKeyPub), pool.cfg.Tags, pool.cfg.Preemptible, pool.cfg.DisplayDevice) if err != nil { return nil, err } |
