Skip to content

Commit

Permalink
chore: update to [email protected] where scanner is its own package (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen authored Feb 6, 2024
1 parent 33baddf commit c45641b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21.6

require (
github.com/aws/aws-sdk-go v1.50.4
github.com/ekristen/libnuke v0.0.0-20240123221700-d8899f33f580
github.com/ekristen/libnuke v0.8.0
github.com/fatih/color v1.16.0
github.com/golang/mock v1.6.0
github.com/google/uuid v1.6.0
Expand Down Expand Up @@ -33,4 +33,5 @@ require (
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
github.com/aws/aws-sdk-go v1.49.21 h1:Rl8KW6HqkwzhATwvXhyr7vD4JFUMi7oXGAw9SrxxIFY=
github.com/aws/aws-sdk-go v1.49.21/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go v1.50.4 h1:jJNhxunBgfjmCSjMZ3INwQ19ZN3RoGEZfgSCUYF/NZw=
github.com/aws/aws-sdk-go v1.50.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
Expand All @@ -8,14 +6,12 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ekristen/libnuke v0.0.0-20240123221700-d8899f33f580 h1:7F4+KkJLtwDC5STusCTGIcnIjBmOOP7mUOpCzS2KoCU=
github.com/ekristen/libnuke v0.0.0-20240123221700-d8899f33f580/go.mod h1:BqHpyOLHEgCwAi82WbM+1fjGRgdDDG4a8W4ivjfHMP8=
github.com/ekristen/libnuke v0.8.0 h1:dxs+RosOcstbzvxnLyWN4mq1mAuOqMRUi7LEBC8rk44=
github.com/ekristen/libnuke v0.8.0/go.mod h1:WhYx7LDAkvkXwwfhWCASRn7fbifF8kfyhNsUj5zCCVs=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gotidy/ptr v1.4.0 h1:7++suUs+HNHMnyz6/AW3SE+4EnBhupPSQTSI7QNijVc=
Expand Down
11 changes: 6 additions & 5 deletions pkg/commands/nuke/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
libconfig "github.com/ekristen/libnuke/pkg/config"
libnuke "github.com/ekristen/libnuke/pkg/nuke"
"github.com/ekristen/libnuke/pkg/resource"
"github.com/ekristen/libnuke/pkg/scanner"
"github.com/ekristen/libnuke/pkg/types"

"github.com/ekristen/aws-nuke/pkg/awsutil"
Expand Down Expand Up @@ -147,21 +148,21 @@ func execute(c *cli.Context) error {
// Step 1 - Create the region object
region := nuke.NewRegion(regionName, account.ResourceTypeToServiceType, account.NewSession)

// Step 2 - Create the scanner object
scanner := libnuke.NewScanner(regionName, resourceTypes, &nuke.ListerOpts{
// Step 2 - Create the scannerActual object
scannerActual := scanner.New(regionName, resourceTypes, &nuke.ListerOpts{
Region: region,
})

// Step 3 - Register a mutate function that will be called to modify the lister options for each resource type
// see pkg/nuke/resource.go for the MutateOpts function. Its purpose is to create the proper session for the
// proper region.
regMutateErr := scanner.RegisterMutateOptsFunc(nuke.MutateOpts)
regMutateErr := scannerActual.RegisterMutateOptsFunc(nuke.MutateOpts)
if regMutateErr != nil {
return regMutateErr
}

// Step 4 - Register the scanner with the nuke object
regScanErr := n.RegisterScanner(nuke.Account, scanner)
// Step 4 - Register the scannerActual with the nuke object
regScanErr := n.RegisterScanner(nuke.Account, scannerActual)
if regScanErr != nil {
return regScanErr
}
Expand Down

0 comments on commit c45641b

Please sign in to comment.