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

@@ -314,7 +314,8 @@ func createPD() (string, error) {
return "", err
}
err = gceCloud.CreateDisk(pdName, testContext.CloudConfig.Zone, 10 /* sizeGb */)
tags := map[string]string{}
err = gceCloud.CreateDisk(pdName, testContext.CloudConfig.Zone, 10 /* sizeGb */, tags)
if err != nil {
return "", err
}