Skip to content

Commit

Permalink
chore: correct typos and markdown (#370)
Browse files Browse the repository at this point in the history
Technical Debt:

- Correct misspellings and grammar.
- Correct version of Go in `README.md` to match `go.mod`.
- Correct markdownlint issues in `CHANGELOG.md`.

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
Ryan Johnson authored Mar 5, 2024
1 parent fbd61cf commit acb47ad
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 36 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
Please refer to [releases](https://github.com/hashicorp/packer-plugin-vsphere/releases) for the latest CHANGELOG information.

---

## 1.0.2 (October 18, 2021)

### NOTES:
### NOTES

Support for the HCP Packer registry is currently in beta and requires
Packer v1.7.7 [GH-115] [GH-120]

### FEATURES:
### FEATURES

* Add HCP Packer registry image metadata to all artifacts. [GH-115]
[GH-120]

## IMPROVEMENTS:
## IMPROVEMENTS

* Add `floppy_content` parameter, which is similar to `http_content` and
`cd_content`, but for floppy. [GH-117]
* Add skip_import parameter in content_library_destination configuration.
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ The plugin includes two builders which are able to create images, depending on y

Learn more: [VMware Product Lifecycle Matrix][vmware-product-lifecycle-matrix]

> **Note**
>
> This plugin requires API write access and is therefore not supported for use with a free VMware vSphere Hypervisor license.
* [Go 1.18][golang-install]
* [Go 1.19][golang-install]

Required if building the plugin.

Expand Down Expand Up @@ -50,7 +46,7 @@ packer {

#### Manual Installation

You can download [pre-built binary releases][releases-vsphere-plugin] of the plugin on GitHub. Once you have downloaded the latest release archive for your target operating system and architecture, uncompress to retrieve the plugin binary file for your platform.
You can download [pre-built binary releases][releases-vsphere-plugin] of the plugin on GitHub. Once you have downloaded the latest release archive for your target operating system and architecture, extract the release archive to retrieve the plugin binary file for your platform.

To install the downloaded plugin, please follow the Packer documentation on [installing a plugin][docs-packer-plugin-install].

Expand Down
2 changes: 1 addition & 1 deletion builder/vsphere/clone/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestCloneConfig_Timeout(t *testing.T) {
warns, err := conf.Prepare(raw)
testConfigOk(t, warns, err)
if conf.ShutdownConfig.Timeout != 3*time.Minute {
t.Fatalf("shutdown_timeout sould be equal 3 minutes, got %v", conf.ShutdownConfig.Timeout)
t.Fatalf("shutdown_timeout should be equal 3 minutes, got %v", conf.ShutdownConfig.Timeout)
}
}

Expand Down
4 changes: 2 additions & 2 deletions builder/vsphere/clone/step_clone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ func TestCreateConfig_Prepare(t *testing.T) {
errs := c.config.Prepare()
if c.fail {
if len(errs) == 0 {
t.Fatalf("Config preprare should fail")
t.Fatalf("Config prepare should fail")
}
if errs[0].Error() != c.expectedErrMsg {
t.Fatalf("Expected error message: %s but was '%s'", c.expectedErrMsg, errs[0].Error())
}
} else {
if len(errs) != 0 {
t.Fatalf("Config preprare should not fail: %s", errs[0])
t.Fatalf("Config prepare should not fail: %s", errs[0])
}
}
})
Expand Down
4 changes: 2 additions & 2 deletions builder/vsphere/clone/step_customize.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

var (
errCustomizeOptionMutalExclusive = fmt.Errorf("Only one of `linux_options`, `windows_options`, `windows_sysprep_file` can be set")
errCustomizeOptionMutualExclusive = fmt.Errorf("only one of `linux_options`, `windows_options`, `windows_sysprep_file` can be set")
windowsSysprepFileDeprecatedMessage = "`windows_sysprep_file` is deprecated and will be removed in a future release. please use `windows_sysprep_text`."
)

Expand Down Expand Up @@ -168,7 +168,7 @@ func (c *CustomizeConfig) Prepare() ([]string, []error) {
}

if options_number > 1 {
errs = append(errs, errCustomizeOptionMutalExclusive)
errs = append(errs, errCustomizeOptionMutualExclusive)
} else if options_number == 0 {
errs = append(errs, fmt.Errorf("One of `linux_options`, `windows_options`, `windows_sysprep_file` must be set"))
}
Expand Down
2 changes: 1 addition & 1 deletion builder/vsphere/clone/step_customize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestSysprepFieldsMutuallyExclusive(t *testing.T) {
}

// Expected error message
expectedError := errCustomizeOptionMutalExclusive
expectedError := errCustomizeOptionMutualExclusive
_, errors := config.Prepare()

// Make sure we only received on error
Expand Down
2 changes: 1 addition & 1 deletion builder/vsphere/common/hcp_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func GetVMMetadata(vm *driver.VirtualMachineDriver, state multistep.StateBag) ma
p := vm.NewResourcePool(info.ResourcePool)
poolPath, err := p.Path()
if err == nil && poolPath != "" {
labels["resurce_pool"] = poolPath
labels["resource_pool"] = poolPath
}
}

Expand Down
2 changes: 1 addition & 1 deletion builder/vsphere/common/step_wait_for_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ loop:

if prevIp == "" || prevIp != ip {
if prevIp == "" {
log.Printf("VM IP aquired: %s", ip)
log.Printf("VM IP acquired: %s", ip)
} else {
log.Printf("VM IP changed from %s to %s", prevIp, ip)
}
Expand Down
4 changes: 2 additions & 2 deletions builder/vsphere/driver/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAddStorageDevices(t *testing.T) {
noExistingDevices := object.VirtualDeviceList{}
storageConfigSpec, err := config.AddStorageDevices(noExistingDevices)
if err != nil {
t.Fatalf("unexpected erro: %q", err.Error())
t.Fatalf("unexpected error: %q", err.Error())
}
if len(storageConfigSpec) != 3 {
t.Fatalf("Expecting VirtualDeviceList to have 3 storage devices but had %d", len(storageConfigSpec))
Expand All @@ -41,7 +41,7 @@ func TestAddStorageDevices(t *testing.T) {

storageConfigSpec, err = config.AddStorageDevices(existingDevices)
if err != nil {
t.Fatalf("unexpected erro: %q", err.Error())
t.Fatalf("unexpected error: %q", err.Error())
}
if len(storageConfigSpec) != 3 {
t.Fatalf("Expecting VirtualDeviceList to have 3 storage devices but had %d", len(storageConfigSpec))
Expand Down
2 changes: 1 addition & 1 deletion builder/vsphere/driver/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (l *LibraryFilePath) Validate() error {
l.path = strings.TrimLeft(l.path, "/")
parts := strings.Split(l.path, "/")
if len(parts) != 3 {
return fmt.Errorf("Not a valid Content Library File path. The path must contain the nanmes for the library, item and file.")
return fmt.Errorf("invalid content library file path. path must contain the names for the library, item, and file.")
}
return nil
}
Expand Down
8 changes: 4 additions & 4 deletions builder/vsphere/driver/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ func (d *VCenterDriver) PreCleanVM(ui packersdk.Ui, vmPath string, force bool, v
// covert to a vm if it is a template so it can be deleted
isTemplate, err := vm.IsTemplate()
if err != nil {
return fmt.Errorf("error determing if the vm is a template%s: %v", vmPath, err)
return fmt.Errorf("error determining if the vm is a template%s: %v", vmPath, err)
} else if isTemplate {
ui.Say(fmt.Sprintf("%s is a template, attempting to convert it to a vm", vmPath))
err := vm.ConvertToVirtualMachine(vsphereCluster, vsphereHost, vsphereResourcePool)
if err != nil {
return fmt.Errorf("error convertng template back to virtual machine for cleanup %s: %v", vmPath, err)
return fmt.Errorf("error converting template back to virtual machine for cleanup %s: %v", vmPath, err)
}
}

Expand Down Expand Up @@ -316,7 +316,7 @@ func (vm *VirtualMachineDriver) FloppyDevices() (object.VirtualDeviceList, error
func (vm *VirtualMachineDriver) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) {
folder, err := vm.driver.FindFolder(config.Folder)
if err != nil {
return nil, fmt.Errorf("Error finding filder: %s", err)
return nil, fmt.Errorf("Error finding folder: %s", err)
}

var relocateSpec types.VirtualMachineRelocateSpec
Expand Down Expand Up @@ -1062,7 +1062,7 @@ func findNetwork(network string, host string, d *VCenterDriver) (object.NetworkR
return object.NewNetwork(d.client.Client, i.Network[0]), nil
}

return nil, fmt.Errorf("Couldn't find network; 'host' and 'network' not specified. At least one of the two must be specified.")
return nil, fmt.Errorf("error finding network; 'host' and 'network' not specified. at least one of the two must be specified.")
}

func newVGPUProfile(vGPUProfile string) types.VirtualPCIPassthrough {
Expand Down
6 changes: 3 additions & 3 deletions builder/vsphere/driver/vm_clone_acc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestVMAcc_clone(t *testing.T) {
t.Fatalf("Cannot find template vm '%v': %v", templateName, err)
}

log.Printf("[DEBUG] Clonning VM")
log.Printf("[DEBUG] Cloning VM")
vm, err := template.Clone(context.TODO(), tc.config)
if err != nil {
t.Fatalf("Cannot clone vm '%v': %v", templateName, err)
Expand Down Expand Up @@ -170,7 +170,7 @@ func configureCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) {

memoryHotAdd := vmInfo.Config.MemoryHotAddEnabled
if *memoryHotAdd != hwConfig.MemoryHotAddEnabled {
t.Errorf("VM should have Memroy hot add set to %v, got %v", hwConfig.MemoryHotAddEnabled, memoryHotAdd)
t.Errorf("VM should have memory hot add set to %v, got %v", hwConfig.MemoryHotAddEnabled, memoryHotAdd)
}
}

Expand Down Expand Up @@ -253,7 +253,7 @@ func startAndStopCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) {
log.Printf("[DEBUG] Waiting max 1m0s for shutdown to complete")
err = vm.WaitForShutdown(context.TODO(), 1*time.Minute)
if err != nil {
t.Fatalf("Failed to wait for giest shutdown: %v", err)
t.Fatalf("Failed to wait for guest shutdown: %v", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion builder/vsphere/iso/builder_acc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func checkNetworkCard(name string) error {
return fmt.Errorf("Cannot find the network card")
}
if len(netCards) > 1 {
return fmt.Errorf("Found several network catds")
return fmt.Errorf("Found several network cards")
}
if _, ok := netCards[0].(*types.VirtualVmxnet3); !ok {
return fmt.Errorf("The network card type is not the expected one (vmxnet3)")
Expand Down
6 changes: 3 additions & 3 deletions builder/vsphere/iso/step_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestCreateConfig_Prepare(t *testing.T) {
},
}
if errs := config.Prepare(); len(errs) != 0 {
t.Fatalf("Config preprare should not fail: %s", errs[0])
t.Fatalf("Config prepare should not fail: %s", errs[0])
}
if config.GuestOSType != "otherGuest" {
t.Fatalf("GuestOSType should default to 'otherGuest'")
Expand Down Expand Up @@ -185,14 +185,14 @@ func TestCreateConfig_Prepare(t *testing.T) {
errs := c.config.Prepare()
if c.fail {
if len(errs) == 0 {
t.Fatalf("Config preprare should fail")
t.Fatalf("Config prepare should fail")
}
if errs[0].Error() != c.expectedErrMsg {
t.Fatalf("Expected error message: %s but was '%s'", c.expectedErrMsg, errs[0].Error())
}
} else {
if len(errs) != 0 {
t.Fatalf("Config preprare should not fail: %s", errs[0])
t.Fatalf("Config prepare should not fail: %s", errs[0])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion post-processor/vsphere/artifact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ func TestArtifact_ImplementsArtifact(t *testing.T) {
func TestArtifact_Id(t *testing.T) {
artifact := NewArtifact("datastore", "vmfolder", "vmname", nil)
if artifact.Id() != "datastore::vmfolder::vmname" {
t.Fatalf("must return datastore, vmfolder and vmname splitted by :: as Id")
t.Fatalf("must return datastore, vmfolder, and vmname split by :: as id")
}
}
8 changes: 4 additions & 4 deletions post-processor/vsphere/post-processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestGenerateURI_Basic(t *testing.T) {
}
expected_uri := "vi://me:notpassword@myhost/mydc/host/mycluster"
if uri.String() != expected_uri {
t.Fatalf("URI did not match. Recieved: %s. Expected: %s", uri, expected_uri)
t.Fatalf("URI did not match. Received: %s. Expected: %s", uri, expected_uri)
}
}

Expand All @@ -73,7 +73,7 @@ func TestGenerateURI_PasswordEscapes(t *testing.T) {

cases := []escapeCases{
{`this has spaces`, `this%20has%20spaces`},
{`exclaimation_!`, `exclaimation_%21`},
{`exclamation_!`, `exclamation_%21`},
{`hash_#_dollar_$`, `hash_%23_dollar_$`},
{`ampersand_&awesome`, `ampersand_&awesome`},
{`single_quote_'_and_another_'`, `single_quote_%27_and_another_%27`},
Expand All @@ -100,7 +100,7 @@ func TestGenerateURI_PasswordEscapes(t *testing.T) {
expected_uri := fmt.Sprintf("vi://me:%s@myhost/mydc/host/mycluster", escapeCase.Expected)

if uri.String() != expected_uri {
t.Fatalf("URI did not match. Recieved: %s. Expected: %s", uri, expected_uri)
t.Fatalf("URI did not match. Received: %s. Expected: %s", uri, expected_uri)
}
}
}
Expand All @@ -119,7 +119,7 @@ func TestGetEncodedPassword(t *testing.T) {
t.Fatalf("Password is set but test said it is not")
}
if encoded != expected {
t.Fatalf("Should have successfully gotten encoded password. Expected: %s; recieved: %s", expected, encoded)
t.Fatalf("Should have successfully gotten encoded password. Expected: %s; received: %s", expected, encoded)
}

// There is no password
Expand Down

0 comments on commit acb47ad

Please sign in to comment.