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

Error for bad PVC specification #46

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Error for bad PVC specification #46

merged 2 commits into from
Aug 13, 2024

Conversation

mikemckiernan
Copy link
Member

@mikemckiernan mikemckiernan commented Aug 12, 2024

If the PVC isn't created, return predicted name rather than pvc.Name. IIUC, pvc is nil.

I had a bad PVC spec:

  storage:
    pvc:
      create: true
      storageClass: "nfs-client"
      volumeAccessMode: ReadWriteMany

The controller panicked:

2024-08-12T13:16:17Z    INFO    Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference        {"controller": "nimcache", "controllerGroup": "apps.nvidia.com", "controllerKind": "NIMCache", "NIMCache": {"name":"meta-llama3-8b-instruct","namespace":"nim-service"}, "namespace": "nim-service", "name": "meta-llama3-8b-instruct", "reconcileID": "be258a8b-b3d7-405d-9d37-46c7f466635e"}
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x16766ea]
                                                                                                                        goroutine 259 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
        /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:111 +0x1e5
panic({0x17f9da0?, 0x29863a0?})
        /usr/local/go/src/runtime/panic.go:770 +0x132
github.com/NVIDIA/k8s-nim-operator/internal/controller.(*NIMCacheReconciler).reconcilePVC(0xc0004bdd60, {0x1cbc780, 0xc0007067b0}, 0xc000774008)
        /workspace/internal/controller/nimcache_controller.go:240 +0x32a

If the PVC isn't created, return
predicted name rather than pvc.Name.

Signed-off-by: Mike McKiernan <[email protected]>
Signed-off-by: Mike McKiernan <[email protected]>
@mikemckiernan mikemckiernan changed the title Error with predicted name Error for bad PVC specification Aug 12, 2024
@mikemckiernan mikemckiernan self-assigned this Aug 12, 2024
@mikemckiernan mikemckiernan added the bug Something isn't working label Aug 12, 2024
@mikemckiernan mikemckiernan merged commit 378eb2f into main Aug 13, 2024
6 checks passed
@mikemckiernan mikemckiernan deleted the pvc-wo-size-panic branch August 13, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants