Skip to content

Commit 2db209d

Browse files
Merge branch 'main' into oreilly-main
2 parents 54c1ff9 + 4d35ec1 commit 2db209d

File tree

5 files changed

+63
-8
lines changed

5 files changed

+63
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: |
2222
go install golang.org/x/lint/golint@latest
2323
- name: Checkout code
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
- name: Check Formatting
2626
run: |
2727
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then

.github/workflows/release.yaml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
go-version: '1.21'
1717
- name: Checkout code
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
2121
- name: Build Project binaries
@@ -31,3 +31,49 @@ jobs:
3131
tag: ${{ github.ref }}
3232
overwrite: true
3333
file_glob: true
34+
35+
docker_build:
36+
runs-on: ubuntu-22.04
37+
name: Docker Build
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
44+
- name: Generate image tags
45+
shell: bash
46+
run: echo "tags=quay.io/rebuy/aws-nuke:${GITHUB_REF#refs/tags/},docker.io/rebuy/aws-nuke:${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
47+
id: generate_tags
48+
49+
- name: Set up QEMU
50+
id: qemu
51+
uses: docker/setup-qemu-action@v2
52+
with:
53+
platforms: arm64
54+
55+
- name: Set up Docker Buildx
56+
uses: docker/setup-buildx-action@v2
57+
with:
58+
install: true
59+
60+
- name: Login to Docker Hub
61+
uses: docker/login-action@v2
62+
with:
63+
username: ${{ secrets.DOCKER_USERNAME }}
64+
password: ${{ secrets.DOCKER_PASSWORD }}
65+
66+
- name: Login to Quay.io
67+
uses: docker/login-action@v2
68+
with:
69+
registry: quay.io
70+
username: ${{ secrets.QUAY_USERNAME }}
71+
password: ${{ secrets.QUAY_PASSWORD }}
72+
73+
- name: Build and push
74+
uses: docker/build-push-action@v3
75+
with:
76+
context: .
77+
push: true
78+
tags: ${{ steps.generate_tags.outputs.tags }}
79+
platforms: linux/amd64,linux/arm64

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/rebuy-de/aws-nuke/v2
33
go 1.21
44

55
require (
6-
github.com/aws/aws-sdk-go v1.44.328
6+
github.com/aws/aws-sdk-go v1.45.26
77
github.com/fatih/color v1.15.0
88
github.com/golang/mock v1.6.0
99
github.com/google/uuid v1.3.1
@@ -13,7 +13,7 @@ require (
1313
github.com/sirupsen/logrus v1.9.3
1414
github.com/spf13/cobra v1.7.0
1515
github.com/stretchr/testify v1.8.4
16-
golang.org/x/sync v0.3.0
16+
golang.org/x/sync v0.4.0
1717
gopkg.in/yaml.v3 v3.0.1
1818
)
1919

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/aws/aws-sdk-go v1.44.328 h1:WBwlf8ym9SDQ/GTIBO9eXyvwappKJyOetWJKl4mT7ZU=
2-
github.com/aws/aws-sdk-go v1.44.328/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
1+
github.com/aws/aws-sdk-go v1.45.26 h1:PJ2NJNY5N/yeobLYe1Y+xLdavBi67ZI8gvph6ftwVCg=
2+
github.com/aws/aws-sdk-go v1.45.26/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
33
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
44
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
55
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -75,8 +75,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
7575
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
7676
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
7777
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
78-
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
79-
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
78+
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
79+
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
8080
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
8181
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
8282
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

resources/opensearchservice-packages.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package resources
22

33
import (
4+
"fmt"
5+
"strings"
46
"time"
57

68
"github.com/aws/aws-sdk-go/aws/session"
@@ -54,6 +56,13 @@ func ListOSPackages(sess *session.Session) ([]Resource, error) {
5456
return resources, nil
5557
}
5658

59+
func (o *OSPackage) Filter() error {
60+
if strings.HasPrefix(*o.packageID, "G") {
61+
return fmt.Errorf("cannot delete default opensearch packages")
62+
}
63+
return nil
64+
}
65+
5766
func (o *OSPackage) Remove() error {
5867
_, err := o.svc.DeletePackage(&opensearchservice.DeletePackageInput{
5968
PackageID: o.packageID,

0 commit comments

Comments
 (0)