Tag dynamically created GCE PD disks.

GCE disks don't have tags, we must encode the tags into Description field.
It's encoded as JSON, which is both human and machine readable:
description: '{"kubernetes.io/created-for/pv/name":"pv-gce-oxwts","kubernetes.io/created-for/pvc/name":"myclaim","kubernetes.io/created-for/pvc/namespace":"default"}'
This commit is contained in:
Jan Safranek
2016-01-27 15:16:05 +01:00
parent 63ec304e42
commit 23cd0913f7
3 changed files with 33 additions and 7 deletions

View File

@@ -146,7 +146,7 @@ func (gceutil *GCEDiskUtil) CreateVolume(c *gcePersistentDiskProvisioner) (volum
return "", 0, err
}
err = cloud.CreateDisk(name, zone.FailureDomain, int64(requestGB))
err = cloud.CreateDisk(name, zone.FailureDomain, int64(requestGB), *c.options.CloudTags)
if err != nil {
glog.V(2).Infof("Error creating GCE PD volume: %v", err)
return "", 0, err