hashicorp / packer-plugin-vsphere

Packer plugin for VMware vSphere Builder
https://www.packer.io/docs/builders/vsphere
Mozilla Public License 2.0
94 stars 91 forks source link

fix: 224 #312

Closed saikirandusari closed 10 months ago

saikirandusari commented 10 months ago

Use the folder defined in the post-processor packer config as a remoteFolder when marking the VM as a template.

post-processors {
      post-processor "vsphere-template"{
          host              = "vcenter.example.com"
          insecure        = false
          username       = "admin@vsphere.local"
          password       = "testpwd"
          datacenter     = "dc-01"   
          folder              = "/templates/"
      }
}

This PR resolves open issue #224

Closes #224

saikirandusari commented 10 months ago

CI is failing. Please review the errors. :)

tenthirtyam Code fix applied. Please review and approve to run the tests.

tenthirtyam commented 10 months ago

image

tenthirtyam commented 10 months ago

@lbajolet-hashicorp - I addressed the the issue mentioned in https://github.com/hashicorp/packer-plugin-vsphere/pull/312#issuecomment-1770507526 and it's moved forward but Go Validate action is failing on the lint and gofmt steps but those don't seem to be related to this change.


  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/sys@v0.6.0/PATENTS: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/sys@v0.6.0/.gitignore: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/sys@v0.6.0/go.mod: Cannot open: File exists
  /usr/bin/tar: Exiting with failure status due to previous errors
  Warning: Failed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2
  Cache not found for input keys: golangci-lint.cache-2807-48db04078f992043765d66fe773ddecb962b11e2, golangci-lint.cache-2807-
  Finding needed golangci-lint version...
  Installation mode: binary
  Installing golangci-lint binary v1.53.3...
  Downloading binary https://github.com/golangci/golangci-lint/releases/download/v1.53.3/golangci-lint-1.53.3-linux-amd64.tar.gz ...
  Writing patch to /tmp/tmp-1808-uienO06vLFpm/pull.patch
  /usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/093b28de-207f-4e2b-9661-26b1a7dc5091
  Installed golangci-lint into /home/runner/golangci-lint-1.53.3-linux-amd64/golangci-lint in 599ms
  Prepared env in 13378ms
lbajolet-hashicorp commented 10 months ago

Hey @tenthirtyam,

The lint/check failures were because the indentation does not match what go expects, in general it's recommended to use tabs for indentation, and your last update changed that in favour of spaces, hence the failure.

The last reroll I pushed makes the tests all green, I'll review this change now and if it looks good to me, I'll merge this PR.

Thanks for the ping!

tenthirtyam commented 10 months ago

Many thanks, @lbajolet-hashicorp!

saikirandusari commented 10 months ago

Thanks @lbajolet-hashicorp and @tenthirtyam for sorting this PR