Skip to content

Commit

Permalink
Do not update forbidden fields for statefulset (#75)
Browse files Browse the repository at this point in the history
Every time I upgrade this helm chart I got this error
```
Error: UPGRADE FAILED: cannot patch "vaultwarden" with kind StatefulSet: StatefulSet.apps "vaultwarden" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden
```

Let's not put all the labels from helper, because they contain also chart version which changes on every upgrade
```
    volumeClaimTemplates:
      - metadata:
          name: vaultwarden-data
          labels:
-             helm.sh/chart: vaultwarden-0.20.0
+             helm.sh/chart: vaultwarden-0.22.1
              app.kubernetes.io/name: vaultwarden
              app.kubernetes.io/instance: vaultwarden
-             app.kubernetes.io/version: "1.30.1"
+             app.kubernetes.io/version: "1.30.3"
              app.kubernetes.io/managed-by: Helm
```

Fixes: #58

* Update charts/vaultwarden/Chart.yaml

Co-authored-by: Nicholas Santiago <[email protected]>

---------

Co-authored-by: Nicholas Santiago <[email protected]>
  • Loading branch information
dolohow and santiagon610 authored Feb 21, 2024
1 parent 5ca9c62 commit 5b80986
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/vaultwarden/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- name: guerzon
email: [email protected]
url: https://github.com/guerzon
version: 0.22.1
version: 0.22.2
kubeVersion: ">=1.12.0-0"
8 changes: 6 additions & 2 deletions charts/vaultwarden/templates/_pvcSpec.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ volumeClaimTemplates:
- metadata:
name: {{ .name }}
labels:
{{- include "vaultwarden.labels" $ | nindent 10 }}
app.kubernetes.io/component: vaultwarden
app.kubernetes.io/name: {{ include "vaultwarden.fullname" . }}
app.kubernetes.io/instance: {{ include "vaultwarden.fullname" . }}
annotations:
meta.helm.sh/release-name: {{ $.Release.Name | quote }}
meta.helm.sh/release-namespace: {{ $.Release.Namespace | quote }}
Expand All @@ -26,7 +28,9 @@ volumeClaimTemplates:
- metadata:
name: {{ .name }}
labels:
{{- include "vaultwarden.labels" $ | nindent 10 }}
app.kubernetes.io/component: vaultwarden
app.kubernetes.io/name: {{ include "vaultwarden.fullname" . }}
app.kubernetes.io/instance: {{ include "vaultwarden.fullname" . }}
annotations:
meta.helm.sh/release-name: {{ $.Release.Name | quote }}
meta.helm.sh/release-namespace: {{ $.Release.Namespace | quote }}
Expand Down

0 comments on commit 5b80986

Please sign in to comment.