mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 20:17:41 +00:00
Merge pull request #9830 from brendandburns/e2e
Set the project when creating/destroying pd disks.
This commit is contained in:
commit
1b5292fa4d
@ -193,7 +193,7 @@ func createPD() (string, error) {
|
|||||||
|
|
||||||
zone := testContext.CloudConfig.Zone
|
zone := testContext.CloudConfig.Zone
|
||||||
// TODO: make this hit the compute API directly instread of shelling out to gcloud.
|
// TODO: make this hit the compute API directly instread of shelling out to gcloud.
|
||||||
err := exec.Command("gcloud", "compute", "disks", "create", "--zone="+zone, "--size=10GB", pdName).Run()
|
err := exec.Command("gcloud", "compute", "--project="+testContext.CloudConfig.ProjectID, "disks", "create", "--zone="+zone, "--size=10GB", pdName).Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ func deletePD(pdName string) error {
|
|||||||
zone := testContext.CloudConfig.Zone
|
zone := testContext.CloudConfig.Zone
|
||||||
|
|
||||||
// TODO: make this hit the compute API directly.
|
// TODO: make this hit the compute API directly.
|
||||||
return exec.Command("gcloud", "compute", "disks", "delete", "--zone="+zone, pdName).Run()
|
return exec.Command("gcloud", "compute", "--project="+testContext.CloudConfig.ProjectID, "disks", "delete", "--zone="+zone, pdName).Run()
|
||||||
} else {
|
} else {
|
||||||
volumes, ok := testContext.CloudConfig.Provider.(aws_cloud.Volumes)
|
volumes, ok := testContext.CloudConfig.Provider.(aws_cloud.Volumes)
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -231,7 +231,7 @@ func detachPD(hostName, pdName string) error {
|
|||||||
zone := testContext.CloudConfig.Zone
|
zone := testContext.CloudConfig.Zone
|
||||||
|
|
||||||
// TODO: make this hit the compute API directly.
|
// TODO: make this hit the compute API directly.
|
||||||
return exec.Command("gcloud", "compute", "instances", "detach-disk", "--zone="+zone, "--disk="+pdName, instanceName).Run()
|
return exec.Command("gcloud", "compute", "--project="+testContext.CloudConfig.ProjectID, "detach-disk", "--zone="+zone, "--disk="+pdName, instanceName).Run()
|
||||||
} else {
|
} else {
|
||||||
volumes, ok := testContext.CloudConfig.Provider.(aws_cloud.Volumes)
|
volumes, ok := testContext.CloudConfig.Provider.(aws_cloud.Volumes)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user