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
8 changes: 7 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ jobs:
<<: *defaults
steps:
- checkout
- run:
name: Install Go 1.24
command: |
curl -sSL https://go.dev/dl/go1.24.0.linux-amd64.tar.gz | tar -xz -C /tmp
echo 'export PATH=/tmp/go/bin:$PATH' >> $BASH_ENV
echo 'export GOROOT=/tmp/go' >> $BASH_ENV
- run:
name: Download Go modules
command: go mod download
- run:
name: Install golangci-lint
command: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
- run:
name: Run golangci-lint
command: |
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ run:
timeout: 10m
tests: true
modules-download-mode: readonly
go: "1.23"
go: "1.24"

linters:
enable:
Expand Down
2 changes: 1 addition & 1 deletion aws/resources/ec2_dedicated_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (h *EC2DedicatedHosts) nukeAll(hostIds []*string) error {
e := report.Entry{
Identifier: aws.ToString(hostFailed.ResourceId),
ResourceType: "EC2 Dedicated Host",
Error: fmt.Errorf(*hostFailed.Error.Message),
Error: fmt.Errorf("%s", *hostFailed.Error.Message),
}
report.Record(e)
}
Expand Down
11 changes: 5 additions & 6 deletions aws/resources/ec2_ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package resources

import (
"context"
"fmt"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
Expand Down Expand Up @@ -143,7 +142,7 @@ func (ec2Ipam *EC2IPAMs) nukePublicIPAMPools(ipamID *string) error {
IpamIds: []string{*ipamID},
})
if err != nil {
logging.Errorf(fmt.Sprintf("Error describing IPAM %s: %s", *ipamID, err.Error()))
logging.Errorf("Error describing IPAM %s: %s", *ipamID, err.Error())
return errors.WithStackTrace(err)
}

Expand All @@ -155,7 +154,7 @@ func (ec2Ipam *EC2IPAMs) nukePublicIPAMPools(ipamID *string) error {
})

if err != nil {
logging.Errorf(fmt.Sprintf("Error describing IPAM Public scope %s: %s", *ipamID, err.Error()))
logging.Errorf("Error describing IPAM Public scope %s: %s", *ipamID, err.Error())
return errors.WithStackTrace(err)
}

Expand All @@ -171,22 +170,22 @@ func (ec2Ipam *EC2IPAMs) nukePublicIPAMPools(ipamID *string) error {
},
})
if err != nil {
logging.Errorf(fmt.Sprintf("Error describing IPAM Pools on public scope %s: %s", *ipamID, err.Error()))
logging.Errorf("Error describing IPAM Pools on public scope %s: %s", *ipamID, err.Error())
return errors.WithStackTrace(err)
}

for _, pool := range output.IpamPools {
// Remove associated CIDRs before deleting IPAM pools to complete de-provisioning.
err := ec2Ipam.deProvisionPoolCIDRs(pool.IpamPoolId)
if err != nil {
logging.Errorf(fmt.Sprintf("Error de-provisioning Pools CIDR on Pool %s : %s", *pool.IpamPoolId, err.Error()))
logging.Errorf("Error de-provisioning Pools CIDR on Pool %s: %s", *pool.IpamPoolId, err.Error())
return errors.WithStackTrace(err)
}

// Release custom allocation from the pool
err = ec2Ipam.releaseCustomAllocations(pool.IpamPoolId)
if err != nil {
logging.Errorf(fmt.Sprintf("Error Release custom allocations of Pool %s : %s", *pool.IpamPoolId, err.Error()))
logging.Errorf("Error releasing custom allocations of Pool %s: %s", *pool.IpamPoolId, err.Error())
return errors.WithStackTrace(err)
}

Expand Down
17 changes: 9 additions & 8 deletions gcp/resources/gcs_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package resources

import (
"context"
"errors"
"fmt"
"strings"
"time"
Expand Down Expand Up @@ -116,16 +117,16 @@ func (b *GCSBuckets) Nuke(identifiers []string) error {
}
if err != nil {
msg := fmt.Sprintf("Error listing objects in bucket %s: %v", name, err)
b.SetNukableStatus(name, fmt.Errorf(msg))
logging.Debugf(msg)
b.SetNukableStatus(name, errors.New(msg))
logging.Debug(msg)
lastError = err
continue
}

if err := bucket.Object(obj.Name).Delete(b.Context); err != nil {
msg := fmt.Sprintf("Error deleting object %s in bucket %s: %v", obj.Name, name, err)
b.SetNukableStatus(name, fmt.Errorf(msg))
logging.Debugf(msg)
b.SetNukableStatus(name, errors.New(msg))
logging.Debug(msg)
lastError = err
continue
}
Expand All @@ -138,15 +139,15 @@ func (b *GCSBuckets) Nuke(identifiers []string) error {
// Try to delete with force option
if err := b.forceDeleteBucket(name, bucket); err != nil {
msg := fmt.Sprintf("Error force deleting bucket %s: %v", name, err)
b.SetNukableStatus(name, fmt.Errorf(msg))
logging.Debugf(msg)
b.SetNukableStatus(name, errors.New(msg))
logging.Debug(msg)
lastError = err
continue
}
} else {
msg := fmt.Sprintf("Error deleting bucket %s: %v", name, err)
b.SetNukableStatus(name, fmt.Errorf(msg))
logging.Debugf(msg)
b.SetNukableStatus(name, errors.New(msg))
logging.Debug(msg)
lastError = err
continue
}
Expand Down