diff --git a/.go-version b/.go-version index e63679c76..71f7f51df 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.20.6 +1.22 diff --git a/README.md b/README.md index a1ce67bf5..3b2b66759 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Learn more: For general information about Terraform, visit [terraform.io][terraform-install] and [the project][terraform-github] on GitHub. -* [Go 1.20][golang-install] +* [Go 1.22][golang-install] Required if building the provider. @@ -37,7 +37,7 @@ Learn more: ## Using the Provider -The Terraform Provider for VMware vSphere is an official provider. Official providers are maintained by the Terraform team at [HashiCorp][hashicorp] and are listed on the [Terraform Registry][terraform-registry]. +The Terraform Provider for VMware vSphere is an official provider. Official providers are maintained by the Terraform team at [HashiCorp][hashicorp] and are listed on the [Terraform Registry][terraform-registry]. To use a released version of the Terraform provider in your environment, run `terraform init` and Terraform will automatically install the provider from the Terraform Registry. diff --git a/go.mod b/go.mod index a46308ccb..ee3a59e3e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/terraform-provider-vsphere -go 1.18 +go 1.22 require ( github.com/davecgh/go-spew v1.1.1 diff --git a/go.sum b/go.sum index 1dd3b9022..260dada73 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= @@ -8,23 +10,32 @@ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJE github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dougm/pretty v0.0.0-20171025230240-2ee9d7453c02 h1:tR3jsKPiO/mb6ntzk/dJlHZtm37CPfVp1C9KIo534+4= +github.com/dougm/pretty v0.0.0-20171025230240-2ee9d7453c02/go.mod h1:7NQ3kWOx2cZOSjtcveTa5nqupVr2s6/83sG+rTlI7uA= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git/v5 v5.10.1 h1:tu8/D8i+TWxgKpzQ3Vc43e+kkhXqtsZCKI/egajKnxk= +github.com/go-git/go-git/v5 v5.10.1/go.mod h1:uEuHjxkHap8kAl//V5F/nNWwqIYtP/402ddd05mp0wg= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -35,6 +46,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= @@ -78,14 +90,20 @@ github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv2 github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -105,16 +123,20 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= +github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -125,6 +147,7 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV github.com/vmware/govmomi v0.35.0 h1:vN6m2J5ezSJomSTHyKbvpfoEZTn2mGXWg2FFpjRTRp0= github.com/vmware/govmomi v0.35.0/go.mod h1:VvIo6siOYFKdF9eU7qrY9+j/F99DV/LtSgsOpxFXJAY= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI= github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= @@ -173,6 +196,7 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -188,6 +212,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -206,5 +231,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vsphere/distributed_virtual_switch_helper.go b/vsphere/distributed_virtual_switch_helper.go index 7a858dccc..3328272be 100644 --- a/vsphere/distributed_virtual_switch_helper.go +++ b/vsphere/distributed_virtual_switch_helper.go @@ -110,7 +110,7 @@ func upgradeDVS(client *govmomi.Client, dvs *object.VmwareDistributedVirtualSwit task := object.NewTask(client.Client, resp.Returnval) tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - return task.Wait(tctx) + return task.WaitEx(tctx) } // updateDVSConfiguration contains the atomic update/wait operation for a DVS. @@ -123,7 +123,7 @@ func updateDVSConfiguration(dvs *object.VmwareDistributedVirtualSwitch, spec *ty } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - return task.Wait(tctx) + return task.WaitEx(tctx) } // enableDVSNetworkResourceManagement exposes the diff --git a/vsphere/helper_test.go b/vsphere/helper_test.go index 12265d9c5..db67e4cc0 100644 --- a/vsphere/helper_test.go +++ b/vsphere/helper_test.go @@ -356,7 +356,7 @@ func testPowerOffVM(s *terraform.State, resourceName string) error { } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return fmt.Errorf("error waiting for poweroff: %s", err) } return nil @@ -494,7 +494,7 @@ func testDeleteVM(s *terraform.State, resourceName string) error { } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - return task.Wait(tctx) + return task.WaitEx(tctx) } // testGetTagCategory gets a tag category by name. @@ -784,7 +784,7 @@ func testDeleteDatastoreFile(client *govmomi.Client, dsID string, path string) e if err != nil { return err } - return task.Wait(context.TODO()) + return task.WaitEx(context.TODO()) } // testGetDatastoreCluster is a convenience method to fetch a datastore cluster by diff --git a/vsphere/internal/helper/clustercomputeresource/cluster_compute_resource_helper.go b/vsphere/internal/helper/clustercomputeresource/cluster_compute_resource_helper.go index 60b56eceb..703ad6bd0 100644 --- a/vsphere/internal/helper/clustercomputeresource/cluster_compute_resource_helper.go +++ b/vsphere/internal/helper/clustercomputeresource/cluster_compute_resource_helper.go @@ -126,7 +126,7 @@ func Rename(cluster *object.ClusterComputeResource, name string) error { if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } // MoveToFolder is a complex method that moves a ClusterComputeResource to a given relative @@ -165,7 +165,7 @@ func Delete(cluster *object.ClusterComputeResource) error { if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } func Hosts(cluster *object.ClusterComputeResource) ([]*object.HostSystem, error) { @@ -237,7 +237,7 @@ func MoveHostsInto(client *govmomi.Client, cluster *object.ClusterComputeResourc } task := object.NewTask(cluster.Client(), resp.Returnval) - return task.Wait(ctx) + return task.WaitEx(ctx) } // MoveHostsOutOf moves a supplied list of hosts out of the specified cluster. diff --git a/vsphere/internal/helper/computeresource/compute_resource_helper.go b/vsphere/internal/helper/computeresource/compute_resource_helper.go index 05bbcd1dd..ec1dcaec4 100644 --- a/vsphere/internal/helper/computeresource/compute_resource_helper.go +++ b/vsphere/internal/helper/computeresource/compute_resource_helper.go @@ -228,7 +228,7 @@ func Reconfigure(obj BaseComputeResource, spec types.BaseComputeResourceConfigSp if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } // HasChildren checks to see if a compute resource has any child items (hosts diff --git a/vsphere/internal/helper/datastore/datastore_helper.go b/vsphere/internal/helper/datastore/datastore_helper.go index ca78f296a..adcf21303 100644 --- a/vsphere/internal/helper/datastore/datastore_helper.go +++ b/vsphere/internal/helper/datastore/datastore_helper.go @@ -211,7 +211,7 @@ func searchDatastore(ds *object.Datastore, name string) (*types.HostDatastoreBro } tctx, tcancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer tcancel() - info, err := task.WaitForResult(tctx, nil) + info, err := task.WaitForResultEx(tctx, nil) if err != nil { return nil, err } diff --git a/vsphere/internal/helper/folder/folder_helper.go b/vsphere/internal/helper/folder/folder_helper.go index 96063dc18..e1dc25e53 100644 --- a/vsphere/internal/helper/folder/folder_helper.go +++ b/vsphere/internal/helper/folder/folder_helper.go @@ -296,7 +296,7 @@ func MoveObjectTo(ref types.ManagedObjectReference, folder *object.Folder) error } tctx, tcancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer tcancel() - return task.Wait(tctx) + return task.WaitEx(tctx) } // FromPath takes a relative folder path, an object type, and an optional diff --git a/vsphere/internal/helper/hostsystem/host_system_helper.go b/vsphere/internal/helper/hostsystem/host_system_helper.go index 552ba896b..9068fe4d3 100644 --- a/vsphere/internal/helper/hostsystem/host_system_helper.go +++ b/vsphere/internal/helper/hostsystem/host_system_helper.go @@ -139,7 +139,7 @@ func EnterMaintenanceMode(host *object.HostSystem, timeout time.Duration, evacua return err } - err = task.Wait(ctx) + err = task.WaitEx(ctx) if err != nil { return err } @@ -176,7 +176,7 @@ func ExitMaintenanceMode(host *object.HostSystem, timeout time.Duration) error { return err } - err = task.Wait(ctx) + err = task.WaitEx(ctx) if err != nil { return err } diff --git a/vsphere/internal/helper/resourcepool/resource_pool_helper.go b/vsphere/internal/helper/resourcepool/resource_pool_helper.go index e4b150a2b..1debab3f3 100644 --- a/vsphere/internal/helper/resourcepool/resource_pool_helper.go +++ b/vsphere/internal/helper/resourcepool/resource_pool_helper.go @@ -192,7 +192,7 @@ func Delete(rp *object.ResourcePool) error { if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } // MoveIntoResourcePool moves a virtual machine, resource pool, or diff --git a/vsphere/internal/helper/storagepod/storage_pod_helper.go b/vsphere/internal/helper/storagepod/storage_pod_helper.go index 9e03f7490..f8ca01d84 100644 --- a/vsphere/internal/helper/storagepod/storage_pod_helper.go +++ b/vsphere/internal/helper/storagepod/storage_pod_helper.go @@ -128,7 +128,7 @@ func ApplyDRSConfiguration(client *govmomi.Client, pod *object.StoragePod, spec if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } // Rename renames a StoragePod. @@ -140,7 +140,7 @@ func Rename(pod *object.StoragePod, name string) error { if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } // MoveToFolder is a complex method that moves a StoragePod to a given relative @@ -173,7 +173,7 @@ func Delete(pod *object.StoragePod) error { if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } // StorageDRSEnabled checks a StoragePod to see if Storage DRS is enabled. @@ -402,7 +402,7 @@ func applySDRS(client *govmomi.Client, placement *types.StoragePlacementResult, if err != nil { return nil, err } - result, err := task.WaitForResult(ctx, nil) + result, err := task.WaitForResultEx(ctx, nil) if err != nil { // Provide a friendly error message for timeouts if ctx.Err() == context.DeadlineExceeded { diff --git a/vsphere/internal/helper/vappcontainer/vappcontainer_helper.go b/vsphere/internal/helper/vappcontainer/vappcontainer_helper.go index fbf48cd54..dd0927633 100644 --- a/vsphere/internal/helper/vappcontainer/vappcontainer_helper.go +++ b/vsphere/internal/helper/vappcontainer/vappcontainer_helper.go @@ -95,7 +95,7 @@ func Delete(vc *object.VirtualApp) error { if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } // HasChildren checks to see if a vApp container has any child items (virtual diff --git a/vsphere/internal/helper/viapi/vim_helper.go b/vsphere/internal/helper/viapi/vim_helper.go index 52f1a6bff..94fac134f 100644 --- a/vsphere/internal/helper/viapi/vim_helper.go +++ b/vsphere/internal/helper/viapi/vim_helper.go @@ -111,7 +111,7 @@ func RenameObject(client *govmomi.Client, ref types.ManagedObjectReference, new t := object.NewTask(client.Client, res.Returnval) tctx, tcancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer tcancel() - return t.Wait(tctx) + return t.WaitEx(tctx) } // ValidateVirtualCenter ensures that the client is connected to vCenter. diff --git a/vsphere/internal/helper/virtualdisk/virtual_disk_helper.go b/vsphere/internal/helper/virtualdisk/virtual_disk_helper.go index d53798257..89fc58c34 100644 --- a/vsphere/internal/helper/virtualdisk/virtual_disk_helper.go +++ b/vsphere/internal/helper/virtualdisk/virtual_disk_helper.go @@ -82,7 +82,7 @@ func Move(client *govmomi.Client, srcPath string, srcDC *object.Datacenter, dstP } tctx, tcancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return "", err } log.Printf("[DEBUG] Virtual disk %q in datacenter %s successfully moved to destination %s%s", @@ -137,7 +137,7 @@ func Delete(client *govmomi.Client, name string, dc *object.Datacenter) error { } tctx, tcancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return err } log.Printf("[DEBUG] Virtual disk %q in datacenter %s deleted successfully", name, dc) diff --git a/vsphere/internal/helper/virtualmachine/virtual_machine_helper.go b/vsphere/internal/helper/virtualmachine/virtual_machine_helper.go index 87f3d6650..55c0a7242 100644 --- a/vsphere/internal/helper/virtualmachine/virtual_machine_helper.go +++ b/vsphere/internal/helper/virtualmachine/virtual_machine_helper.go @@ -514,7 +514,7 @@ func Create(c *govmomi.Client, f *object.Folder, s types.VirtualMachineConfigSpe } tctx, tcancel := context.WithTimeout(context.Background(), timeout) defer tcancel() - result, err := task.WaitForResult(tctx, nil) + result, err := task.WaitForResultEx(tctx, nil) if err != nil { return nil, err } @@ -535,7 +535,7 @@ func Clone(c *govmomi.Client, src *object.VirtualMachine, f *object.Folder, name } return nil, err } - result, err := task.WaitForResult(ctx, nil) + result, err := task.WaitForResultEx(ctx, nil) if err != nil { if ctx.Err() == context.DeadlineExceeded { err = errors.New("timeout waiting for clone to complete") @@ -663,7 +663,7 @@ func Customize(vm *object.VirtualMachine, spec types.CustomizationSpec) error { } tctx, tcancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer tcancel() - return task.Wait(tctx) + return task.WaitEx(tctx) } // PowerOn wraps powering on a VM and the waiting for the subsequent task. @@ -707,7 +707,7 @@ powerLoop: log.Printf("[DEBUG] Failed to submit PowerOn task for vm %q. Error: %s", vmPath, err) return fmt.Errorf("failed to submit poweron task for vm %q: %s", vmPath, err) } - err = task.Wait(ctx) + err = task.WaitEx(ctx) if err != nil { if err.Error() == "The operation is not allowed in the current state." { log.Printf("[DEBUG] vm %q cannot be powered on in the current state", vmPath) @@ -738,7 +738,7 @@ func PowerOff(vm *object.VirtualMachine) error { } tctx, tcancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer tcancel() - return task.Wait(tctx) + return task.WaitEx(tctx) } // ShutdownGuest wraps the graceful shutdown of a guest VM, and then waiting an @@ -839,7 +839,7 @@ func Reconfigure(vm *object.VirtualMachine, spec types.VirtualMachineConfigSpec, } tctx, tcancel := context.WithTimeout(context.Background(), timeout) defer tcancel() - return task.Wait(tctx) + return task.WaitEx(tctx) } // Relocate wraps the Relocate task and the subsequent waiting for the task to @@ -852,7 +852,7 @@ func Relocate(vm *object.VirtualMachine, spec types.VirtualMachineRelocateSpec, if err != nil { return err } - if err := task.Wait(ctx); err != nil { + if err := task.WaitEx(ctx); err != nil { // Provide a friendly error message if we timed out waiting for the migration. if ctx.Err() == context.DeadlineExceeded { return errors.New("timeout waiting for migration to complete") @@ -873,7 +873,7 @@ func Destroy(vm *object.VirtualMachine) error { } tctx, tcancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) defer tcancel() - return task.Wait(tctx) + return task.WaitEx(tctx) } // MOIDForUUIDResult is a struct that holds a virtual machine UUID -> MOID @@ -1049,7 +1049,7 @@ func SetHardwareVersion(vm *object.VirtualMachine, target int) error { if err != nil { return err } - _, err = task.WaitForResult(ctx, nil) + _, err = task.WaitForResultEx(ctx, nil) return err } diff --git a/vsphere/internal/helper/vsanclient/vsan_client_helper.go b/vsphere/internal/helper/vsanclient/vsan_client_helper.go index 3903d21c3..15e894e73 100644 --- a/vsphere/internal/helper/vsanclient/vsan_client_helper.go +++ b/vsphere/internal/helper/vsanclient/vsan_client_helper.go @@ -22,7 +22,7 @@ func Reconfigure(vsanClient *vsan.Client, cluster vimtypes.ManagedObjectReferenc if err != nil { return err } - return task.Wait(ctx) + return task.WaitEx(ctx) } func GetVsanConfig(vsanClient *vsan.Client, cluster vimtypes.ManagedObjectReference) (*vsantypes.VsanConfigInfoEx, error) { @@ -45,7 +45,7 @@ func ConvertToStretchedCluster(vsanClient *vsan.Client, client *govmomi.Client, } task := object.NewTask(client.Client, res.Returnval) - return task.Wait(ctx) + return task.WaitEx(ctx) } // removing the witness host automatically disables stretched cluster. @@ -60,7 +60,7 @@ func RemoveWitnessHost(vsanClient *vsan.Client, client *govmomi.Client, req vsan } task := object.NewTask(client.Client, res.Returnval) - return task.Wait(ctx) + return task.WaitEx(ctx) } func GetWitnessHosts(vsanClient *vsan.Client, cluster vimtypes.ManagedObjectReference) (*vsantypes.VSANVcGetWitnessHostsResponse, error) { diff --git a/vsphere/internal/helper/vsansystem/vsansystem_helper.go b/vsphere/internal/helper/vsansystem/vsansystem_helper.go index 8f8f04573..ed6ca6956 100644 --- a/vsphere/internal/helper/vsansystem/vsansystem_helper.go +++ b/vsphere/internal/helper/vsansystem/vsansystem_helper.go @@ -53,7 +53,7 @@ func RemoveDiskMapping(client *govmomi.Client, host *object.HostSystem, hvs *obj return err } task := object.NewTask(client.Client, resp.Returnval) - if err := task.Wait(ctx); err != nil { + if err := task.WaitEx(ctx); err != nil { return err } } else { @@ -67,7 +67,7 @@ func RemoveDiskMapping(client *govmomi.Client, host *object.HostSystem, hvs *obj return err } task := object.NewTask(client.Client, resp.Returnval) - if err := task.Wait(ctx); err != nil { + if err := task.WaitEx(ctx); err != nil { return err } } @@ -89,5 +89,5 @@ func InitializeDisks(client *govmomi.Client, host *object.HostSystem, hvs *objec return err } task := object.NewTask(client.Client, resp.Returnval) - return task.Wait(ctx) + return task.WaitEx(ctx) } diff --git a/vsphere/resource_vsphere_distributed_port_group.go b/vsphere/resource_vsphere_distributed_port_group.go index 2b2c8e301..013912d43 100644 --- a/vsphere/resource_vsphere_distributed_port_group.go +++ b/vsphere/resource_vsphere_distributed_port_group.go @@ -77,7 +77,7 @@ func resourceVSphereDistributedPortGroupCreate(d *schema.ResourceData, meta inte } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - info, err := task.WaitForResult(tctx, nil) + info, err := task.WaitForResultEx(tctx, nil) if err != nil { return fmt.Errorf("error waiting for portgroup creation to complete: %s", err) } @@ -173,7 +173,7 @@ func resourceVSphereDistributedPortGroupUpdate(d *schema.ResourceData, meta inte } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return fmt.Errorf("error waiting for portgroup update to complete: %s", err) } @@ -213,7 +213,7 @@ func resourceVSphereDistributedPortGroupDelete(d *schema.ResourceData, meta inte } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return fmt.Errorf("error waiting for portgroup deletion to complete: %s", err) } return nil diff --git a/vsphere/resource_vsphere_distributed_virtual_switch.go b/vsphere/resource_vsphere_distributed_virtual_switch.go index d0f3e14b7..ed6e37e97 100644 --- a/vsphere/resource_vsphere_distributed_virtual_switch.go +++ b/vsphere/resource_vsphere_distributed_virtual_switch.go @@ -86,7 +86,7 @@ func resourceVSphereDistributedVirtualSwitchCreate(d *schema.ResourceData, meta } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - info, err := task.WaitForResult(tctx, nil) + info, err := task.WaitForResultEx(tctx, nil) if err != nil { return fmt.Errorf("error waiting for DVS creation to complete: %s", err) } @@ -278,7 +278,7 @@ func resourceVSphereDistributedVirtualSwitchDelete(d *schema.ResourceData, meta } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return fmt.Errorf("error waiting for DVS deletion to complete: %s", err) } diff --git a/vsphere/resource_vsphere_file.go b/vsphere/resource_vsphere_file.go index 1a128cc51..8a6059e40 100644 --- a/vsphere/resource_vsphere_file.go +++ b/vsphere/resource_vsphere_file.go @@ -344,7 +344,7 @@ func resourceVSphereFileUpdate(d *schema.ResourceData, meta interface{}) error { if err != nil { return err } - _, err = task.WaitForResult(context.TODO(), nil) + _, err = task.WaitForResultEx(context.TODO(), nil) if err != nil { return err } @@ -413,7 +413,7 @@ func deleteFile(client *govmomi.Client, f *file) error { return err } - _, err = task.WaitForResult(context.TODO(), nil) + _, err = task.WaitForResultEx(context.TODO(), nil) if err != nil { return err } @@ -427,7 +427,7 @@ func deleteFile(client *govmomi.Client, f *file) error { return err } - _, err = task.WaitForResult(context.TODO(), nil) + _, err = task.WaitForResultEx(context.TODO(), nil) if err != nil { return err } diff --git a/vsphere/resource_vsphere_folder.go b/vsphere/resource_vsphere_folder.go index e771ed4c7..fda559374 100644 --- a/vsphere/resource_vsphere_folder.go +++ b/vsphere/resource_vsphere_folder.go @@ -261,7 +261,7 @@ func resourceVSphereFolderUpdate(d *schema.ResourceData, meta interface{}) error } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return fmt.Errorf("error on waiting for move task completion: %s", err) } } @@ -296,7 +296,7 @@ func resourceVSphereFolderDelete(d *schema.ResourceData, meta interface{}) error } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return fmt.Errorf("error on waiting for deletion task completion: %s", err) } diff --git a/vsphere/resource_vsphere_folder_test.go b/vsphere/resource_vsphere_folder_test.go index 6cb5b27be..9208d632d 100644 --- a/vsphere/resource_vsphere_folder_test.go +++ b/vsphere/resource_vsphere_folder_test.go @@ -647,7 +647,7 @@ func testAccResourceVSphereFolderDeleteOOB(s *terraform.State) error { } tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - if err := task.Wait(tctx); err != nil { + if err := task.WaitEx(tctx); err != nil { return err } } diff --git a/vsphere/resource_vsphere_host.go b/vsphere/resource_vsphere_host.go index 32396c0ff..25ae4ab8f 100644 --- a/vsphere/resource_vsphere_host.go +++ b/vsphere/resource_vsphere_host.go @@ -179,7 +179,7 @@ func resourceVsphereHostCreate(d *schema.ResourceData, meta interface{}) error { } p := property.DefaultCollector(client.Client) - res, err := gtask.Wait(context.TODO(), task.Reference(), p, nil) + res, err := gtask.WaitEx(context.TODO(), task.Reference(), p, nil) if err != nil { return fmt.Errorf("host addition failed. %s", err) } @@ -508,7 +508,7 @@ func resourceVsphereHostDelete(d *schema.ResourceData, meta interface{}) error { } } p := property.DefaultCollector(client.Client) - _, err = gtask.Wait(context.TODO(), task.Reference(), p, nil) + _, err = gtask.WaitEx(context.TODO(), task.Reference(), p, nil) if err != nil { return fmt.Errorf("error while waiting for host (%s) to be removed: %s", hostID, err) } @@ -604,7 +604,7 @@ func resourceVSphereHostUpdateCluster(d *schema.ResourceData, meta, _, newVal in return fmt.Errorf("error while moving HostSystem with ID %s to new cluster. Error: %s", hostID, err) } p := property.DefaultCollector(client.Client) - _, err = gtask.Wait(context.TODO(), task.Reference(), p, nil) + _, err = gtask.WaitEx(context.TODO(), task.Reference(), p, nil) if err != nil { return fmt.Errorf("error while moving host to new cluster (%s): %s", newClusterID, err) } @@ -633,7 +633,7 @@ func resourceVSphereHostReconnect(d *schema.ResourceData, meta interface{}) erro } p := property.DefaultCollector(client.Client) - _, err = gtask.Wait(context.TODO(), task.Reference(), p, nil) + _, err = gtask.WaitEx(context.TODO(), task.Reference(), p, nil) if err != nil { return fmt.Errorf("error while reconnecting host(%s): %s", hostID, err) } @@ -663,7 +663,7 @@ func resourceVSphereHostDisconnect(d *schema.ResourceData, meta interface{}) err } p := property.DefaultCollector(client.Client) - _, err = gtask.Wait(context.TODO(), task.Reference(), p, nil) + _, err = gtask.WaitEx(context.TODO(), task.Reference(), p, nil) if err != nil { return fmt.Errorf("error while disconnecting host(%s): %s", hostID, err) } diff --git a/vsphere/resource_vsphere_virtual_disk.go b/vsphere/resource_vsphere_virtual_disk.go index 49a3fec20..ca90f1181 100644 --- a/vsphere/resource_vsphere_virtual_disk.go +++ b/vsphere/resource_vsphere_virtual_disk.go @@ -269,7 +269,7 @@ func resourceVSphereVirtualDiskRead(d *schema.ResourceData, meta interface{}) er return err } - info, err := task.WaitForResult(context.TODO(), nil) + info, err := task.WaitForResultEx(context.TODO(), nil) if err != nil { if info != nil && info.Error != nil { _, ok := info.Error.Fault.(*types.FileNotFound) @@ -368,7 +368,7 @@ func resourceVSphereVirtualDiskDelete(d *schema.ResourceData, meta interface{}) return err } - _, err = task.WaitForResult(context.TODO(), nil) + _, err = task.WaitForResultEx(context.TODO(), nil) if err != nil { log.Printf("[INFO] Failed to delete disk: %v", err) return err @@ -415,7 +415,7 @@ func createHardDisk(client *govmomi.Client, size int, diskPath string, diskType return err } - _, err = task.WaitForResult(context.TODO(), nil) + _, err = task.WaitForResultEx(context.TODO(), nil) if err != nil { log.Printf("[INFO] Failed to create disk: %v", err) return err @@ -466,7 +466,7 @@ func searchForDirectory(client *govmomi.Client, datacenter string, datastore str return err } - info, err := task.WaitForResult(context.TODO(), nil) + info, err := task.WaitForResultEx(context.TODO(), nil) if err != nil { if info != nil && info.Error != nil { _, ok := info.Error.Fault.(*types.FileNotFound) diff --git a/vsphere/resource_vsphere_virtual_machine_snapshot.go b/vsphere/resource_vsphere_virtual_machine_snapshot.go index 790c79743..83a235b5e 100644 --- a/vsphere/resource_vsphere_virtual_machine_snapshot.go +++ b/vsphere/resource_vsphere_virtual_machine_snapshot.go @@ -77,7 +77,7 @@ func resourceVSphereVirtualMachineSnapshotCreate(d *schema.ResourceData, meta in tctx, tcancel := context.WithTimeout(context.Background(), defaultAPITimeout) defer tcancel() - taskInfo, err := task.WaitForResult(tctx, nil) + taskInfo, err := task.WaitForResultEx(tctx, nil) if err != nil { log.Printf("[DEBUG] Error While waiting for the Task for Create Snapshot: %v", err) return fmt.Errorf(" Error While waiting for the Task for Create Snapshot: %s", err) @@ -124,7 +124,7 @@ func resourceVSphereVirtualMachineSnapshotDelete(d *schema.ResourceData, meta in } log.Printf("[DEBUG] Task created for Delete Snapshot: %v", task) - err = task.Wait(ctx) + err = task.WaitEx(ctx) if err != nil { log.Printf("[DEBUG] Error While waiting for the Task of Delete Snapshot: %v", err) return fmt.Errorf("Error While waiting for the Task of Delete Snapshot: %s", err)