Skip to content

Commit acfb971

Browse files
hossainemruztamalsaha
authored andcommitted
Improve error handling + remove metrics handling part (#4)
Handle all errors through a central place and remove metrics handling part (now, update-status send metrics)
1 parent 7e94690 commit acfb971

38 files changed

+11832
-594
lines changed

chart/stash-elasticsearch/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ The following table lists the configurable parameters of the `stash-elasticsearc
6161
| `docker.tag` | Tag of the image that is used to backup/restore Elasticsearch database. This is usually same as the database version it can backup. | `6.3` |
6262
| `backup.esArgs` | Optional arguments to pass to `multielasticdump` command during bakcup process | |
6363
| `restore.esArgs` | Optional arguments to pass to `multielasticdump` command during restore process | |
64-
| `metrics.enabled` | Specifies whether to send Prometheus metrics | `true` |
65-
| `metrics.labels` | Optional comma separated labels to add to the Prometheus metrics | |
6664
| `persistence.enabled` | Enable persistence using PVC. If `false`, a `empty directory` volume will be used for elastic backup directory. | `false` |
6765
| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. | `nil` |
6866
| `persistence.namespace` | The namespace where `pvc` is created. This namespace needs to be same as `backupsession` or `restoresession` namespace. | `default` |
@@ -76,11 +74,5 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm
7674
For example:
7775

7876
```console
79-
helm install --name stash-elasticsearch-6.3 --set metrics.enabled=false appscode/stash-elasticsearch
80-
```
81-
82-
**Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `metrics.labels`.
83-
84-
```console
85-
helm install chart/stash-elasticsearch --set metrics.labels="k1=v1\,k2=v2"
77+
helm install --name stash-elasticsearch-6.3 --set docker.registry=my-registry appscode/stash-elasticsearch
8678
```

chart/stash-elasticsearch/templates/elasticsearch-backup-function.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ spec:
1212
- --provider=${REPOSITORY_PROVIDER:=}
1313
- --bucket=${REPOSITORY_BUCKET:=}
1414
- --endpoint=${REPOSITORY_ENDPOINT:=}
15-
- --rest-server-url=${REPOSITORY_URL:=}
1615
- --path=${REPOSITORY_PREFIX:=}
1716
- --secret-dir=/etc/repository/secret
1817
- --scratch-dir=/tmp
@@ -21,7 +20,7 @@ spec:
2120
- --hostname=${HOSTNAME:=}
2221
# target information
2322
- --namespace=${NAMESPACE:=default}
24-
- --app-binding=${TARGET_NAME:=}
23+
- --appbinding=${TARGET_NAME:=}
2524
# cleanup information
2625
- --retention-keep-last=${RETENTION_KEEP_LAST:=0}
2726
- --retention-keep-hourly=${RETENTION_KEEP_HOURLY:=0}
@@ -34,11 +33,6 @@ spec:
3433
- --retention-dry-run=${RETENTION_DRY_RUN:=false}
3534
# output & metric information
3635
- --output-dir=${outputDir:=}
37-
- --metrics-enabled={{ .Values.metrics.enabled }}
38-
- --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=}
39-
{{- if .Values.metrics.labels }}
40-
- --metrics-labels={{ .Values.metrics.labels | quote }}
41-
{{- end }}
4236
volumeMounts:
4337
- name: ${secretVolume}
4438
mountPath: /etc/repository/secret

chart/stash-elasticsearch/templates/elasticsearch-restore-function.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ spec:
1212
- --provider=${REPOSITORY_PROVIDER:=}
1313
- --bucket=${REPOSITORY_BUCKET:=}
1414
- --endpoint=${REPOSITORY_ENDPOINT:=}
15-
- --rest-server-url=${REPOSITORY_URL:=}
1615
- --path=${REPOSITORY_PREFIX:=}
1716
- --secret-dir=/etc/repository/secret
1817
- --scratch-dir=/tmp
@@ -22,15 +21,10 @@ spec:
2221
- --source-hostname=${SOURCE_HOSTNAME:=}
2322
# target information
2423
- --namespace=${NAMESPACE:=default}
25-
- --app-binding=${TARGET_NAME:=}
24+
- --appbinding=${TARGET_NAME:=}
2625
- --snapshot=${RESTORE_SNAPSHOTS:=}
2726
# output & metric information
2827
- --output-dir=${outputDir:=}
29-
- --metrics-enabled={{ .Values.metrics.enabled }}
30-
- --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=}
31-
{{- if .Values.metrics.labels }}
32-
- --metrics-labels={{ .Values.metrics.labels | quote }}
33-
{{- end }}
3428
volumeMounts:
3529
- name: ${secretVolume}
3630
mountPath: /etc/repository/secret

chart/stash-elasticsearch/values.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ backup:
1313
restore:
1414
esArgs: ""
1515

16-
# default values for prometheus metrics
17-
metrics:
18-
enabled: true
19-
labels: []
20-
2116
## Persist data to a persistent volume
2217
persistence:
2318
enabled: false

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ require (
1010
k8s.io/client-go v11.0.0+incompatible
1111
kmodules.xyz/client-go v0.0.0-20190808141354-bbb9e14f60ab
1212
kmodules.xyz/custom-resources v0.0.0-20190808144301-114abf10dfe2
13-
stash.appscode.dev/stash v0.9.0-rc.0
13+
stash.appscode.dev/stash v0.9.0-rc.0.0.20190910104640-5f49f5d214aa
1414
)
1515

1616
replace (
1717
github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.4.2+incompatible
1818
k8s.io/api => k8s.io/api v0.0.0-20190313235455-40a48860b5ab
1919
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed
2020
k8s.io/apimachinery => github.com/kmodules/apimachinery v0.0.0-20190508045248-a52a97a7a2bf
21-
k8s.io/apiserver => github.com/kmodules/apiserver v0.0.0-20190508082252-8397d761d4b5
21+
k8s.io/apiserver => github.com/kmodules/apiserver v0.0.0-20190811223248-5a95b2df4348
2222
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20190314001948-2899ed30580f
2323
k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20190314002645-c892ea32361a
2424
k8s.io/component-base => k8s.io/component-base v0.0.0-20190314000054-4a91899592f4

go.sum

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW
177177
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
178178
github.com/kmodules/apimachinery v0.0.0-20190508045248-a52a97a7a2bf h1:XUigLZjjxvtR+TD7mncq0wUOaaG2H/zslqM42crk0SY=
179179
github.com/kmodules/apimachinery v0.0.0-20190508045248-a52a97a7a2bf/go.mod h1:1nbDY1cBTGna53FTjqnehJWker1BB75r+ElWRqNcYo8=
180-
github.com/kmodules/apiserver v0.0.0-20190508082252-8397d761d4b5/go.mod h1:rMEImsX8dFD0jGmDQXq3zbWddcIU8vlcrMWPzpXEm9g=
180+
github.com/kmodules/apiserver v0.0.0-20190811223248-5a95b2df4348/go.mod h1:rMEImsX8dFD0jGmDQXq3zbWddcIU8vlcrMWPzpXEm9g=
181181
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
182182
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
183183
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
@@ -431,8 +431,8 @@ kmodules.xyz/client-go v0.0.0-20190808141354-bbb9e14f60ab h1:rnKcFaDLtqpdooase2B
431431
kmodules.xyz/client-go v0.0.0-20190808141354-bbb9e14f60ab/go.mod h1:1GI6h5D31op/2D+Hrn9DhXW6iUd5wsHBQRoLeY7fndM=
432432
kmodules.xyz/custom-resources v0.0.0-20190808144301-114abf10dfe2 h1:u0zEFCvAttk09O64UzY1DVXNke9uAANmf4vllnVquS8=
433433
kmodules.xyz/custom-resources v0.0.0-20190808144301-114abf10dfe2/go.mod h1:vlKyFcCXC+2Kfn3Fa5Z7RnBWyp4t46FSeEutNqpqMm8=
434-
kmodules.xyz/objectstore-api v0.0.0-20190808153322-733e8798e8de h1:Z/z3SSS+mvRGzLT5HXLazogjnOYIfbYTYWrKBsiLtp8=
435-
kmodules.xyz/objectstore-api v0.0.0-20190808153322-733e8798e8de/go.mod h1:Wx+Ffc7weI6zv7NQvq0GWXMGGQFn6LqVb0KcXQFwRFs=
434+
kmodules.xyz/objectstore-api v0.0.0-20190824212210-196174aa0fc0 h1:ELq3ybK3noQP9SyZx34QsnZgU2As9r8hPAGEnuIy7Co=
435+
kmodules.xyz/objectstore-api v0.0.0-20190824212210-196174aa0fc0/go.mod h1:vFvmrMvRlkcUANfU4Ko3dZR3HUhWMUQc1sEHcwufims=
436436
kmodules.xyz/offshoot-api v0.0.0-20190808152534-e3dc715f844b h1:VZUtg4L9Qm2C7PBwa4sp/SvHckKidZSpkA33GoB24SA=
437437
kmodules.xyz/offshoot-api v0.0.0-20190808152534-e3dc715f844b/go.mod h1:AzvHBjJvhFwUEiWrEKfdsgoqt5Ulio44Beo1vPoq7ww=
438438
kmodules.xyz/openshift v0.0.0-20190808144841-c8f9a927f1d1 h1:NmVj5+kPpUgoxRans2XZt5SXm9cVy8E3b4yHaeVzqak=
@@ -444,5 +444,5 @@ sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5
444444
sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
445445
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
446446
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
447-
stash.appscode.dev/stash v0.9.0-rc.0 h1:GhzBnqHYBgq+2bcuwsDK3nhq2PPEhGkBH0EFAXp2OmY=
448-
stash.appscode.dev/stash v0.9.0-rc.0/go.mod h1:/YjAPx/9E4ScxWea1mbJC6qx9TomhqS83AUy2LufVVk=
447+
stash.appscode.dev/stash v0.9.0-rc.0.0.20190910104640-5f49f5d214aa h1:/cDpVS+SY8jr0P9AmPiIkj6EaPrVJzsmGDX2RgUYtMU=
448+
stash.appscode.dev/stash v0.9.0-rc.0.0.20190910104640-5f49f5d214aa/go.mod h1:6WrRpjkI1av7305B60BLRx+PZzwMAoiGmOd5ewYAAyw=

0 commit comments

Comments
 (0)