Skip to content

Support default-storage-class config for user volume PVCs - #163

Draft
jbarno wants to merge 2 commits into
masterfrom
feature/default-storage-class
Draft

Support default-storage-class config for user volume PVCs#163
jbarno wants to merge 2 commits into
masterfrom
feature/default-storage-class

Conversation

@jbarno

@jbarno jbarno commented Aug 20, 2026

Copy link
Copy Markdown

Allow hatchery to pin the user volume PersistentVolumeClaims to a configured StorageClass via a new 'default-storage-class' config option in hatchery.json. When the option is empty (the default), claims are created without a storageClassName so the cluster-default StorageClass is used, preserving existing behavior.

Paired with:
uc-cdis/gen3-helm#685

Allow hatchery to pin the user volume PersistentVolumeClaims to a
configured StorageClass via a new 'default-storage-class' config option
in hatchery.json. When the option is empty (the default), claims are
created without a storageClassName so the cluster-default StorageClass
is used, preserving existing behavior.
@github-actions

Copy link
Copy Markdown

Integration Tests

filepath passed SUBTOTAL
tests/test_discoverypage.py 1 1
tests/test_workspace.py 1 1
TOTAL 2 2

Please find the detailed integration test report here

Please find the Github Action logs here

aws-sdk-go v1 was deprecated by AWS (end of support 2025-07-31) and
staticcheck now flags every v1 import as SA1019. The codebase still
depends on v1 across ~20 files; migrating to aws-sdk-go-v2 is a
separate effort. Until then, exclude these diagnostics so CI reflects
newly introduced issues only.
@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed SUBTOTAL
tests/test_discoverypage.py 1 0 1
tests/test_workspace.py 0 1 1
TOTAL 1 1 2

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_workspace.py 1 1
TOTAL 1 1

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

@jz-channing

Copy link
Copy Markdown

We applied this patch manually, built a custom hatchery docker image locally, and deployed the custom hatchery in our Gen3 stack. This PR works for us!

@jz-channing

Copy link
Copy Markdown

I need to update my previous comment. I was so excited to get this working that I forgot to mention an additional change we needed to make. I may not have solved this the best way, so perhaps someone can suggest a better solution. The final change needed was adding this line in func buildPod in hatchery/pods.go:

diff --git a/hatchery/pods.go b/hatchery/pods.go
index 7052131..7a91f8b 100644
--- a/hatchery/pods.go
+++ b/hatchery/pods.go
@@ -572,6 +572,7 @@ func buildPod(hatchConfig *FullHatcheryConfig, hatchApp *Container, userName str
        labels["app"] = podName
        annotations := make(map[string]string)
        annotations["gen3username"] = userName
+       annotations["nfs.io/username"] = strings.Split(userName, "@")[0]
        annotations["bmh_workspace_id"] = payModelIdValue
        var sideCarRunAsUser int64
        var sideCarRunAsGroup int64

In many cases, there will be some way to map from the username within the Gen3 application to the username for the home directory being mounted. For us, we split the gen3 username on @ and take the first part. This username is added to the pod as an annotation nfs.io/username which was configured within the PV provisioner.

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.

2 participants