Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootcommand/boot_command_ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ type waitExpression struct {
d time.Duration
}

// Do waits the amount of time described by the expression. It is cancellable
// Do waits the amount of time described by the expression. It is cancelable
// through the context.
func (w *waitExpression) Do(ctx context.Context, driver BCDriver) error {
driver.Flush()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- `ssh_interface` (string) - One of `public_ip`, `private_ip`, `public_dns`, or `private_dns`. If
set, either the public IP address, private IP address, public DNS name
or private DNS name will used as the host for SSH. The default behaviour
or private DNS name will used as the host for SSH. The default behavior
if inside a VPC is to use the public IP address if available, otherwise
the private IP address will be used. If not in a VPC the public DNS name
will be used. Also works for WinRM.
Expand Down
2 changes: 1 addition & 1 deletion communicator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ var (
type SSHInterface struct {
// One of `public_ip`, `private_ip`, `public_dns`, or `private_dns`. If
// set, either the public IP address, private IP address, public DNS name
// or private DNS name will used as the host for SSH. The default behaviour
// or private DNS name will used as the host for SSH. The default behavior
// if inside a VPC is to use the public IP address if available, otherwise
// the private IP address will be used. If not in a VPC the public DNS name
// will be used. Also works for WinRM.
Expand Down
6 changes: 3 additions & 3 deletions communicator/step_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type StepConnect struct {
}

func (s *StepConnect) pause(pauseLen time.Duration, ctx context.Context) bool {
// Use a select to determine if we get cancelled during the wait
// Use a select to determine if we get canceled during the wait
select {
case <-ctx.Done():
return true
Expand Down Expand Up @@ -122,8 +122,8 @@ func (s *StepConnect) Run(ctx context.Context, state multistep.StateBag) multist
if s.Config.PauseBeforeConnect > 0 {
ui.Say(fmt.Sprintf("Pausing %s before connecting...",
s.Config.PauseBeforeConnect.String()))
cancelled := s.pause(s.Config.PauseBeforeConnect, ctx)
if cancelled {
canceled := s.pause(s.Config.PauseBeforeConnect, ctx)
if canceled {
return multistep.ActionHalt
}
// After pause is complete, re-run the connect substep to make sure
Expand Down
6 changes: 3 additions & 3 deletions communicator/step_connect_ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (s *StepConnectSSH) Run(ctx context.Context, state multistep.StateBag) mult
cancel()
return multistep.ActionHalt
case <-ctx.Done():
// The step sequence was cancelled, so cancel waiting for SSH
// The step sequence was canceled, so cancel waiting for SSH
// and just start the halting process.
cancel()
log.Println("[WARN] Interrupt detected, quitting waiting for SSH.")
Expand Down Expand Up @@ -130,8 +130,8 @@ func (s *StepConnectSSH) waitForSSH(state multistep.StateBag, ctx context.Contex
if !first {
select {
case <-ctx.Done():
log.Println("[DEBUG] SSH wait cancelled. Exiting loop.")
return nil, errors.New("SSH wait cancelled")
log.Println("[DEBUG] SSH wait canceled. Exiting loop.")
return nil, errors.New("SSH wait canceled")
case <-time.After(5 * time.Second):
}
}
Expand Down
6 changes: 3 additions & 3 deletions communicator/step_connect_winrm.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (s *StepConnectWinRM) Run(ctx context.Context, state multistep.StateBag) mu
cancel()
return multistep.ActionHalt
case <-ctx.Done():
// The step sequence was cancelled, so cancel waiting for WinRM
// The step sequence was canceled, so cancel waiting for WinRM
// and just start the halting process.
cancel()
log.Println("Interrupt detected, quitting waiting for WinRM.")
Expand All @@ -101,8 +101,8 @@ func (s *StepConnectWinRM) waitForWinRM(state multistep.StateBag, ctx context.Co
if !first {
select {
case <-ctx.Done():
log.Println("[INFO] WinRM wait cancelled. Exiting loop.")
return nil, errors.New("WinRM wait cancelled")
log.Println("[INFO] WinRM wait canceled. Exiting loop.")
return nil, errors.New("WinRM wait canceled")
case <-time.After(s.Config.WinRMRetryInterval):
}
}
Expand Down
4 changes: 2 additions & 2 deletions hcl2helper/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ func HCL2ValueFromConfig(conf interface{}, configSpec map[string]hcldec.Spec) ct
// as I was working on other parts of the code at the same time.
//
// In the end, this may happen when the generated flat configs and
// the structures returned by the plugin are not synchronised, which
// the structures returned by the plugin are not synchronized, which
// causes the object spec to be out-of-sync with the data expected.
//
// Rather than letting the hcl library panic on a nil pointer problem,
// we do it here, with suggestions for users on how to potentially
// fix the problem, without needing to delve into the behaviour of
// fix the problem, without needing to delve into the behavior of
// the SDK and the HCL libraries.
if spec == nil {
panic(`The converted value failed to have its spec inferred from it, and will panic later down the process.
Expand Down
4 changes: 2 additions & 2 deletions multistep/basic_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type runState int32
const (
stateIdle runState = iota
stateRunning
stateCancelling
stateCanceling
)

// BasicRunner is a Runner that just runs the given slice of steps.
Expand Down Expand Up @@ -65,7 +65,7 @@ func (b *BasicRunner) Run(ctx context.Context, state StateBag) {
}
// We also check for cancellation here since we can't be sure
// the goroutine that is running to set it actually ran.
if runState(atomic.LoadInt32((*int32)(&b.state))) == stateCancelling {
if runState(atomic.LoadInt32((*int32)(&b.state))) == stateCanceling {
state.Put(StateCancelled, true)
break
}
Expand Down
24 changes: 12 additions & 12 deletions multistep/basic_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func TestBasicRunner_Run(t *testing.T) {
t.Errorf("unexpected result: %#v", results)
}

// Test no halted or cancelled
// Test no halted or canceled
if _, ok := data.GetOk(StateCancelled); ok {
t.Errorf("cancelled should not be in state bag")
t.Errorf("canceled should not be in state bag")
}

if _, ok := data.GetOk(StateHalted); ok {
Expand Down Expand Up @@ -103,10 +103,10 @@ func TestBasicRunner_Cancel(t *testing.T) {

topCtx, topCtxCancel := context.WithCancel(context.Background())

checkCancelled := func(data StateBag) {
cancelled := data.Get(StateCancelled).(bool)
if !cancelled {
t.Fatal("state should be cancelled")
checkCanceled := func(data StateBag) {
canceled := data.Get(StateCancelled).(bool)
if !canceled {
t.Fatal("state should be canceled")
}
}

Expand All @@ -119,15 +119,15 @@ func TestBasicRunner_Cancel(t *testing.T) {
run: func(ctx context.Context, sb StateBag) StepAction {
return ActionContinue
},
cleanup: checkCancelled,
cleanup: checkCanceled,
},
TestStepFn{
run: func(ctx context.Context, sb StateBag) StepAction {
topCtxCancel()
<-ctx.Done()
return ActionContinue
},
cleanup: checkCancelled,
cleanup: checkCanceled,
},
TestStepFn{
run: func(context.Context, StateBag) StepAction {
Expand Down Expand Up @@ -156,8 +156,8 @@ func TestBasicRunner_Cancel(t *testing.T) {
t.Errorf("unexpected result: %#v", results)
}

// Test that it says it is cancelled
checkCancelled(data)
// Test that it says it is canceled
checkCanceled(data)

}

Expand All @@ -170,8 +170,8 @@ func TestBasicRunner_Cancel_Special(t *testing.T) {
state.Put("runner", r)
r.Run(context.Background(), state)

// test that state contains cancelled
// test that state contains canceled
if _, ok := state.GetOk(StateCancelled); !ok {
t.Errorf("cancelled should be in state bag")
t.Errorf("canceled should be in state bag")
}
}
2 changes: 1 addition & 1 deletion multistep/commonsteps/step_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (s *StepDownload) Run(ctx context.Context, state multistep.StateBag) multis

for _, source := range s.Url {
if ctx.Err() != nil {
state.Put("error", fmt.Errorf("Download cancelled: %v", errs))
state.Put("error", fmt.Errorf("Download canceled: %v", errs))
return multistep.ActionHalt
}
ui.Say(fmt.Sprintf("Trying %s", source))
Expand Down
4 changes: 2 additions & 2 deletions multistep/commonsteps/step_output_dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ func (s *StepOutputDir) Cleanup(state multistep.StateBag) {
return
}

_, cancelled := state.GetOk(multistep.StateCancelled)
_, canceled := state.GetOk(multistep.StateCancelled)
_, halted := state.GetOk(multistep.StateHalted)

if cancelled || halted {
if canceled || halted {
ui := state.Get("ui").(packersdk.Ui)

ui.Say("Deleting output directory...")
Expand Down
2 changes: 1 addition & 1 deletion multistep/commonsteps/step_output_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestStepOutputDir_exists(t *testing.T) {
}
}

func TestStepOutputDir_cancelled(t *testing.T) {
func TestStepOutputDir_canceled(t *testing.T) {
state := testState(t)
step := testStepOutputDir(t)

Expand Down
4 changes: 2 additions & 2 deletions multistep/commonsteps/step_provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ func (s *StepProvision) runWithHook(ctx context.Context, state multistep.StateBa

return multistep.ActionContinue
case <-ctx.Done():
log.Printf("Cancelling provisioning due to context cancellation: %s", ctx.Err())
log.Printf("Canceling provisioning due to context cancellation: %s", ctx.Err())
return multistep.ActionHalt
case <-time.After(1 * time.Second):
if _, ok := state.GetOk(multistep.StateCancelled); ok {
log.Println("Cancelling provisioning due to interrupt...")
log.Println("Canceling provisioning due to interrupt...")
return multistep.ActionHalt
}
}
Expand Down
22 changes: 11 additions & 11 deletions multistep/debug_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ func TestDebugRunner_Cancel(t *testing.T) {

topCtx, topCtxCancel := context.WithCancel(context.Background())

checkCancelled := func(data StateBag) {
cancelled := data.Get(StateCancelled).(bool)
if !cancelled {
t.Fatal("state should be cancelled")
checkCanceled := func(data StateBag) {
canceled := data.Get(StateCancelled).(bool)
if !canceled {
t.Fatal("state should be canceled")
}
}

Expand All @@ -116,15 +116,15 @@ func TestDebugRunner_Cancel(t *testing.T) {
run: func(ctx context.Context, sb StateBag) StepAction {
return ActionContinue
},
cleanup: checkCancelled,
cleanup: checkCanceled,
},
TestStepFn{
run: func(ctx context.Context, sb StateBag) StepAction {
topCtxCancel()
<-ctx.Done()
return ActionContinue
},
cleanup: checkCancelled,
cleanup: checkCanceled,
},
TestStepFn{
run: func(context.Context, StateBag) StepAction {
Expand Down Expand Up @@ -153,13 +153,13 @@ func TestDebugRunner_Cancel(t *testing.T) {
t.Errorf("unexpected result: %#v", results)
}

// Test that it says it is cancelled
cancelled, ok := data.GetOk(StateCancelled)
// Test that it says it is canceled
canceled, ok := data.GetOk(StateCancelled)
if !ok {
t.Fatal("could not get state cancelled")
t.Fatal("could not get state canceled")
}
if !cancelled.(bool) {
t.Errorf("not cancelled")
if !canceled.(bool) {
t.Errorf("not canceled")
}
}

Expand Down
4 changes: 2 additions & 2 deletions multistep/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*
multistep is a Go library for building up complex actions using discrete,
individual "steps." These steps are strung together and run in sequence
to achieve a more complex goal. The runner handles cleanup, cancelling, etc.
to achieve a more complex goal. The runner handles cleanup, canceling, etc.
if necessary.

# Basic Example
Expand All @@ -26,7 +26,7 @@ which is passed between steps by the runner.

func (s *stepAdd) Cleanup(multistep.StateBag) {
// This is called after all the steps have run or if the runner is
// cancelled so that cleanup can be performed.
// canceled so that cleanup can be performed.
}

Make a runner and call your array of Steps.
Expand Down
4 changes: 2 additions & 2 deletions multistep/multistep.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (a StepAction) String() string {
}

// This is the key set in the state bag when using the basic runner to
// signal that the step sequence was cancelled.
// signal that the step sequence was canceled.
const StateCancelled = "cancelled"

// This is the key set in the state bag when a step halted the sequence.
Expand All @@ -41,7 +41,7 @@ const StateHalted = "halted"
// of other steps, responsible for performing some specific action.
type Step interface {
// Run is called to perform the action. The passed through context will be
// cancelled when the runner is cancelled. The second parameter is a "state
// canceled when the runner is canceled. The second parameter is a "state
// bag" of untyped things. Please be very careful about type-checking the
// items in this bag.
//
Expand Down
4 changes: 2 additions & 2 deletions multistep/multistep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type TestStepSync struct {
type TestStepWaitForever struct {
}

// A step that manually flips state to cancelling in run
// A step that manually flips state to canceling in run
type TestStepInjectCancel struct {
}

Expand Down Expand Up @@ -71,7 +71,7 @@ func (s TestStepWaitForever) Cleanup(StateBag) {}

func (s TestStepInjectCancel) Run(ctx context.Context, state StateBag) StepAction {
r := state.Get("runner").(*BasicRunner)
r.state = stateCancelling
r.state = stateCanceling
return ActionContinue
}

Expand Down
2 changes: 1 addition & 1 deletion net/configure_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type ListenRangeConfig struct {
}

// Listen tries to Listen to a random open TCP port in the [min, max) range
// until ctx is cancelled.
// until ctx is canceled.
// Listen uses net.ListenConfig.Listen internally.
func (lc ListenRangeConfig) Listen(ctx context.Context) (*Listener, error) {
if lc.Network == "" {
Expand Down
2 changes: 1 addition & 1 deletion packer/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Build interface {

// Run runs the actual builder, returning an artifact implementation
// of what is built. If anything goes wrong, an error is returned.
// Run can be context cancelled.
// Run can be context canceled.
Run(context.Context, Ui) ([]Artifact, error)

// SetDebug will enable/disable debug mode. Debug mode is always
Expand Down
2 changes: 1 addition & 1 deletion packer/communicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type ConfigurableCommunicator interface {

// RunWithUi runs the remote command and streams the output to any configured
// Writers for stdout/stderr, while also writing each line as it comes to a Ui.
// RunWithUi will not return until the command finishes or is cancelled.
// RunWithUi will not return until the command finishes or is canceled.
func (r *RemoteCmd) RunWithUi(ctx context.Context, c Communicator, ui Ui) error {
r.initchan()

Expand Down
2 changes: 1 addition & 1 deletion packer/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestDispatchHook_Run(t *testing.T) {
}

// A helper Hook implementation for testing cancels.
// Run will wait indetinitelly until ctx is cancelled.
// Run will wait indetinitelly until ctx is canceled.
type CancelHook struct {
cancel func()
}
Expand Down
2 changes: 1 addition & 1 deletion packer/post_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ type PostProcessor interface {
// given a value to keep_input_artifact. If forceOverride is true, then any
// user input for keep_input_artifact is ignored and the artifact is either
// kept or discarded according to the value set in `keep`.
// PostProcess is cancellable using context
// PostProcess is cancelable using context
PostProcess(context.Context, Ui, Artifact) (a Artifact, keep bool, forceOverride bool, err error)
}
2 changes: 1 addition & 1 deletion pathing/config_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func homeDir() (string, error) {
u, err := user.Current()

// Get homedir from specified username
// if it is set and different than what we have
// if it is set and different from what we have
if username := os.Getenv("USER"); username != "" && err == nil && u.Username != username {
u, err = user.Lookup(username)
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Set struct {

// ProtocolVersion2 serves as a compatibility argument to the SetDescription
// so plugins can report whether or not they support protobuf/msgpack for
// serialising some of their entities (typically ObjectSpec) to protobuf.
// serializing some of their entities (typically ObjectSpec) to protobuf.
//
// If absent from the SetDescription, it means only gob is supported, and both
// Packer and the plugins should use that for communication.
Expand Down
Loading
Loading