Skip to content

Provide user feedback when no storage class is specified #216

@aruneshpa

Description

@aruneshpa

What steps did you take and what happened?
Storage class is effectively a mandatory parameter when it comes to creating a VM on Supervisor (which is the only platform supported by VM operator at the moment). However, this is not enforced using validation webhooks. Instead, if storage class is not specified in the VM's spec, the VM is never realized. We do emit logs that the storage policy is required, but not specified. Since developers don't have access to logs in production, this is not helpful.

What did you expect to happen?
A clear feedback to user about the required storage class. Possibly even rejecting the request outright.

Is there anything else you would like to add?
Here's the output from the logs when storage class is not specified:

E0907 02:16:05.359503       1 virtualmachine_controller.go:378] VirtualMachine "msg"="Failed to reconcile VirtualMachine" "error"="StorageClass is required but not specified" "name"="tkg-ns-auto/test-vm"

We need to either modify our validation webhooks to reject such requests (might be a breaking change). Or, emit a condition indicating this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions