Skip to content

Commit 9a83e7f

Browse files
authored
Fix NP panic; Closes #10 (#12)
* Fix NP panic; Closes #10 * Update GH Actions stuff
1 parent ed25b29 commit 9a83e7f

File tree

12 files changed

+182
-107
lines changed

12 files changed

+182
-107
lines changed

.github/workflows/pr.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Set up QEMU
14-
uses: docker/setup-qemu-action@v1
14+
uses: docker/setup-qemu-action@v2
1515
- name: Set up Docker Buildx
16-
uses: docker/setup-buildx-action@v1
17-
- name: Login to DockerHub
18-
uses: docker/login-action@v1
19-
with:
20-
username: ${{ secrets.DOCKERHUB_USERNAME }}
21-
password: ${{ secrets.DOCKERHUB_TOKEN }}
22-
- name: Build and Push
16+
id: buildx
17+
uses: docker/setup-buildx-action@v2
18+
- name: Build
2319
id: docker_build
24-
uses: docker/build-push-action@v2
20+
uses: docker/build-push-action@v3
2521
with:
2622
push: false

.github/workflows/release.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,20 @@ jobs:
1313
steps:
1414
- name: Set RELEASE_VERSION
1515
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
16-
# run: echo "RELEASE_VERSION=0.0.1-dev" >> $GITHUB_ENV
1716
- name: Set RELEASE_STRING
1817
run: echo "RELEASE_STRING=v${RELEASE_VERSION}" >> $GITHUB_ENV
1918
- name: Set up QEMU
20-
uses: docker/setup-qemu-action@v1
19+
uses: docker/setup-qemu-action@v2
2120
- name: Set up Docker Buildx
22-
uses: docker/setup-buildx-action@v1
21+
uses: docker/setup-buildx-action@v2
2322
- name: Login to DockerHub
24-
uses: docker/login-action@v1
23+
uses: docker/login-action@v2
2524
with:
2625
username: ${{ secrets.DOCKERHUB_USERNAME }}
2726
password: ${{ secrets.DOCKERHUB_TOKEN }}
2827
- name: Build and Push
2928
id: docker_build
30-
uses: docker/build-push-action@v2
29+
uses: docker/build-push-action@v3
3130
with:
3231
build-args: |
3332
RELEASE_STRING=${{ env.RELEASE_STRING }}
@@ -54,13 +53,12 @@ jobs:
5453
needs: build
5554
steps:
5655
- name: Checkout Code
57-
uses: actions/checkout@v2
56+
uses: actions/checkout@v3
5857
- name: Release
59-
uses: docker://antonyurchenko/git-release:v3
58+
uses: docker://antonyurchenko/git-release:v4
6059
env:
6160
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6261
DRAFT_RELEASE: "false"
6362
PRE_RELEASE: "false"
6463
CHANGELOG_FILE: "CHANGELOG.md"
6564
ALLOW_EMPTY_CHANGELOG: "false"
66-
ALLOW_TAG_PREFIX: "true"

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.1.0] - 2021-06-20
11+
12+
### Changed
13+
14+
- Updated with Go 1.18 and K8s dependencies 1.24.0.
15+
- Fixed NP panic in releaser when labels were not present on the PV.
16+
- Bumping to `v0.1` - I've been using it for a long while now in prod, and it seems to be working fine.
17+
1018
## [0.1.0-alpha1] - 2022-04-26
1119

1220
### Changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17 AS build
1+
FROM golang:1.18 AS build
22

33
ARG RELEASE_STRING=dev
44
ENV IMPORT_PATH="github.com/plumber-cd/kubernetes-dynamic-reclaimable-pvc-controllers"

examples/basic/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Basic
2+
3+
Basic example - testing using a local image.
4+
5+
1. Build
6+
7+
```bash
8+
docker build -t kubernetes-dynamic-reclaimable-pvc-controllers:dev .
9+
```
10+
11+
2. Deploy
12+
13+
```bash
14+
helm repo add plumber-cd https://plumber-cd.github.io/helm/
15+
helm repo update
16+
helm install provisioner plumber-cd/dynamic-pvc-provisioner -f ./examples/basic/values.yaml
17+
helm install releaser plumber-cd/reclaimable-pv-releaser -f ./examples/basic/values.yaml
18+
```
19+
20+
3. Test
21+
22+
```bash
23+
kubectl apply -f ./examples/basic/sc.yaml
24+
25+
kubectl apply -f ./examples/basic/pod.yaml
26+
kubectl delete -f ./examples/basic/pod.yaml
27+
28+
# check PVC being released
29+
30+
kubectl apply -f ./examples/basic/pod.yaml
31+
kubectl delete -f ./examples/basic/pod.yaml
32+
```
33+
34+
4. Cleanup
35+
36+
```bash
37+
kubectl delete -f ./examples/basic/sc.yaml
38+
helm uninstall provisioner
39+
helm uninstall releaser
40+
```

