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 /pkg/gce | |
| 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 'pkg/gce')
| -rw-r--r-- | pkg/gce/gce.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/gce/gce.go b/pkg/gce/gce.go index 7100665ef..4a5491e25 100644 --- a/pkg/gce/gce.go +++ b/pkg/gce/gce.go @@ -118,7 +118,7 @@ func NewContext(customZoneID string) (*Context, error) { } func (ctx *Context) CreateInstance(name, machineType, image, sshkey string, - preemptible, displayDevice bool) (string, error) { + tags []string, preemptible, displayDevice bool) (string, error) { prefix := "https://www.googleapis.com/compute/v1/projects/" + ctx.ProjectID sshkeyAttr := "syzkaller:" + sshkey oneAttr := "1" @@ -165,6 +165,7 @@ func (ctx *Context) CreateInstance(name, machineType, image, sshkey string, DisplayDevice: &compute.DisplayDevice{ EnableDisplay: displayDevice, }, + Tags: &compute.Tags{Items: tags}, } retry: if !instance.Scheduling.Preemptible && strings.HasPrefix(machineType, "e2-") { |
