From 9165a3d4bac44bdf969ccf2e800980b94388d02b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 29 Oct 2020 07:58:07 +0000 Subject: [PATCH 1/6] Update actions/cache action to v2 --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8495b58..65677bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v2-beta with: go-version: '^1.14.1' - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: /home/runner/go/pkg/mod key: go-mod diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ecaffbc..433be81 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v2-beta with: go-version: '^1.14.1' - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: /home/runner/go/pkg/mod key: go-mod diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3b0027..e8142d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-go@v2-beta with: go-version: '^1.14.1' - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: /home/runner/go/pkg/mod key: go-mod diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d92a48d..1c73252 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v2-beta with: go-version: '^1.14.1' - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: /home/runner/go/pkg/mod key: go-mod From 1c71a235b8657081dcc968d1fa498d9deb69c96f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 29 Oct 2020 07:58:15 +0000 Subject: [PATCH 2/6] Update actions/checkout action to v2 --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65677bc..1173b9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v2-beta with: go-version: '^1.14.1' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 433be81..35b4f65 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v2-beta with: go-version: '^1.14.1' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8142d6..445b08a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v2-beta with: go-version: '^1.14.1' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c73252..f4fac76 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/setup-go@v2-beta with: go-version: '^1.14.1' From 2d9872a9f29246a4cd5186b182a253200d12cd44 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 13 Nov 2020 16:13:01 +0100 Subject: [PATCH 3/6] Update Go to 1.15 Signed-off-by: Chris --- .github/workflows/build.yml | 13 +++++++++---- .github/workflows/lint.yml | 13 +++++++++---- .github/workflows/release.yml | 15 +++++++++++---- .github/workflows/test.yml | 15 +++++++++++---- .goreleaser.yml | 1 + go.mod | 2 +- 6 files changed, 42 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1173b9d..5b279d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,18 +10,23 @@ on: pull_request: types: [opened, reopened] +env: + GO_VERSION: "^1.15.2" + jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2-beta + - uses: actions/setup-go@v2 with: - go-version: '^1.14.1' + go-version: ${{ env.GO_VERSION }} - uses: actions/cache@v2 with: - path: /home/runner/go/pkg/mod - key: go-mod + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - uses: goreleaser/goreleaser-action@v1 with: args: release --snapshot --skip-sign diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 35b4f65..fb001de 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,17 +10,22 @@ on: pull_request: types: [opened, reopened] +env: + GO_VERSION: "^1.15.2" + jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2-beta + - uses: actions/setup-go@v2 with: - go-version: '^1.14.1' + go-version: ${{ env.GO_VERSION }} - uses: actions/cache@v2 with: - path: /home/runner/go/pkg/mod - key: go-mod + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - name: Run linters run: make lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 445b08a..52fb218 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,18 +6,25 @@ on: tags: - "*" +env: + GO_VERSION: "^1.15.2" + jobs: goreleaser: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2-beta with: - go-version: '^1.14.1' + fetch-depth: 0 + - uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} - uses: actions/cache@v2 with: - path: /home/runner/go/pkg/mod - key: go-mod + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - name: Login to Docker hub run: docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASSWORD }} - uses: goreleaser/goreleaser-action@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4fac76..f1b9924 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,17 +10,24 @@ on: pull_request: types: [opened, reopened] +env: + GO_VERSION: "^1.15.2" + jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2-beta with: - go-version: '^1.14.1' + fetch-depth: 0 # some unit tests test the Git integration with our own git history + - uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} - uses: actions/cache@v2 with: - path: /home/runner/go/pkg/mod - key: go-mod + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - name: Run test suite run: make test diff --git a/.goreleaser.yml b/.goreleaser.yml index dbfe5a8..4b5b6d2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -51,6 +51,7 @@ changelog: - '^Docs:' - '^Test:' - '^Refactor:' + - '^Merge pull request' release: github: diff --git a/go.mod b/go.mod index e2a28c2..88ed518 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/appuio/seiso -go 1.14 +go 1.15 require ( github.com/etdub/goparsetime v0.0.0-20160315173935-ea17b0ac3318 // indirect From b28eed9c2ed2bd26d9c138c6788f406ec53c48c2 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 13 Nov 2020 16:20:16 +0100 Subject: [PATCH 4/6] Skip deleting of objects that aren't found anymore Should not abort anymore when the candidate has been deleted in the meantime. Signed-off-by: Chris --- pkg/configmap/configmap.go | 3 ++- pkg/secret/secret.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/configmap/configmap.go b/pkg/configmap/configmap.go index 9f28c39..c486bb0 100644 --- a/pkg/configmap/configmap.go +++ b/pkg/configmap/configmap.go @@ -8,6 +8,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/thoas/go-funk" v1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" core "k8s.io/client-go/kubernetes/typed/core/v1" @@ -94,7 +95,7 @@ func (cms ConfigMapsService) GetUnused(namespace string, configMaps []v1.ConfigM func (cms ConfigMapsService) Delete(configMaps []v1.ConfigMap) error { for _, resource := range configMaps { err := cms.client.Delete(resource.Name, &metav1.DeleteOptions{}) - if err != nil { + if err != nil && !apierrors.IsNotFound(err) { return err } if cms.configuration.Batch { diff --git a/pkg/secret/secret.go b/pkg/secret/secret.go index 2390beb..b41e061 100644 --- a/pkg/secret/secret.go +++ b/pkg/secret/secret.go @@ -8,6 +8,7 @@ import ( log "github.com/sirupsen/logrus" "github.com/thoas/go-funk" v1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" core "k8s.io/client-go/kubernetes/typed/core/v1" @@ -95,7 +96,7 @@ func (ss SecretsService) GetUnused(namespace string, resources []v1.Secret) (unu func (ss SecretsService) Delete(secrets []v1.Secret) error { for _, resource := range secrets { err := ss.client.Delete(resource.Name, &metav1.DeleteOptions{}) - if err != nil { + if err != nil && !apierrors.IsNotFound(err) { return err } if ss.configuration.Batch { From d77ed475bf1fff2335c9daf58845cbed513b5dcc Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 13 Nov 2020 16:25:25 +0100 Subject: [PATCH 5/6] Update Badges Signed-off-by: Chris --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9800b79..ffc618c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ # Seiso -[![dockeri.co](https://dockeri.co/image/appuio/seiso)](https://hub.docker.com/r/appuio/seiso) - [![](https://img.shields.io/github/workflow/status/appuio/seiso/Build)](https://github.com/appuio/seiso/actions) -[![](https://img.shields.io/github/v/release/appuio/seiso?include_prereleases)](https://github.com/appuio/seiso/releases) -[![](https://img.shields.io/github/issues-raw/appuio/seiso)](https://github.com/appuio/seiso/issues) -[![](https://img.shields.io/github/issues-pr-raw/appuio/seiso)](https://github.com/appuio/seiso/pulls) +[![](https://img.shields.io/github/v/release/appuio/seiso)](https://github.com/appuio/seiso/releases) +![](https://img.shields.io/github/go-mod/go-version/appuio/seiso) +[![](https://img.shields.io/github/downloads/appuio/seiso/total)](https://github.com/appuio/seiso/releases) +[![](https://img.shields.io/docker/pulls/appuio/seiso)](https://img.shields.io/docker/pulls/appuio/seiso) [![](https://img.shields.io/github/license/appuio/seiso)](https://github.com/appuio/seiso/blob/master/LICENSE) Inspired by Robert C. Martin's book, [Clean Code](https://www.investigatii.md/uploads/resurse/Clean_Code.pdf), foreword, page xx: From edbce364fa270ffc4840c4f216ba4b5493dd25eb Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 13 Nov 2020 16:39:20 +0100 Subject: [PATCH 6/6] Update goreleaser/goreleaser-action action to v2 --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b279d3..5735bdc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,6 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - uses: goreleaser/goreleaser-action@v1 + - uses: goreleaser/goreleaser-action@v2 with: args: release --snapshot --skip-sign diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52fb218..24ef264 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,11 +25,14 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- + - name: Import GPG signing key + uses: crazy-max/ghaction-import-gpg@v1 + env: + GPG_PRIVATE_KEY: ${{ secrets.SIGNING_KEY }} - name: Login to Docker hub run: docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASSWORD }} - - uses: goreleaser/goreleaser-action@v1 + - uses: goreleaser/goreleaser-action@v2 with: args: release - key: ${{ secrets.SIGNING_KEY }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}