examples/basic/pod2.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

examples/basic/sc.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ kind: StorageClass
22
apiVersion: storage.k8s.io/v1
33
metadata:
44
name: reclaimable-storage-class
5-
provisioner: kubernetes.io/aws-ebs
6-
parameters:
7-
type: gp2
5+
provisioner: rancher.io/local-path
86
reclaimPolicy: Retain
97
volumeBindingMode: WaitForFirstConsumer

examples/basic/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
image:
2+
repository: kubernetes-dynamic-reclaimable-pvc-controllers
3+
tag: dev
4+
pullPolicy: Never

go.mod

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
11
module github.com/plumber-cd/kubernetes-dynamic-reclaimable-pvc-controllers
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/google/uuid v1.3.0
7-
k8s.io/api v0.23.6
8-
k8s.io/apimachinery v0.23.6
9-
k8s.io/client-go v0.23.6
7+
k8s.io/api v0.24.0
8+
k8s.io/apimachinery v0.24.0
9+
k8s.io/client-go v0.24.0
1010
k8s.io/klog/v2 v2.60.1
1111
)
1212

13-
// Seems like upstream lock is broken, causing version mismatch with k8s.io/kube-openapi and others
14-
replace k8s.io/client-go => k8s.io/client-go v0.23.6
15-
1613
require (
1714
github.com/davecgh/go-spew v1.1.1 // indirect
18-
github.com/go-logr/logr v1.2.0 // indirect
15+
github.com/emicklei/go-restful v2.15.0+incompatible // indirect
16+
github.com/go-logr/logr v1.2.3 // indirect
17+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
18+
github.com/go-openapi/jsonreference v0.20.0 // indirect
19+
github.com/go-openapi/swag v0.21.1 // indirect
1920
github.com/gogo/protobuf v1.3.2 // indirect
2021
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
2122
github.com/golang/protobuf v1.5.2 // indirect
22-
github.com/google/go-cmp v0.5.5 // indirect
23-
github.com/google/gofuzz v1.1.0 // indirect
24-
github.com/googleapis/gnostic v0.5.5 // indirect
25-
github.com/imdario/mergo v0.3.5 // indirect
23+
github.com/google/gnostic v0.6.9 // indirect
24+
github.com/google/go-cmp v0.5.8 // indirect
25+
github.com/google/gofuzz v1.2.0 // indirect
26+
github.com/imdario/mergo v0.3.12 // indirect
27+
github.com/josharian/intern v1.0.0 // indirect
2628
github.com/json-iterator/go v1.1.12 // indirect
29+
github.com/mailru/easyjson v0.7.7 // indirect
2730
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2831
github.com/modern-go/reflect2 v1.0.2 // indirect
32+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
2933
github.com/spf13/pflag v1.0.5 // indirect
30-
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
31-
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
32-
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
33-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
34+
golang.org/x/net v0.0.0-20220513224357-95641704303c // indirect
35+
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
36+
golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a // indirect
37+
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 // indirect
3438
golang.org/x/text v0.3.7 // indirect
35-
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
39+
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
3640
google.golang.org/appengine v1.6.7 // indirect
37-
google.golang.org/protobuf v1.27.1 // indirect
41+
google.golang.org/protobuf v1.28.0 // indirect
3842
gopkg.in/inf.v0 v0.9.1 // indirect
3943
gopkg.in/yaml.v2 v2.4.0 // indirect
40-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
41-
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
42-
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
43-
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
44+
gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 // indirect
45+
k8s.io/kube-openapi v0.0.0-20220413171646-5e7f5fdc6da6 // indirect
46+
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
47+
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
4448
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
45-
sigs.k8s.io/yaml v1.2.0 // indirect
49+
sigs.k8s.io/yaml v1.3.0 // indirect
4650
)

0 commit comments

Comments
 (0)