Skip to content

Commit

Permalink
Run linter.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirdosh17 committed Aug 21, 2021
1 parent 6a10f9a commit 92cc781
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion utils/cloudformation.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (dm CFNManager) DeleteStack(stackName string) error {
_, err = cfn.DeleteStack(&input)

// No error only means that the delete request was sent
// It does not gurantee that the stack will be deleted
// It does not guarantee that the stack will be deleted
return err
}

Expand Down
36 changes: 25 additions & 11 deletions utils/deleter.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,34 @@ import (

// -------------- configs ---------------
const (
STACK_DELETION_WAIT_TIME_IN_SEC int16 = 30 // STACK_DELETION_WAIT_TIME_IN_SEC is the time to wait for stacks before peforming status checks after delete requests have been sent.
MAX_DELETE_RETRY_COUNT int16 = 5 // MAX_DELETE_RETRY_COUNT specifies the number of times we should retry deleting a stack before giving up.
// STACK_DELETION_WAIT_TIME_IN_SEC is the time to wait for stacks before peforming status checks after delete requests have been sent.
STACK_DELETION_WAIT_TIME_IN_SEC int16 = 30

// MAX_DELETE_RETRY_COUNT specifies the number of times we should retry deleting a stack before giving up.
MAX_DELETE_RETRY_COUNT int16 = 5
)

var (
NUKE_START_TIME = CurrentUTCDateTime() // NUKE_START_TIME is the start timestamp of teardown.
NUKE_END_TIME = CurrentUTCDateTime() // NUKE_END_TIME is the end timestamp of teardown.
AWS_SDK_MAX_RETRY int = 5 // AWS_SDK_MAX_RETRY is max retry count for AWS SDK.

// stats
TOTAL_STACK_COUNT int // TOTAL_STACK_COUNT is the number of stacks found to be eligible for deletion/
DELETED_STACK_COUNT int // DELETED_STACK_COUNT is the number of stacks deleted so far.
ACTIVE_STACK_COUNT int // ACTIVE_STACK_COUNT is the number of stacks yet to be deleted or in the process of being deleted.
NUKE_DURATION_IN_HRS float64 // NUKE_DURATION_IN_HRS is the total run time of teardown until now.
// NUKE_START_TIME is the start timestamp of teardown.
NUKE_START_TIME = CurrentUTCDateTime()

// NUKE_END_TIME is the end timestamp of teardown.
NUKE_END_TIME = CurrentUTCDateTime()

// AWS_SDK_MAX_RETRY is max retry count for AWS SDK.
AWS_SDK_MAX_RETRY int = 5

// TOTAL_STACK_COUNT is the number of stacks found to be eligible for deletion.
TOTAL_STACK_COUNT int

// DELETED_STACK_COUNT is the number of stacks deleted so far.
DELETED_STACK_COUNT int

// ACTIVE_STACK_COUNT is the number of stacks yet to be deleted or in the process of being deleted.
ACTIVE_STACK_COUNT int

// NUKE_DURATION_IN_HRS is the total run time of teardown until now.
NUKE_DURATION_IN_HRS float64
)

// InitiateTearDown scans and deletes cloudformation stacks respecting the dependencies.
Expand Down

0 comments on commit 92cc781

Please sign in to comment.