Skip to content

Commit de16cb0

Browse files
committed
Integration tests and Job
1 parent b72bc50 commit de16cb0

File tree

14 files changed

+209
-100
lines changed

14 files changed

+209
-100
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ COPY go.sum ./
77
RUN go mod download
88

99
COPY *.go ./
10+
COPY pkg ./pkg
11+
COPY Makefile ./
12+
COPY tests ./tests
1013

1114
RUN go build -o /lister-sa
1215

deploy/job.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ spec:
1515
automountServiceAccountToken: true
1616
containers:
1717
- name: command-demo-container
18-
image: lister-sa:0.1
19-
imagePullPolicy: Never
18+
image: ksraj123/stale-sts-pvc-cleaner:0.1
19+
imagePullPolicy: IfNotPresent
20+
env:
21+
- name: PROVISIONERS
22+
value: "openebs.io/local"
23+
- name: NAMESPACES
24+
value: "default"
2025
restartPolicy: Never

deploy/mongodb/pv.yaml

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

deploy/mongodb/pvc.yaml

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

deploy/mongodb/sts.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
clusterIP: None
1313
selector:
1414
role: mongo
15-
sts-pvc-selector: sts-pvc
15+
sts-pvc: "true"
1616
---
1717
apiVersion: apps/v1
1818
kind: StatefulSet
@@ -29,11 +29,8 @@ spec:
2929
metadata:
3030
labels:
3131
role: mongo
32-
sts-pvc-selector: sts-pvc
32+
sts-pvc: "true"
3333
environment: test
34-
#This label will be used by openebs to place in replica
35-
# pod anti-affinity to make sure data of different mongo
36-
# instances are not co-located on the same node
3734
openebs.io/replica-anti-affinity: vehicle-db
3835
spec:
3936
terminationGracePeriodSeconds: 10

deploy/pod-sa.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ spec:
77
automountServiceAccountToken: true
88
containers:
99
- name: command-demo-container
10-
image: ksraj123/sts-pv:0.1.1
11-
imagePullPolicy: Never
10+
image: ksraj123/stale-sts-pvc-cleaner:0.1
11+
imagePullPolicy: IfNotPresent
1212
command: ["sleep"]
1313
args: ["infinity"]
14+
env:
15+
- name: PROVISIONERS
16+
value: "openebs.io/local"
17+
- name: NAMESPACES
18+
value: "default"
1419
restartPolicy: Never

deploy/sc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: storage.k8s.io/v1
22
kind: StorageClass
33
metadata:
4-
name: test-storage-class
4+
name: test-storage-class-1
55
annotations:
66
openebs.io/delete-dangling-pvc: "true"
77
openebs.io/cas-type: local

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/golang/protobuf v1.5.2 // indirect
77
github.com/onsi/ginkgo v1.16.5 // indirect
88
github.com/onsi/gomega v1.17.0 // indirect
9-
k8s.io/api v0.22.3
9+
k8s.io/api v0.22.4
1010
k8s.io/apimachinery v0.22.4
1111
k8s.io/client-go v0.22.3
1212
sigs.k8s.io/controller-runtime v0.10.3 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ k8s.io/api v0.22.2 h1:M8ZzAD0V6725Fjg53fKeTJxGsJvRbk4TEm/fexHMtfw=
727727
k8s.io/api v0.22.2/go.mod h1:y3ydYpLJAaDI+BbSe2xmGcqxiWHmWjkEeIbiwHvnPR8=
728728
k8s.io/api v0.22.3 h1:wOoES2GoSkUsdped2RB4zYypPqWtvprGoKCENTOOjP4=
729729
k8s.io/api v0.22.3/go.mod h1:azgiXFiXqiWyLCfI62/eYBOu19rj2LKmIhFPP4+33fs=
730+
k8s.io/api v0.22.4 h1:UvyHW0ezB2oIgHAxlYoo6UJQObYXU7awuNarwoHEOjw=
731+
k8s.io/api v0.22.4/go.mod h1:Rgs+9gIGYC5laXQSZZ9JqT5NevNgoGiOdVWi1BAB3qk=
730732
k8s.io/apiextensions-apiserver v0.22.2 h1:zK7qI8Ery7j2CaN23UCFaC1hj7dMiI87n01+nKuewd4=
731733
k8s.io/apiextensions-apiserver v0.22.2/go.mod h1:2E0Ve/isxNl7tWLSUDgi6+cmwHi5fQRdwGVCxbC+KFA=
732734
k8s.io/apimachinery v0.22.2 h1:ejz6y/zNma8clPVfNDLnPbleBo6MpoFy/HBiBqCouVk=

pkg/constants/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ const (
66
PROVISIONERS_ENV_VAR = "PROVISIONERS"
77
STORAGE_CLASS_ANNOTATION = "openebs.io/delete-dangling-pvc"
88
STS_PVC_SELECTOR = "sts-pvc-selector"
9+
OPENEBS_NAMESPACe = "openebs"
910
)

0 commit comments

Comments
 (0)