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

Provide user feedback when no storage class is specified #216

Open
aruneshpa opened this issue Sep 7, 2023 · 1 comment
Open

Provide user feedback when no storage class is specified #216

aruneshpa opened this issue Sep 7, 2023 · 1 comment

Comments

@aruneshpa
Copy link
Contributor

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.

@zyiyi11
Copy link
Contributor

zyiyi11 commented Oct 4, 2023

Looks like v1a2 is handling this err in both validation: https://github.com/vmware-tanzu/vm-operator/blob/main/webhooks/virtualmachine/v1alpha2/validation/virtualmachine_validator.go#L277
and condition:

conditions.MarkFalse(vmCtx.VM, vmopv1.VirtualMachineConditionStorageReady, reason, msg)

Do we still need this issue? @aruneshpa

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

No branches or pull requests

2 participants