Skip to content

how can i update the pvc #3523

Closed Answered by camilamacedo86
frank930211 asked this question in Support
Discussion options

You must be logged in to vote

The error you're seeing, "spec: Forbidden: spec is immutable after creation except resources.requests for bound claims", indicates that you're trying to modify a field of the PersistentVolumeClaim spec that isn't allowed to be changed after the PVC is created. In Kubernetes, once a PersistentVolumeClaim is created, most of its spec is immutable, with the exception of resources.requests for storage.

The code you've provided only modifies the resources.requests for storage, which should be allowed. However, if during your reconcile process, seems that other parts of the PVC spec are being inadvertently changed, you would get this error.

To update a PVC using the controller-runtime's client …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by camilamacedo86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants