Skip to content

Commit

Permalink
replace common.Undo behaviour with undo package equivalent
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed Jun 3, 2021
1 parent e918282 commit 261ddf1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/compute/deploy.go
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/fastly/cli/pkg/config"
"github.com/fastly/cli/pkg/errors"
"github.com/fastly/cli/pkg/text"
"github.com/fastly/cli/pkg/undo"
"github.com/fastly/go-fastly/v3/fastly"
"github.com/kennygrant/sanitize"
)
Expand Down Expand Up @@ -174,7 +175,7 @@ func (c *DeployCommand) Exec(in io.Reader, out io.Writer) (err error) {
progress = text.NewQuietProgress(out)
}

undoStack := common.NewUndoStack()
undoStack := undo.NewStack()

defer func() {
if err != nil {
Expand Down Expand Up @@ -562,7 +563,7 @@ func cfgBackend(backend string, backendPort uint, out io.Writer, in io.Reader, f

// createDomain creates the given domain and handle unrolling the stack in case
// of an error (i.e. will ensure the domain is deleted if there is an error).
func createDomain(progress text.Progress, client api.Interface, serviceID string, version int, domain string, undoStack common.Undoer) error {
func createDomain(progress text.Progress, client api.Interface, serviceID string, version int, domain string, undoStack undo.Stacker) error {
progress.Step("Creating domain...")

undoStack.Push(func() error {
Expand All @@ -587,7 +588,7 @@ func createDomain(progress text.Progress, client api.Interface, serviceID string

// createBackend creates the given domain and handle unrolling the stack in case
// of an error (i.e. will ensure the backend is deleted if there is an error).
func createBackend(progress text.Progress, client api.Interface, serviceID string, version int, backend string, backendPort uint, undoStack common.Undoer) error {
func createBackend(progress text.Progress, client api.Interface, serviceID string, version int, backend string, backendPort uint, undoStack undo.Stacker) error {
progress.Step("Creating backend...")

undoStack.Push(func() error {
Expand Down

0 comments on commit 261ddf1

Please sign in to comment.