Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not udpate forbidden fields for statefulset #75

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

dolohow
Copy link
Contributor

@dolohow dolohow commented Feb 19, 2024

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

Lets 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

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
```

Lets 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: guerzon#58
Copy link
Contributor

@santiagon610 santiagon610 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a simple fix for a problem that's been out there for a while. Well done, @dolohow!

Co-authored-by: Nicholas Santiago <[email protected]>
@dolohow
Copy link
Contributor Author

dolohow commented Feb 20, 2024

I applied your suggestion. Please when merging, squash commits.

Thanks

@santiagon610
Copy link
Contributor

I'm just another contributor on this repo like yourself, but I believe that @guerzon has the default behavior set to Squash and merge, as was my experience on the PR that I just raised a couple days ago.

@guerzon guerzon merged commit 5b80986 into guerzon:main Feb 21, 2024
1 check passed
@guerzon
Copy link
Owner

guerzon commented Feb 21, 2024

Thanks for the PR @dolohow and the input @santiagon610!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest update to chart V0.17.0 breaks upgrade process
3 participants